Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seg Fault when trying to check if thread is attached to JVM #22

Closed
jimishjoban opened this issue Jan 8, 2014 · 3 comments
Closed

Seg Fault when trying to check if thread is attached to JVM #22

jimishjoban opened this issue Jan 8, 2014 · 3 comments

Comments

@jimishjoban
Copy link

Hello,

I am trying to run this command inside python console:

import jpype
jpype.isThreadAttachedToJVM()
Segmentation fault

Python Crashes and here's the Report I can see on MacOS... (sorry for the long trail)

We saw this issue when using python-boilerpipe and this line seems to be the culprit. Any help would be greatly appreciated...

Process: Python [20689]
Path: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: bash [6859]

Date/Time: 2014-01-08 18:08:35.278 +0530
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6

Interval Since Last Report: 2915 sec
Crashes Since Last Report: 11
Per-App Crashes Since Last Report: 11
Anonymous UUID: CE1496F8-7C2D-4418-A354-1BCB42493EC9

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 _jpype.so 0x000000010058fbb2 JPJavaEnv::isThreadAttached() + 18 (jp_javaenv.cpp:245)
1 _jpype.so 0x000000010058bc89 JPEnv::isThreadAttached() + 9 (jp_env.cpp:96)
2 _jpype.so 0x00000001005c4c49 JPypeModule::isThreadAttached(_object*) + 25 (jpype_module.cpp:235)
3 org.python.python 0x00000001000c25c2 PyEval_EvalFrameEx + 20962
4 org.python.python 0x00000001000c33ca PyEval_EvalFrameEx + 24554
5 org.python.python 0x00000001000c4786 PyEval_EvalCodeEx + 2118
6 org.python.python 0x00000001000c48a6 PyEval_EvalCode + 54
7 org.python.python 0x00000001000e8c5c PyRun_InteractiveOneFlags + 380
8 org.python.python 0x00000001000e8ebe PyRun_InteractiveLoopFlags + 78
9 org.python.python 0x00000001000e96d1 PyRun_AnyFileExFlags + 161
10 org.python.python 0x000000010010044d Py_Main + 3101
11 org.python.python 0x0000000100000f14 0x100000000 + 3860

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x0000000000000000 rcx: 0x0000000000000004 rdx: 0x00000001005fc580
rdi: 0x0000000000000000 rsi: 0x0000000000000000 rbp: 0x00007fff5fbfe8c0 rsp: 0x00007fff5fbfe8b0
r8: 0x00000001003fc0a0 r9: 0x00000001003fc0a4 r10: 0x0000000000000033 r11: 0x0000000000000000
r12: 0x0000000100393120 r13: 0x00000001003037d0 r14: 0x0000000100392fa0 r15: 0x00000001004a7f38
rip: 0x000000010058fbb2 rfl: 0x0000000000010202 cr2: 0x0000000000000008

Binary Images:
0x100000000 - 0x100000fff +org.python.python 2.7.6 (2.7.6) /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
0x100003000 - 0x10016efe7 +org.python.python 2.7.6, (c) 2004-2013 Python Software Foundation. (2.7.6) <96E177D6-BA68-399D-7325-FAA0DD7247EB> /Library/Frameworks/Python.framework/Versions/2.7/Python
0x1002f0000 - 0x1002f2ff7 +readline.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so
0x1004f0000 - 0x10050cfe7 libedit.2.dylib 2.11.0 (compatibility 2.0.0) /usr/lib/libedit.2.dylib
0x10051b000 - 0x10056ffe7 +libncursesw.5.dylib 5.0.0 (compatibility 5.0.0) <3F0079C0-01C1-3CB8-19CA-F9B49AA4F4A4> /Library/Frameworks/Python.framework/Versions/2.7/lib/libncursesw.5.dylib
0x100580000 - 0x1005f9ff7 +_jpype.so ??? (???) <0C9CD115-EEF9-A9CD-A8E5-641D3FF14F9E> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_jpype.so
0x100644000 - 0x100648ff7 +operator.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so
0x10064f000 - 0x100654fff +array.so ??? (???) <8B605F47-04D1-A508-FF88-45F843C64496> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/array.so
0x7fff5fc00000 - 0x7fff5fc3be0f dyld 132.1 (???) <29DECB19-0193-2575-D838-CF743F0400B2> /usr/lib/dyld
0x7fff8177a000 - 0x7fff817c6fff libauto.dylib ??? (???) /usr/lib/libauto.dylib
0x7fff85056000 - 0x7fff85095fef libncurses.5.4.dylib 5.4.0 (compatibility 5.4.0) <9D53BE03-6D81-D0CB-F657-4E842E69A66A> /usr/lib/libncurses.5.4.dylib
0x7fff859aa000 - 0x7fff85a60ff7 libobjc.A.dylib 227.0.0 (compatibility 1.0.0) <03140531-3B2D-1EBA-DA7F-E12CC8F63969> /usr/lib/libobjc.A.dylib
0x7fff8620d000 - 0x7fff86384fe7 com.apple.CoreFoundation 6.6.6 (550.44) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x7fff8824b000 - 0x7fff8825cff7 libz.1.dylib 1.2.3 (compatibility 1.0.0) <97019C74-161A-3488-41EC-A6CA8738418C> /usr/lib/libz.1.dylib
0x7fff88a1f000 - 0x7fff88bddfff libicucore.A.dylib 40.0.0 (compatibility 1.0.0) <97A75BFB-0DB6-6F44-36B0-97B7F7208ABB> /usr/lib/libicucore.A.dylib
0x7fff88c8a000 - 0x7fff88d07fef libstdc++.6.dylib 7.9.0 (compatibility 7.0.0) <35ECA411-2C08-FD7D-11B1-1B7A04921A5C> /usr/lib/libstdc++.6.dylib
0x7fff88d08000 - 0x7fff88d0cff7 libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) <95718673-FEEE-B6ED-B127-BCDBDB60D4E5> /usr/lib/system/libmathCommon.A.dylib
0x7fff88d0d000 - 0x7fff88ecefef libSystem.B.dylib 125.2.11 (compatibility 1.0.0) <9AB4F1D1-89DC-0E8A-DC8E-A4FE4D69DB69> /usr/lib/libSystem.B.dylib
0x7fffffe00000 - 0x7fffffe01fff libSystem.B.dylib ??? (???) <9AB4F1D1-89DC-0E8A-DC8E-A4FE4D69DB69> /usr/lib/libSystem.B.dylib

Model: MacBookPro8,2, BootROM MBP81.0047.B27, 4 processors, Intel Core i7, 2 GHz, 4 GB, SMC 1.69f1
Graphics: AMD Radeon HD 6490M, AMD Radeon HD 6490M, PCIe, 256 MB
Graphics: Intel HD Graphics 3000, Intel HD Graphics 3000, Built-In, 384 MB
Memory Module: global_name
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xD6), Broadcom BCM43xx 1.0 5.100.198.104.5)
Bluetooth: Version 2.4.5f3, 2 service, 12 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en1
Serial ATA Device: Hitachi HTS545050B9A302, 465.76 GB
Serial ATA Device: MATSHITADVD-R UJ-898
USB Device: FaceTime HD Camera (Built-in), 0x05ac (Apple Inc.), 0x8509, 0xfa200000 / 3
USB Device: Hub, 0x0424 (SMSC), 0x2513, 0xfa100000 / 2
USB Device: BRCM2070 Hub, 0x0a5c (Broadcom Corp.), 0x4500, 0xfa110000 / 5
USB Device: Bluetooth USB Host Controller, 0x05ac (Apple Inc.), 0x821a, 0xfa113000 / 8
USB Device: Apple Internal Keyboard / Trackpad, 0x05ac (Apple Inc.), 0x0245, 0xfa120000 / 4
USB Device: Hub, 0x0424 (SMSC), 0x2513, 0xfd100000 / 2
USB Device: IR Receiver, 0x05ac (Apple Inc.), 0x8242, 0xfd110000 / 3

@rshiva
Copy link

rshiva commented Jan 8, 2014

Hey,
Even im getting same problem when i do something like this

import jpype
jpype.isThreadAttachedToJVM()
[1] 12696 segmentation fault (core dumped) python

Python version 2.7.3 and OS ubuntu 12.04

Thanks

@tcalmant
Copy link
Contributor

tcalmant commented Jan 8, 2014

Hi,
The exception is raised because no JVM has been started yet.

The following snippet should work:

import jpype
# Start the JVM first
jpype.startJVM(jpype.getDefaultJVMPath())
jpype.isThreadAttachedToJVM()
# Clean up
jpype.shutdownJVM()

@originell
Copy link
Collaborator

closing this as invalid. See discussion in misja/python-boilerpipe#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants