Java 1.6 Segmentation fault 11 (OSX 10.7.4)
Asked Answered
D

2

6

I have .jar file which during runtime reads one .dylib library which I compiled in OSX with GCC compiler.

Application runs without any problems on OSX 10.6.8.

Java version:

java version "1.6.0_33" Java(TM) SE Runtime Environment (build 1.6.0_33-b10-424-10M3720) Java HotSpot(TM) 64-Bit Server VM (build 20.8-b01-424, mixed mode)

GCC version:

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

I use 64-bit Java and libs which .jar needs are compiled for x86_64. So, on Snow Leopard, everything runs fine.

I now switch my application to OSX 10.7.4. There I tried 2 different Java versions:

1st Java version (same as on Snow Leopard):

java version "1.6.0_33" Java(TM) SE Runtime Environment (build 1.6.0_33-b10-424-10M3720) Java HotSpot(TM) 64-Bit Server VM (build 20.8-b01-424, mixed mode)

2nd Java version (updated today):

java version "1.6.0_35" Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811) Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)

GCC version:

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)

I first tried just to run application with .dylib compiled on Snow Leopard and I got this error:

Invalid memory access of location 0x0 rip=0x7fff894aa697 Segmentation fault: 11

And also new lines which didn't caused app to crash, but they don't show on Snow Leopard:

java[1366] <Error>: CGContextGetCTM: invalid context 0x0
java[1366] <Error>: CGContextSetBaseCTM: invalid context 0x0
java[1366] <Error>: CGContextGetCTM: invalid context 0x0
java[1366] <Error>: CGContextSetBaseCTM: invalid context 0x0

After this crash I tried to recompile dependency .dylib with GCC on Lion, but that changed nothing. I still get Segmentation fault: 11 error.

I read about this error on net and as far as I noticed it is very often on Lion since Java update may have messed something, but since I am not so familiar with Java - has anyone encountered these problems and if yes, is there a way to solve this?

Many thanks.


[edit #1: Attempt with Java 7 on OSX 10.7.4]

When running .jar with Java 7, crash occurs again, here's error report:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fff894aa697, pid=1471, tid=31503
#
# JRE version: 7.0_07-b10
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.3-b01 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [CoreFoundation+0x2a697]  CFSetGetValue+0x17
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/username/Desktop/executable/hs_err_pid1471.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Abort trap: 6
Dixie answered 11/9, 2012 at 7:17 Comment(5)
Sounds like an issue with Java 6, I would try Java 7 if possible.Orrery
Unfortunately, Java 6 must be used. I downloaded Java 7 and installed it on OSX Lion, check edit #1 in my question for it's output.Dixie
I would check you have a supported release of the OS. It appears that Java has the same issue so it doesn't help anyway. :|Orrery
Have you tried building OpenJDK for your OS (a bit desperate I know)Orrery
Java 1.6 is requirement for the app, so Java 7 is out of consideration. I will try OpenJDK as you suggested.Dixie
D
2

With Mac OS X 10.8.2 and with Java 6 installation, problems disappeared. I was reading about this problem and read that there was some problems with Java 6 and Mac OS X 10.7.4. As far as I am concerned, I was just waiting to test application on 10.8.2 to check if it produces these errors only on 10.7.4 and it looks like those errors only occur on 10.7.4.

With an OS upgrade, problems are solved which is good enough answer for me in this case.

Best regards.

Dixie answered 10/10, 2012 at 6:24 Comment(0)
C
0

I ran into this today on OS X 10.8.2, so waiting for an update wasn't going to help. I was able to fix it by reinstalling Java for OS X.

I didn't bother trying to uninstall the messed up java, I just re-downloaded it an installed over it. This is the version I installed:

Java For OS X 10.8

If you're not on 10.8(Mountain Lion), then you probably need a different download. It can be found on the same site. Hopefully this helps someone.

Circumambulate answered 18/11, 2012 at 23:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.