kunstmusik / blue

Blue - An Integrated Music Environment
https://blue.kunstmusik.com
GNU General Public License v2.0
130 stars 11 forks source link

Crash with Csound 6.01 API [sf#88] #240

Closed kunstmusik closed 10 years ago

kunstmusik commented 10 years ago

Since updating to Csound 6.01 and using it with the latest blue in API mode, I am seeing blue die with a JRE crash on a regular basis. This seems to happen after doing two or more disk renders. Was not happening until I switched from command-line mode to API mode. It has been happening consistently since I switched back to API mode with the latest Csound.

Environment:

blue console output for a representative session:

[blue] - initialization

program root directory: /home/dave/work/stasisfield-2013 user configuration directory: /home/dave/.blue

loading classes from registry 0dBFS level = 32768.0 Csound version 6.01.0 (double samples) Oct 20 2013 libsndfile-1.0.25 WARNING: could not open library '/usr/local/lib/csound/plugins64-6.0/libwidgets.so' (/usr/local/lib/csound/plugins64-6.0/libwidgets.so: undefined symbol: fl_graphics_driver) WARNING: could not open library '/usr/local/lib/csound/plugins64-6.0/libstk.so' (/usr/lib/x86_64-linux-gnu/libstk.so.0: undefined symbol: _ZN8RtMidiInC1ESsj) WARNING: could not open library '/usr/local/lib/csound/plugins64-6.0/libvirtual.so' (/usr/local/lib/csound/plugins64-6.0/libvirtual.so: undefined symbol: fl_graphics_driver) UnifiedCSD: /tmp/dummy7272078472927671286.csd STARTING FILE Creating orchestra Creating score rtaudio: ALSA module enabled rtmidi: ALSA Raw MIDI module enabled Elapsed time at end of orchestra compile: real: 0.002s, CPU: 0.000s sorting score ... ... done Elapsed time at end of score sort: real: 0.003s, CPU: 0.000s Csound version 6.01.0 (double samples) Oct 20 2013 graphics suppressed, ascii substituted 0dBFS level = 32768.0 orch now loaded audio buffered in 256 sample-frame blocks writing 1024-byte blks of shorts to /tmp/dummy4114278955633944557.wav (WAV) SECTION 1: new alloc for instr 1: B 0.000 .. 0.010 T 0.010 TT 0.010 M: 0.0 0.0 Score finished in csoundPerform(). resetting Csound instance inactive allocs returned to freespace end of score. overall amps: 0.0 0.0 overall samples out of range: 0 0 0 errors in performance Elapsed time at end of performance: real: 0.003s, CPU: 0.000s 512 1024 sample blks of shorts written to /tmp/dummy4114278955633944557.wav (WAV) 0dBFS level = 32768.0 Csound version 6.01.0 (double samples) Oct 20 2013 libsndfile-1.0.25 Python Library Directory set to: /home/dave/blue/blue/pythonLib/standard:/home/dave/blue/blue/pythonLib/blue:/home/dave/.blue/pythonLib Python Interpreter has been reinitialized

= 420.0 = 0.0 = 0.0 Global Duration = 420.0 0dBFS level = 32768.0 Csound version 6.01.0 (double samples) Oct 20 2013 libsndfile-1.0.25 resetting Csound instance 0dBFS level = 32768.0 Csound version 6.01.0 (double samples) Oct 20 2013 libsndfile-1.0.25 = 320.0 = 0.0 = 0.0 Global Duration = 320.0 0dBFS level = 32768.0 Csound version 6.01.0 (double samples) Oct 20 2013 libsndfile-1.0.25 # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x0000000000000000, pid=22487, tid=139782959687424 # # JRE version: 7.0_25-b15 # Java VM: Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode linux-amd64 compressed oops) # Problematic frame: # C 0x0000000000000000 # # 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: # /home/dave/work/stasisfield-2013/hs_err_pid22487.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. # /home/dave/blue/bin/../platform/lib/nbexec: line 572: 22487 Aborted "/opt/jdk1.7.0_25/bin/java" -Djdk.home="/opt/jdk1.7.0_25" -classpath "/home/dave/blue/platform/lib/boot.jar:/home/dave/blue/platform/lib/org-openide-modules.jar:/home/dave/blue/platform/lib/org-openide-util.jar:/home/dave/blue/platform/lib/org-openide-util-lookup.jar:/home/dave/blue/platform/lib/locale/boot_ja.jar:/home/dave/blue/platform/lib/locale/boot_pt_BR.jar:/home/dave/blue/platform/lib/locale/boot_ru.jar:/home/dave/blue/platform/lib/locale/boot_zh_CN.jar:/home/dave/blue/platform/lib/locale/org-openide-modules_ja.jar:/home/dave/blue/platform/lib/locale/org-openide-modules_pt_BR.jar:/home/dave/blue/platform/lib/locale/org-openide-modules_ru.jar:/home/dave/blue/platform/lib/locale/org-openide-modules_zh_CN.jar:/home/dave/blue/platform/lib/locale/org-openide-util_ja.jar:/home/dave/blue/platform/lib/locale/org-openide-util-lookup_ja.jar:/home/dave/blue/platform/lib/locale/org-openide-util-lookup_pt_BR.jar:/home/dave/blue/platform/lib/locale/org-openide-util-lookup_ru.jar:/home/dave/blue/platform/lib/locale/org-openide-util-lookup_zh_CN.jar:/home/dave/blue/platform/lib/locale/org-openide-util_pt_BR.jar:/home/dave/blue/platform/lib/locale/org-openide-util_ru.jar:/home/dave/blue/platform/lib/locale/org-openide-util_zh_CN.jar:/opt/jdk1.7.0_25/lib/dt.jar:/opt/jdk1.7.0_25/lib/tools.jar" -Dnetbeans.dirs="/home/dave/blue/bin/../blue:/home/dave/blue/bin/../ide:" -Dnetbeans.home="/home/dave/blue/platform" '-Xms256m' '-Xmx768m' '-Djava.library.path=/usr/lib/jni' -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="/home/dave/.blue/dev/var/log/heapdump.hprof" org.netbeans.Main --userdir "/home/dave/.blue/dev" "--branding" "blue" 0<&0
kunstmusik commented 10 years ago

Adding crash log.

kunstmusik commented 10 years ago

I think I have this fixed now. I will do a test build and will post it shortly. My analysis is that it looks like the issue was very subtle and had to do with the BlueCallbackWrapper class getting garbage collected even though it was still in use from the native code. The SWIG generated code doesn't have a means to know it has a reference to the object to keep it alive so it was dying in the middle of a render and intermittently (whenever the GC kicked in). The CS6 realtime render service does keep a reference around at the class level, while the disk render service did not and only had a reference locally to the method, which was not enough.

I'll email the blue list to request tests of the build.

kunstmusik commented 10 years ago

Confirmed fixed in 2.5.5.

kunstmusik commented 10 years ago