lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andi Vajda <>
Subject Re: Occasional SIGSEGV passing lists of ints to Java int[]s
Date Fri, 06 Feb 2009 06:42:32 GMT

On Thu, 5 Feb 2009, Aaron Lav wrote:

> On Thu, Feb 05, 2009 at 02:45:21PM -0500, Aaron Lav wrote:
>> It seems like there's a bug which sometimes causes passing lists of
>> ints to Java int[]s to generate a SIGSEGV.
>> ...
> I've noticed that a call to the wrapped functions doesn't seem to be
> necessary to generate the exception: all that's required is that the
> module be imported and the JVM initalized.  The list then seems to
> have an element set to NULL, and any access, whether from Python or
> from jcc trying to convert it to a JArray<int>, will fault.
> (I realized this while trying to figure out why my hardware
> watchpoints weren't triggering.)
> I'm attaching a revised which still generates a SIGSEGV,
> and a gdb session.
> (The NULL tends to show up at one or two offsets, although the
> what offsets those are may vary with the code and environment running, which
> is how I knew to look at 0x1a92a4 in the gdb session.)

Strange indeed.

I looked over this a bit but didn't try to reproduce it yet. I didn't see 
anything odd.

If the mere _presence_ of JCC and calling initVM() causes the arrays to get
corrupted, this could be hard to debug.

Have you tried moving things around, like creating the arrays differently ?
For example: a = list(xrange(count)) instead of the list comprehension ?
Did you try a more recent version of Python ? 
Have you tried this on 32-bit ?

When you don't actually use the arrays after creating them, how are you 
getting the crash ? inside the assert loops ?


View raw message