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[]
Date Fri, 06 Feb 2009 19:07:24 GMT

On Fri, 6 Feb 2009, Aaron Lav wrote:

>> Does it crash if you don't call initVM() ?
> No, the call to _testjcc.initVM(...) seems to be required to
> make it crash.

There are two pieces to initVM():
   - initVM() proper (defined in jcc.cpp)
   - initializing your classes

The initVM() that is called from Python is a function called 
__initialize__() that is generated by JCC. It's defined in a file called 
__init__.cpp. It first calls the actual initVM() and then calls the
__initialize__() on each top level package JCC generates wrappers for.

For example, PyLucene's __initialize__() looks like:

PyObject *__initialize__(PyObject *module, PyObject *args, PyObject *kwds)
     PyObject *env = initVM(module, args, kwds);

     if (env == NULL)
         return NULL;


     return env;

Does it still crash if you comment out the calls to 
__initialize__(module) that the top level __initialize__() makes ?


View raw message