oakes / play-clj

A Clojure game library
The Unlicense
939 stars 73 forks source link

Persistent SIGSEGV error #33

Closed patrickmcelwee closed 10 years ago

patrickmcelwee commented 10 years ago

I have tried this in Java 6, 7 and 8. I am running play-clj 0.3.5 on Mac OS 10.9. Each time I run lein run in desktop, I get an error. In Java 8 it looks like this:

desktop pmm21$ lein run
Compiling our-first-game.core.desktop-launcher
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fff92023acf, pid=26865, tid=39427
#
# JRE version: Java(TM) SE Runtime Environment (8.0_05-b13) (build 1.8.0_05-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [CoreFoundation+0x12acf]  CFStringGetLength+0xf
#
# 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/pmm21/my_apps/our-first-game/desktop/hs_err_pid26865.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.

In Java 6, the error displays a little differently, as invalid memory access.

Sorry if this is not enough information; I am not experienced debugging this kind of issue with Java.

oakes commented 10 years ago

Can you try running 0.3.6 and let me know if you still experience this? On May 26, 2014 9:48 AM, "Patrick McElwee" notifications@github.com wrote:

I have tried this in Java 6, 7 and 8. I am running play-clj 0.3.5 on Mac OS 10.9. Each time I run lein run in desktop, I get an error. In Java 8 it looks like this:

desktop pmm21$ lein run Compiling our-first-game.core.desktop-launcher #

A fatal error has been detected by the Java Runtime Environment:

#

SIGSEGV (0xb) at pc=0x00007fff92023acf, pid=26865, tid=39427

#

JRE version: Java(TM) SE Runtime Environment (8.0_05-b13) (build 1.8.0_05-b13)

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode bsd-amd64 compressed oops)

Problematic frame:

C [CoreFoundation+0x12acf] CFStringGetLength+0xf

#

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/pmm21/my_apps/our-first-game/desktop/hs_err_pid26865.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.

In Java 6, the error displays a little differently, as invalid memory access.

Sorry if this is not enough information; I am not experienced debugging this kind of issue with Java.

Reply to this email directly or view it on GitHubhttps://github.com/oakes/play-clj/issues/33 .

patrickmcelwee commented 10 years ago

Yes, the same error happens on 0.3.6. Thanks

From: Zach Oakes notifications@github.com<mailto:notifications@github.com> Reply-To: oakes/play-clj reply@reply.github.com<mailto:reply@reply.github.com> Date: Monday, May 26, 2014 at 12:05 PM To: oakes/play-clj play-clj@noreply.github.com<mailto:play-clj@noreply.github.com> Cc: Patrick McElwee patrick.mcelwee@duke.edu<mailto:patrick.mcelwee@duke.edu> Subject: Re: [play-clj] Persistent SIGSEGV error (#33)

Can you try running 0.3.6 and let me know if you still experience this? On May 26, 2014 9:48 AM, "Patrick McElwee" notifications@github.com<mailto:notifications@github.com> wrote:

I have tried this in Java 6, 7 and 8. I am running play-clj 0.3.5 on Mac OS 10.9. Each time I run lein run in desktop, I get an error. In Java 8 it looks like this:

desktop pmm21$ lein run Compiling our-first-game.core.desktop-launcher #

A fatal error has been detected by the Java Runtime Environment:

#

SIGSEGV (0xb) at pc=0x00007fff92023acf, pid=26865, tid=39427

#

JRE version: Java(TM) SE Runtime Environment (8.0_05-b13) (build 1.8.0_05-b13)

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode bsd-amd64 compressed oops)

Problematic frame:

C [CoreFoundation+0x12acf] CFStringGetLength+0xf

#

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/pmm21/my_apps/our-first-game/desktop/hs_err_pid26865.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.

In Java 6, the error displays a little differently, as invalid memory access.

Sorry if this is not enough information; I am not experienced debugging this kind of issue with Java.

Reply to this email directly or view it on GitHubhttps://github.com/oakes/play-clj/issues/33 .

Reply to this email directly or view it on GitHubhttps://github.com/oakes/play-clj/issues/33#issuecomment-44201059.

oakes commented 10 years ago

Does the log file say anything useful? This is not a normal Java error; I've only received these errors when dealing with the native parts of LibGDX like the physics engines. Are you saying this is happening in a project you just created?

patrickmcelwee commented 10 years ago

Yes, it is a brand-new project. I am trying to get the 'Hello World' example to come up as in the tutorial.

Here is my effort at extracting the potentially useful bits of the log file:

Current thread (0x00007fcd4e8dc000):  JavaThread "LWJGL Application" [_thread_in_native, id=39427, stack(0x000000011c384000,0x000000011c484000)]
...
Register to memory mapping:

RAX=0x0000000000000000 is an unknown value
RBX=0x0000000000000000 is an unknown value
RCX=0x0000000000000000 is an unknown value
RDX=0x0000000000000001 is an unknown value
RSP=0x000000011c482da0 is pointing into the stack for thread: 0x00007fcd4e8dc000
RBP=0x000000011c482db0 is pointing into the stack for thread: 0x00007fcd4e8dc000
RSI=0x000000011bfa6af0: C.75.5339+0x770 in /private/var/folders/6t/1q83g20138vfws1zfvj_3ljhv86x0d/T/libgdxpmm21/45614fc1/liblwjgl.dylib at 0x000000011bf69000
RDI=0x0000000000000000 is an unknown value
R8 =0x0000000000000040 is an unknown value
R9 =0x000000011c482d00 is pointing into the stack for thread: 0x00007fcd4e8dc000
R10=0x00007fff99499f51: CocoaVersionNumber+0x6620f59 in /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa at 0x00007fff92e78000
R11=0x00007fff92036cb0: CFStringCompare+0 in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation at 0x00007fff92011000
R12=0x0000000000000000 is an unknown value
R13=0x0000000000000000 is an unknown value
R14=0x0000000000000001 is an unknown value
R15=0x000000011bfa6af0: C.75.5339+0x770 in /private/var/folders/6t/1q83g20138vfws1zfvj_3ljhv86x0d/T/libgdxpmm21/45614fc1/liblwjgl.dylib at 0x000000011bf69000

Stack: [0x000000011c384000,0x000000011c484000],  sp=0x000000011c482da0,  free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [CoreFoundation+0x12acf]  CFStringGetLength+0xf
C  [CoreFoundation+0x25cc8]  CFStringCompare+0x18
C  [liblwjgl.dylib+0xc058]  Java_org_lwjgl_opengl_MacOSXDisplay_nGetCurrentDisplayMode+0xb8
j  org.lwjgl.opengl.MacOSXDisplay.nGetCurrentDisplayMode()Ljava/lang/Object;+0
j  org.lwjgl.opengl.MacOSXDisplay.init()Lorg/lwjgl/opengl/DisplayMode;+1
j  org.lwjgl.opengl.Display.<clinit>()V+53
v  ~StubRoutines::call_stub
V  [libjvm.dylib+0x2c5186]  JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x6ae
V  [libjvm.dylib+0x298bcd]  InstanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*)+0xbf
V  [libjvm.dylib+0x29a02d]  InstanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x5c7
V  [libjvm.dylib+0x29a2af]  InstanceKlass::initialize(Thread*)+0x3d
V  [libjvm.dylib+0x39566a]  LinkResolver::resolve_static_call(CallInfo&, KlassHandle&, Symbol*, Symbol*, KlassHandle, bool, bool, Thread*)+0x9c
V  [libjvm.dylib+0x39587e]  LinkResolver::resolve_invokestatic(CallInfo&, constantPoolHandle, int, Thread*)+0x102
V  [libjvm.dylib+0x39593f]  LinkResolver::resolve_invoke(CallInfo&, Handle, constantPoolHandle, int, Bytecodes::Code, Thread*)+0xb3
V  [libjvm.dylib+0x2bf655]  InterpreterRuntime::resolve_invoke(JavaThread*, Bytecodes::Code)+0x371
j  com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setVSync(Z)V+6
j  com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run()V+20
v  ~StubRoutines::call_stub
V  [libjvm.dylib+0x2c5186]  JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x6ae
V  [libjvm.dylib+0x2c5914]  JavaCalls::call_virtual(JavaValue*, KlassHandle, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x164
V  [libjvm.dylib+0x2c5ac0]  JavaCalls::call_virtual(JavaValue*, Handle, KlassHandle, Symbol*, Symbol*, Thread*)+0x4a
V  [libjvm.dylib+0x3152a7]  thread_entry(JavaThread*, Thread*)+0x7c
V  [libjvm.dylib+0x51ccf5]  JavaThread::thread_main_inner()+0x9b
V  [libjvm.dylib+0x51e432]  JavaThread::run()+0x1c2
V  [libjvm.dylib+0x445426]  java_start(Thread*)+0xf6
C  [libsystem_pthread.dylib+0x1899]  _pthread_body+0x8a
C  [libsystem_pthread.dylib+0x172a]  _pthread_struct_init+0x0
C  [libsystem_pthread.dylib+0x5fc9]  thread_start+0xd

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.opengl.MacOSXDisplay.nGetCurrentDisplayMode()Ljava/lang/Object;+0
j  org.lwjgl.opengl.MacOSXDisplay.init()Lorg/lwjgl/opengl/DisplayMode;+1
j  org.lwjgl.opengl.Display.<clinit>()V+53
v  ~StubRoutines::call_stub
j  com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setVSync(Z)V+6
j  com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run()V+20
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x00007fcd4f07b800 JavaThread "DestroyJavaVM" [_thread_blocked, id=2571, stack(0x0000000101656000,0x0000000101756000)]
=>0x00007fcd4e8dc000 JavaThread "LWJGL Application" [_thread_in_native, id=39427, stack(0x000000011c384000,0x000000011c484000)]
  0x00007fcd4c248000 JavaThread "AWT-AppKit" daemon [_thread_in_native, id=8203, stack(0x00007fff5debf000,0x00007fff5e6bf000)]
  0x00007fcd4e80b000 JavaThread "Service Thread" daemon [_thread_blocked, id=21507, stack(0x000000011adcc000,0x000000011aecc000)]
  0x00007fcd4c038800 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=20995, stack(0x000000011acc9000,0x000000011adc9000)]
  0x00007fcd4c021000 JavaThread "C2 CompilerThread2" daemon [_thread_in_native, id=20483, stack(0x000000011abc6000,0x000000011acc6000)]
  0x00007fcd4e801000 JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=19971, stack(0x000000011aac3000,0x000000011abc3000)]
  0x00007fcd4c86a800 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=19459, stack(0x000000011a9c0000,0x000000011aac0000)]
  0x00007fcd4c82c000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=18947, stack(0x000000011a8bd000,0x000000011a9bd000)]
  0x00007fcd4c852800 JavaThread "Finalizer" daemon [_thread_blocked, id=14595, stack(0x000000011a66e000,0x000000011a76e000)]
  0x00007fcd4c017000 JavaThread "Reference Handler" daemon [_thread_blocked, id=14083, stack(0x000000011a56b000,0x000000011a66b000)]

Other Threads:
  0x00007fcd4c851800 VMThread [stack: 0x000000011a468000,0x000000011a568000] [id=13571]
  0x00007fcd4e80b800 WatcherThread [stack: 0x000000011aecf000,0x000000011afcf000] [id=22019]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

...
Deoptimization events (10 events):
Event: 0.966 Thread 0x00007fcd4e000000 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000001039c86e0 method=clojure.lang.Util.hasheq(Ljava/lang/Object;)I @ 29
Event: 0.966 Thread 0x00007fcd4e000000 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000001039c86e0 method=clojure.lang.Util.hasheq(Ljava/lang/Object;)I @ 29
Event: 0.981 Thread 0x00007fcd4e000000 Uncommon trap: reason=unreached action=reinterpret pc=0x00000001038b5824 method=java.lang.AbstractStringBuilder.append(Ljava/lang/String;
)Ljava/lang/AbstractStringBuilder; @ 1
Event: 0.981 Thread 0x00007fcd4e000000 Uncommon trap: reason=unreached action=reinterpret pc=0x0000000103863aa0 method=java.lang.AbstractStringBuilder.append(Ljava/lang/String;
)Ljava/lang/AbstractStringBuilder; @ 1
Event: 1.355 Thread 0x00007fcd4e000000 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x00000001039a9f20 method=java.lang.ThreadLocal.get()Ljava/lang/Object; @ 6
Event: 1.355 Thread 0x00007fcd4e000000 Uncommon trap: reason=unreached action=reinterpret pc=0x00000001039ac138 method=java.lang.ThreadLocal$ThreadLocalMap.getEntry(Ljava/lang/
ThreadLocal;)Ljava/lang/ThreadLocal$ThreadLocalMap$Entry; @ 29
Event: 1.359 Thread 0x00007fcd4e000000 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x00000001039a9f20 method=java.lang.ThreadLocal.get()Ljava/lang/Object; @ 6
Event: 1.362 Thread 0x00007fcd4e000000 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000001038c7160 method=java.util.HashMap.getNode(ILjava/lang/Object;)Ljava
/util/HashMap$Node; @ 126
Event: 1.428 Thread 0x00007fcd4e000000 Uncommon trap: reason=unloaded action=reinterpret pc=0x00000001038ac638 method=java.lang.CharacterData.of(I)Ljava/lang/CharacterData; @ 1
16
Event: 1.428 Thread 0x00007fcd4e8dc000 Uncommon trap: reason=unreached action=reinterpret pc=0x00000001039aa004 method=java.lang.ThreadLocal.get()Ljava/lang/Object; @ 11

Internal exceptions (10 events):
Event: 1.433 Thread 0x00007fcd4e8dc000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795b0f558) thrown at [/HUDSON/workspace/8-2-build-macosx-x86_64/jdk8u5/
2488/hotspot/src/share/vm/prims/jvm.cpp, line 1248]
Event: 1.434 Thread 0x00007fcd4e8dc000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795b1a1e8) thrown at [/HUDSON/workspace/8-2-build-macosx-x86_64/jdk8u5/
2488/hotspot/src/share/vm/prims/jvm.cpp, line 1248]
Event: 1.434 Thread 0x00007fcd4e8dc000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795b21498) thrown at [/HUDSON/workspace/8-2-build-macosx-x86_64/jdk8u5/
2488/hotspot/src/share/vm/prims/jvm.cpp, line 1248]
Event: 1.435 Thread 0x00007fcd4e8dc000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795b281f0) thrown at [/HUDSON/workspace/8-2-build-macosx-x86_64/jdk8u5/
2488/hotspot/src/share/vm/prims/jvm.cpp, line 1248]
Event: 1.435 Thread 0x00007fcd4e8dc000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795b2ef40) thrown at [/HUDSON/workspace/8-2-build-macosx-x86_64/jdk8u5/
2488/hotspot/src/share/vm/prims/jvm.cpp, line 1248]
Event: 1.438 Thread 0x00007fcd4e8dc000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795b401e0) thrown at [/HUDSON/workspace/8-2-build-macosx-x86_64/jdk8u5/
2488/hotspot/src/share/vm/prims/jvm.cpp, line 1248]
Event: 1.438 Thread 0x00007fcd4e8dc000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795b47d30) thrown at [/HUDSON/workspace/8-2-build-macosx-x86_64/jdk8u5/
2488/hotspot/src/share/vm/prims/jvm.cpp, line 1248]
Event: 1.438 Thread 0x00007fcd4e8dc000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795b4fad0) thrown at [/HUDSON/workspace/8-2-build-macosx-x86_64/jdk8u5/
2488/hotspot/src/share/vm/prims/jvm.cpp, line 1248]
Event: 1.438 Thread 0x00007fcd4e8dc000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795b57968) thrown at [/HUDSON/workspace/8-2-build-macosx-x86_64/jdk8u5/
2488/hotspot/src/share/vm/prims/jvm.cpp, line 1248]
Event: 1.439 Thread 0x00007fcd4e8dc000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795b5fa30) thrown at [/HUDSON/workspace/8-2-build-macosx-x86_64/jdk8u5/
2488/hotspot/src/share/vm/prims/jvm.cpp, line 1248]

Events (10 events):                                                                                                                                                   [207/2159]
Event: 1.438 loading class org/lwjgl/opengl/PeerInfo
Event: 1.438 loading class org/lwjgl/opengl/PeerInfo done
Event: 1.438 loading class org/lwjgl/opengl/MacOSXPbufferPeerInfo
Event: 1.438 loading class org/lwjgl/opengl/MacOSXPbufferPeerInfo done
Event: 1.438 loading class org/lwjgl/opengl/MacOSXPeerInfo
Event: 1.438 loading class org/lwjgl/opengl/MacOSXPeerInfo done
Event: 1.438 loading class org/lwjgl/opengl/MacOSXDisplayPeerInfo
Event: 1.438 loading class org/lwjgl/opengl/MacOSXDisplayPeerInfo done
Event: 1.439 loading class org/lwjgl/opengl/MacOSXCanvasPeerInfo
Event: 1.439 loading class org/lwjgl/opengl/MacOSXCanvasPeerInfo done
...
patrickmcelwee commented 10 years ago

I should mention that I tried play-clj 0.2.4 too, with the same result (but I didn't change the versions of any other dependencies - maybe I should do that?)

oakes commented 10 years ago

Yeah the LibGDX versions change along with play-clj versions. If you haven't already, try creating a new project with lein new play-clj hello-world so you are sure you're using the latest LibGDX as well. I'm guessing there is something more fundamentally wrong, though. I've run the latest play-clj on Mac OS 10.9 without problems. The PrivilegedActionException may be a clue.

patrickmcelwee commented 10 years ago

The new hello-world project has same problem on my machine. I may try firing up a Vagrant instance and developing in Linux when I get a chance.

oakes commented 10 years ago

Does this happen when you create and run an uberjar as well? Anything that might narrow it down would be good.

patrickmcelwee commented 10 years ago

great question ... The Hello World app runs fine for me as a standalone jar. I am running Leiningen 2.3.4, straight from the terminal.

patrickmcelwee commented 10 years ago

tried other versions of leiningen back to 2.0 ... no difference

stianeikeland commented 10 years ago

I had the same error, in my case it was caused by: JAVA_TOOL_OPTIONS='-Djava.awt.headless=true'

patrickmcelwee commented 10 years ago

That makes perfect sense. A graphical game shouldn't work in headless mode. I can confirm that removing -Djava.awt.headless=true from JVM_OPTS and JAVA_OPTS fixes this error. Thanks @stianeikeland

patrickmcelwee commented 10 years ago

Would you like me to submit some documentation of this gotcha in the README?