Segmentation fault when starting jvm using jpype

2019-07-30 19:28发布

问题:

I am trying to use java sutime in my Python code. The code has been working fine until yesterday but now ends with Segmentation fault. The problem seems to be coming from

 jpype.startJVM(getDefaultJVMPath())

This function ends with Segmentation fault. The defaultJVMPath is

'/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server/libjvm.so'

I have tried uninstalling and then installing java and jpype. The code works fine in virtual box with less memory, so the problem doesnt seems to be coming from lack of memory. Anyone has any ideas? Any help is appreciated., thanks!

>>> import jpype  
>>> jpype.isJVMStarted()  
0  
>>> jpype.startJVM(jpype.getDefaultJVMPath())  
Segmentation fault  
deepthi@deepthi:~$ 

回答1:

linux-image-3.13.0-121-generic and linux-image-4.4.0-81-generic contain a fix for the Stack Clash vulnerability.

Be careful with kernel updates, which fix this vulnerability. Current patch breaks many java (sun/oracle and openjdk) applications. See Bug #1699772: linux-image-4.4.0-81-generic, linux-image-3.13.0-121-generic Regression: many user-space apps crashing. The solution is to temporary reboot system with old kernel (linux-image-3.13.0-119-generic in Trusty / linux-image-4.4.0-78-generic in Xenial).

Ubuntu kernel developers will prepare new patch in a few days.

UPDATE: Latest updates (at least image-4.4.0-83-generic, linux-image-4.8.0-58-generic, linux-image-4.10.0-26-generic) fix this vulnerability and problems with user-space programs.