Andi Vajda wrote:
>
> On Tue, 18 Jul 2006, David Fraser wrote:
>
>>>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13212 - JNI/CNI
>>>
>>> Until this is supported by the GC module in libgcj (an old bug, but
>>> with a intent of making it work in the future, quoting Hans Boehm, its
>>> author), the usual trick is to use PyLucene.PythonThread which is a
>>> subclass of python's thread class which delegates the starting of the
>>> underlying OS thread to libgcj.
>
>> Right, that's what I was trying to ask above - is the bug I quoted the
>> correct bug? If so, there seems to be a patch on it that if included
>> would support not having to delegating the starting of the OS thread
>> to gcj.
>
> This could be a fix. It is for gcc 4.1, however. I've been able to use
> gcc 4.1 on Gentoo with this patch:
>     http://gcc.gnu.org/ml/java/2006-03/msg00190.html
> which looks similar to the one you found.
>
> I've been able to use gcc 4.1.0 on PPC Mac OS X built with darwinports.
> Other platforms I've either not tried or have failed to produce a sane
> PyLucene (one where all tests pass with make test).
>
> So, depending on your platform, this could work. Please let us know
> what you find, which compiler version and OS you endup making this
> work (or fail) on.
OK I'm trying this on Fedora Core 4 with gcc 4.1.1, and no DB support.
I'm using the latest svn trunk of PyLucene (revision 284)

Standard gcc 4.1.1 runs some of the tests fine but:
- segfaults / locks up on test_PyLuceneThread
- segfaults test_RangeFilter
- sometimes segfaults test_RangeQuery
- segfaults test_Sort
- segfaults test_PythonDirectory (at variable points within the test)
- says Aborted on test_Highlighter
- FAILS all 18 tests in test_PyLucene with "Lock obtain timed out"

These all seeming like threading problems...

The patch you were given on that list seems like an earlier version of
the one attached to the bug (also from Bryce McKinlay) so I used the
version from the bug.

gcc 4.1.1 with the patch from bug 13212 runs most of the tests fine but:
- FAILS all 18 tests in test_PyLucene with "Lock obtain timed out"

I presume therefore that the Lock obtain timed out is unrelated to the
threading tests (any ideas Andi), and that this patch solves the
threading problems on gcc 4.1.1. Yay!

The next steps are:
1) Run tests for using standard Python threads rather than creating them
with PyLucene.PythonThread, and see what needs to be added to support
them (presuming calls to AttachThread methods...)
  - currently getting a segfault here, so obviously things need to be
adapted:
(gdb) bt
#0  0x00ada402 in __kernel_vsyscall ()
#1  0x00c6d876 in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib/libpthread.so.0
#2  0x012c01c0 in _Jv_CondWait () from
/usr/lib/python2.4/site-packages/_PyLucene.so
#3  0x012b50f7 in gnu::gcj::runtime::FinalizerThread::run () from
/usr/lib/python2.4/site-packages/_PyLucene.so
#4  0x012bca59 in _Jv_ThreadRun () from
/usr/lib/python2.4/site-packages/_PyLucene.so
#5  0x012bfd2e in _Jv_ThreadRegister () from
/usr/lib/python2.4/site-packages/_PyLucene.so
#6  0x0141baf8 in GC_start_routine () from
/usr/lib/python2.4/site-packages/_PyLucene.so
#7  0x00c6bbd4 in start_thread () from /lib/libpthread.so.0
#8  0x00bc34fe in clone () from /lib/libc.so.6

2) test out the version compiled with the patched gcj and any changes
from 1) in Apache, and see how well it fares...

3) Investigate on different platforms

Cheers
David

_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to