[Neo4j] Java segfault using paste and Python bindings
Michael Rene Armida
me at marmida.com
Sun Oct 30 01:25:43 CEST 2011
I am attempting to use Paste to serve a small web app that uses neo4j via
the Python bindings. I get a segfault whenever I try to create a new
database via 'neo4j.GraphDatabase'. I have narrowed this down to the
following minimal sample:
http://pastebin.com/MkNRvLR6
The top of the stack trace looks like this:
Stack: [0xb42e7000,0xb4ae8000], sp=0xb4ae44f0, free space=8181k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native
code)
C [_jpype.so+0x26497] JPJavaEnv::NewObjectA(_jclass*, _jmethodID*,
jvalue*)+0x37
C [_jpype.so+0x3c0e8] JPMethodOverload::invokeConstructor(_jclass*,
std::vector<HostRef*, std::allocator<HostRef*> >&)+0x178
C [_jpype.so+0x3a417] JPMethod::invokeConstructor(std::vector<HostRef*,
std::allocator<HostRef*> >&)+0x47
C [_jpype.so+0x1beba] JPClass::newInstance(std::vector<HostRef*,
std::allocator<HostRef*> >&)+0x2a
C [_jpype.so+0x67b9c] PyJPClass::newClassInstance(_object*, _object*)+0xfc
C [python+0x96822] PyEval_EvalFrameEx+0x4332
C [python+0x991e7] PyEval_EvalCodeEx+0x127
I believe that is JPype trying to create an EmbeddedGraphDatabase via
neo4j.GraphDatabase() in python.
I noticed this previous thread:
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-CPython-Pylons-and-threading-td942435.html
That looks like it might be related, except this problem occurs whenever I
try to create a database, not on shutdown. The issue definitely has
something to do with using neo4j under Paste; here's a Python shell session
which shows neo4j working:
>>> import webob
>>> import app
>>> debug_app = app.DebugApp()
>>> response = debug_app(webob.Request.blank('/'))
>>> response.body
'it worked'
Relevant version info:
- ubuntu 11.04 (same crash under 32- and 64-bit systems)
- Python 2.7.1-0ubuntu5
- neo4j_embedded-1.5.b2
- jpype 0.5.4.1-3
- paste 1.7.5.1
- OpenJDK 6b22-1.10.2 (same crash under the Sun JRE)
Thanks for your time and any clues you might have.
More information about the User
mailing list