From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (8.12.3+3.5Wbeta/8.12.6/Debian-8) with ESMTP id h7FHaiGc011046; Sat, 16 Aug 2003 02:36:44 +0900 Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with SMTP id 42A0257FB; Sat, 16 Aug 2003 02:42:30 +0900 (JST) Received: from helium.ruby-lang.org (helium.ruby-lang.org [210.251.121.214]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id D8BE4630029; Sat, 16 Aug 2003 02:42:27 +0900 (JST) Received: from helium.ruby-lang.org (localhost [127.0.0.1]) by helium.ruby-lang.org (Postfix) with ESMTP id E91AF314; Sat, 16 Aug 2003 02:42:26 +0900 (JST) Received: from users.sf.net (12-212-88-204.client.attbi.com [12.212.88.204]) by helium.ruby-lang.org (Postfix) with ESMTP id 19717228 for ; Sat, 16 Aug 2003 02:42:26 +0900 (JST) Received: from central.localdomain (localhost [127.0.0.1]) by users.sf.net (Postfix) with SMTP id 4C1A92076EA for ; Fri, 15 Aug 2003 13:42:23 -0400 (EDT) Date: Sat, 16 Aug 2003 02:42:26 +0900 Posted: Fri, 15 Aug 2003 10:42:23 -0700 From: Ryan Pavlik Reply-To: ruby-core@ruby-lang.org Subject: Re: _id2ref bug? (another break) To: ruby-core@ruby-lang.org Message-Id: <20030815104223.7a644dda.rpav@users.sf.net> In-Reply-To: <200308151017.h7FAH8a15508@moulon.inra.fr> References: <20030814094459.1c21fa19.rpav@users.sf.net> <1060880235.666474.27392.nullmailer@picachu.netlab.jp> <20030814110915.31f8f04d.rpav@users.sf.net> <1060906889.631559.29136.nullmailer@picachu.netlab.jp> <20030814193740.3a5948e1.rpav@users.sf.net> <200308150335.h7F3ZVPL019823@sharui.nakada.kanuma.tochigi.jp> <200308151017.h7FAH8a15508@moulon.inra.fr> X-ML-Name: ruby-core X-Mail-Count: 01426 X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address ruby-core-ctl@ruby-lang.org; help= X-Mailer: Sylpheed version 0.9.3 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-Id: ruby-core.ruby-lang.org List-Software: fml [fml 4.0.3 release (20011202/4.0.3)] List-Post: List-Owner: List-Help: List-Unsubscribe: X-Virus-Scanned: by AMaViS perl-10 On Fri, 15 Aug 2003 19:17:14 +0900 ts wrote: > >>>>> "n" == nobu nokada writes: > > n> BUILTIN_TYPE 63 is T_NODE, which must not appear in Ruby. Try > n> with changing the patched line as following. > > I find this strange and I see only 2 possibilities : > * he make something strange in his module > * he has a bug > > Can I see the complete source of his module ? The only modules I'm using (in addition to anything builtin) are MySQL and StrongTyping, neither of which deal with T_NODE afaik. This isn't so strange. If T_NODE are kept in the same pool as everything else, then it's entirely possible to get one by accident, given IDs are basically pointers. I have checks in place to validate objects (make sure the one I get back from the weakref is the original I was looking for), it's just T_NODE and the other internal ones don't work right from ruby (I'm guessing they're not "real" ruby objects). Anyway, the original caching code I posted is nearly identical to what's going on. I just have enough code and data passing through the system that eventually I get a T_NODE reference, I guess. (Actually the cache code I posted has a minor bug, in that it doesn't validate the object it gets back, you just need to add return nil unless o._oid == oid right after the _id2ref line.) -- Ryan Pavlik "Oh for the love of evil, not this again." - 8BT