Re: Crash in wrapper_base.cpp

Nigel Atkinson <[email protected]> Sat, 09 Jul 2011 15:14:15 +1000
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <1310188459.3823.10.camel@ephebe>
On Fri, 2011-07-08 at 12:22 -0700, Drew McLean wrote:
> Hmmm, I tried running your sample code and I seem to be getting the
> same results each time.  What lines did you modify between tests?
> 
> I tried removing "  v[obj] = obj\n" and "  v[a[i]] = nil\n" for the
> run that doesn't use keys as indices.
> 
> Seems like using an object as a key is perfectly ok.

For me removing those same lines stops the printing of "Lua instance is
nil".  Putting them back brings them back.  They do not happen after the
explicit garbage collection.

It might be that using an object as a key just makes the problem more
likely rather than being the problem itself.

It's as if the "nil'ed" objects are in a half collected state.  The weak
reference held by wrap_base has been set to nil, however the finalise
and destructor have not been run yet - or indeed C++'s delete. 

What compiler/machine are you using?  It might be a good thing that we
are seeing different results - it might lead to the bug faster.

I'm using gcc 4.5.2 on Linux 64bit

Nigel


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2