[pylucene-dev] MoreLikeThis & back to crashing on Mac OS X 10.4.8
Andi Vajda
vajda at osafoundation.org
Wed Feb 14 10:36:28 PST 2007
On Wed, 14 Feb 2007, Bill Janssen wrote:
> Well, after being crash-free for some months, I decided to try the
> PyLucene version of MoreLikeThis, and am crashing every time I invoke
> it, with what looks like heap corruption in the main thread. Should
> I look at StringReader (which I haven't been using before this), or
> MoreLikeThis itself? I'm using 2.0.0-8. Here's my code:
To help you help me narrowing this down, I just checked in two changes:
- added support for MoreLikeThis.like(String)
- added support for MoreLikeThis.retrieveInterestingTerms(String)
This means that you can pass a regular string (utf-8 or unicode) instead of a
Reader. I also added support for the method you asked about yesterday.
Again, having some unit tests for these APIs would be great.
Andi..
ps: Lucene 2.1 is around the corner, it'd be great to have this bug fixed for
PyLucene 2.1
>
> def like_this (index_reader, index_searcher, candidate_string, fieldnames=None):
> try:
> from PyLucene import MoreLikeThis, StringReader
> except ImportError:
> note("interesting_terms not supported; need PyLucene 2.0.0-8 or later")
> return []
>
> mlt = MoreLikeThis(index_reader)
> if fieldnames is not None:
> mlt.setFieldNames(fieldnames)
> reader = StringReader(candidate_string)
> query = mlt.like(reader)
> note("query is %s", query)
> rval = []
> if len(repr(query).split()) < 3:
> note("too few items in query")
> return rval
> if query:
> hits = index_searcher.search(query)
> for i, doc in hits:
> rval.append((doc.get("id"), hits.score(i),))
> reader.close()
> return rval
>
> and here's a typical crash dump:
>
>
> Host Name: myhost
> Date/Time: 2007-02-14 08:34:58.669 -0800
> OS Version: 10.4.8 (Build 8L127)
> Report Version: 4
>
> Command: python
> Path: /usr/bin/python
> Parent: launchd [1]
>
> Version: ??? (???)
>
> PID: 25932
> Thread: 0
>
> Exception: EXC_BAD_ACCESS (0x0001)
> Codes: KERN_INVALID_ADDRESS (0x0001) at 0x800278fb
>
> Thread 0 Crashed:
> 0 org.python.python 0x98aff6bc PyObject_Malloc + 128
> 1 org.python.python 0x98b007e8 PyString_FromStringAndSize + 136
> 2 org.python.python 0x98b03ea8 _PyString_Join + 2152
> 3 org.python.python 0x98b33c5c PyEval_GetFuncDesc + 476
> 4 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 5 org.python.python 0x98b325e4 PyEval_EvalCodeEx + 2132
> 6 org.python.python 0x98b33f90 PyEval_GetFuncDesc + 1296
> 7 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 8 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 9 org.python.python 0x98b325e4 PyEval_EvalCodeEx + 2132
> 10 org.python.python 0x98b33f90 PyEval_GetFuncDesc + 1296
> 11 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 12 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 13 org.python.python 0x98b325e4 PyEval_EvalCodeEx + 2132
> 14 org.python.python 0x98b33f90 PyEval_GetFuncDesc + 1296
> 15 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 16 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 17 org.python.python 0x98b33edc PyEval_GetFuncDesc + 1116
> 18 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 19 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 20 org.python.python 0x98b33edc PyEval_GetFuncDesc + 1116
> 21 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 22 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 23 org.python.python 0x98b33edc PyEval_GetFuncDesc + 1116
> 24 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 25 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 26 org.python.python 0x98b33edc PyEval_GetFuncDesc + 1116
> 27 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 28 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 29 org.python.python 0x98b33edc PyEval_GetFuncDesc + 1116
> 30 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 31 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 32 org.python.python 0x98b33edc PyEval_GetFuncDesc + 1116
> 33 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 34 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 35 org.python.python 0x98b33edc PyEval_GetFuncDesc + 1116
> 36 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 37 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 38 org.python.python 0x98b33edc PyEval_GetFuncDesc + 1116
> 39 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 40 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 41 org.python.python 0x98b33edc PyEval_GetFuncDesc + 1116
> 42 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 43 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 44 org.python.python 0x98b325e4 PyEval_EvalCodeEx + 2132
> 45 org.python.python 0x98b33f90 PyEval_GetFuncDesc + 1296
> 46 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 47 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 48 org.python.python 0x98b325e4 PyEval_EvalCodeEx + 2132
> 49 org.python.python 0x98b33f90 PyEval_GetFuncDesc + 1296
> 50 org.python.python 0x98b33d34 PyEval_GetFuncDesc + 692
> 51 org.python.python 0x98b31414 PyEval_EvalCode + 9612
> 52 org.python.python 0x98b325e4 PyEval_EvalCodeEx + 2132
> 53 org.python.python 0x98b2eeb8 PyEval_EvalCode + 48
> 54 org.python.python 0x98b5308c PyRun_FileExFlags + 224
> 55 org.python.python 0x98b520b0 PyRun_SimpleFileExFlags + 444
> 56 org.python.python 0x98b5ca00 Py_Main + 1996
> 57 python 0x00002574 start + 412
> 58 python 0x00002414 start + 60
>
> Thread 1:
> 0 libSystem.B.dylib 0x9002bbc8 semaphore_wait_signal_trap + 8
> 1 libSystem.B.dylib 0x900306ac pthread_cond_wait + 480
> 2 _PyLucene.so 0x011a3f58 Jv_CondWait(_Jv_ConditionVariable_t*, _Jv_Mutex_t*, long long, int) + 276
> 3 _PyLucene.so 0x011adbb0 gnu::gcj::runtime::FinalizerThread::run() + 244
> 4 _PyLucene.so 0x011494b4 Jv_ThreadRun(java::lang::Thread*) + 44
> 5 _PyLucene.so 0x011a4510 really_start(void*) + 56
> 6 _PyLucene.so 0x01196f58 GC_start_routine + 260
> 7 libSystem.B.dylib 0x9002b508 _pthread_body + 96
>
> Thread 0 crashed with PPC Thread State 64:
> srr0: 0x0000000098aff6bc srr1: 0x100000000200f030 vrsave: 0x0000000000000000
> cr: 0x28448448 xer: 0x0000000020000000 lr: 0x0000000098aff644 ctr: 0x0000000098aff63c
> r0: 0x000000000000001b r1: 0x00000000bfffd470 r2: 0x0000000000000072 r3: 0x00000000800278fb
> r4: 0x0000000000000004 r5: 0x00000000bfffd520 r6: 0x00000000bfffd320 r7: 0x000000000278f000
> r8: 0x00000000bfffd4a0 r9: 0x00000000a00034d0 r10: 0x0000000002751000 r11: 0x00000000a8aeadd4
> r12: 0x0000000098aff63c r13: 0x0000000000095a20 r14: 0x0000000000000000 r15: 0x000000000007a698
> r16: 0x0000000000000000 r17: 0x0000000000000000 r18: 0x0000000000000000 r19: 0x0000000000000000
> r20: 0x0000000000000001 r21: 0x0000000000302bd0 r22: 0x0000000000000001 r23: 0x00000000000986d0
> r24: 0x00000000bfffd65c r25: 0x00000000003394d4 r26: 0x00000000a8acf644 r27: 0x0000000000000018
> r28: 0x000000000278fad5 r29: 0x000000000000001c r30: 0x0000000000000003 r31: 0x0000000098aff644
>
> Binary Images Description:
> 0x1000 - 0x2fff python /usr/bin/python
> 0x5d000 - 0x5efff select.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/select.so
> 0xa3000 - 0xa4fff sha.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/sha.so
> 0xa7000 - 0xa9fff itertools.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/itertools.so
> 0xad000 - 0xb1fff array.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/array.so
> 0xb5000 - 0xb7fff operator.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/operator.so
> 0xfb000 - 0xfdfff _ssl.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/_ssl.so
> 0x245000 - 0x24bfff _socket.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/_socket.so
> 0x251000 - 0x252fff time.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/time.so
> 0x256000 - 0x257fff fcntl.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/fcntl.so
> 0x25a000 - 0x26afff cPickle.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/cPickle.so
> 0x26e000 - 0x26ffff cStringIO.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/cStringIO.so
> 0x272000 - 0x275fff strop.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/strop.so
> 0x279000 - 0x27bfff zlib.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/zlib.so
> 0x27e000 - 0x27ffff math.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/math.so
> 0x282000 - 0x283fff _random.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/_random.so
> 0x286000 - 0x287fff md5.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/md5.so
> 0x28a000 - 0x28cfff binascii.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/binascii.so
> 0x28f000 - 0x292fff struct.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/struct.so
> 0x295000 - 0x296fff termios.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/termios.so
> 0x405000 - 0x407fff unicodedata.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/unicodedata.so
> 0x467000 - 0x46ffff libgcc_s.1.0.dylib /usr/local/gcc-3.4.4/lib/libgcc_s.1.0.dylib
> 0x1008000 - 0x1396fff _PyLucene.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/_PyLucene.so
> 0x1008000 - 0x1396fff _PyLucene.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/_PyLucene.so
> 0x2008000 - 0x208efff libstdc++.6.dylib /usr/local/gcc-3.4.4/lib/libstdc++.6.dylib
> 0x2827000 - 0x2872fff _imaging.so /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PIL/_imaging.so
> 0x8fe00000 - 0x8fe51fff dyld 45.3 /usr/lib/dyld
> 0x90000000 - 0x901bcfff libSystem.B.dylib /usr/lib/libSystem.B.dylib
> 0x90214000 - 0x90219fff libmathCommon.A.dylib /usr/lib/system/libmathCommon.A.dylib
> 0x907ba000 - 0x90893fff com.apple.CoreFoundation 6.4.6 (368.27) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
> 0x908dc000 - 0x908dcfff com.apple.CoreServices 10.4 (???) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
> 0x908de000 - 0x909e0fff libicucore.A.dylib /usr/lib/libicucore.A.dylib
> 0x90a3a000 - 0x90abefff libobjc.A.dylib /usr/lib/libobjc.A.dylib
> 0x90ae8000 - 0x90b58fff com.apple.framework.IOKit 1.4 (???) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
> 0x90b6e000 - 0x90b80fff libauto.dylib /usr/lib/libauto.dylib
> 0x90b87000 - 0x90e5efff com.apple.CoreServices.CarbonCore 681.7 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
> 0x90ec4000 - 0x90f44fff com.apple.CoreServices.OSServices 4.1 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
> 0x90f8e000 - 0x90fcffff com.apple.CFNetwork 4.0 (129.18) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
> 0x90fe4000 - 0x90ffcfff com.apple.WebServices 1.1.2 (1.1.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/WebServicesCore.framework/Versions/A/WebServicesCore
> 0x9100c000 - 0x9108dfff com.apple.SearchKit 1.0.5 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
> 0x910d3000 - 0x910fcfff com.apple.Metadata 10.4.4 (121.36) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
> 0x9110d000 - 0x9111bfff libz.1.dylib /usr/lib/libz.1.dylib
> 0x9111e000 - 0x912d9fff com.apple.security 4.5 (28992) /System/Library/Frameworks/Security.framework/Versions/A/Security
> 0x913d7000 - 0x913e0fff com.apple.DiskArbitration 2.1 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
> 0x913e7000 - 0x9140ffff com.apple.SystemConfiguration 1.8.3 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
> 0x91422000 - 0x9142dfff libgcc_s.1.dylib /usr/lib/libgcc_s.1.dylib
> 0x91a0b000 - 0x91ad3fff libcrypto.0.9.7.dylib /usr/lib/libcrypto.0.9.7.dylib
> 0x92937000 - 0x92b62fff com.apple.Foundation 6.4.6 (567.27) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
> 0x92c80000 - 0x92d5efff libxml2.2.dylib /usr/lib/libxml2.2.dylib
> 0x92d7e000 - 0x92e6cfff libiconv.2.dylib /usr/lib/libiconv.2.dylib
> 0x94f34000 - 0x94f63fff libssl.0.9.7.dylib /usr/lib/libssl.0.9.7.dylib
> 0x98aca000 - 0x98b94fff org.python.python 2.3.3 /System/Library/Frameworks/Python.framework/Versions/2.3/Python
>
>
> _______________________________________________
> pylucene-dev mailing list
> pylucene-dev at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/pylucene-dev
>
More information about the pylucene-dev
mailing list