Hi,
I'm getting pretty stuck on this, so I hope someone may have
a clue.
I ported Csound to Haiku pre-PM, and it works fine there.
When I try to run it in a PM partition it also runs... until I
try to quit,when it locks up hard.
I've narrowed it down to the add-on library I wrote to implement
Haku audio and midi, but I'm actually beginning to think I did
nothing wrong there, and the bug is in the MediaRoster or
somewhere. [Though I'll be happy to be proven wrong...]
I essentially borrowed most of the code from ToneProducer,
and that still runs fine, but it's not a library. My code is dying
when dlclose() is called on it. I'm attaching the debug printout,
which shows that it's hanging in a BLooper Quit() -- apparently
in the MediaRoster.
I sort of suspect MediaRosterUndertaker, as that's been added
since my original code:
http://cgit.haiku-os.org/haiku/commit/src/kits/media/MediaRoster.cpp?id=40de3cd148f2d8edbf4b60bd2221c43f267fea5a
but I can't see anything that might be the cause there.
Any insight appreciated.
Thanks,
-- Pete --
Debug information for team /boot/home/WORK/Csound5.19.01/csound (1099):
CPU(s): 4x Intel Core™ i3-2370M
Memory: 3.88 GiB total, 493.67 MiB used
Haiku revision: hrev50180 Apr 1 2016 07:23:57 (BePC)
Active Threads:
thread 1100: team 1099 debug task
thread 1128: _BMediaRoster_
thread 1129: Csound control
thread 1099: csound (main)
state: Debugged
Frame IP Function Name
-----------------------------------------------
00000000 0x60910112 commpage_syscall + 0x2
Disassembly:
commpage_syscall:
0x60910110: 89e1 mov %esp, %ecx
0x60910112: 0f34 sysenter <--
Frame memory:
0x718b0b9c 0x2109e4c wait_for_thread + 0x18
0x718b0be4 0x25ba5f0 BLooper::Quit() + 0xf8
0x718b0c34 0x1b7db8f
BPrivate::media::BMediaRosterEx::Quit() + 0x97
0x718b0c84 0x1b86828
BPrivate::media::MediaRosterUndertaker::~MediaRosterUndertaker() + 0xe2
0x718b0cc4 0x21727cf __cxa_finalize + 0x12d
0x718b0cec 0x1b6d986
/boot/system/lib/x86/libmedia.so + 0x37986
0x718b0cf8 0x1ba3e38
/boot/system/lib/x86/libmedia.so + 0x6de38
0x718b0d28 0x1fd3a20 unload_library + 0x110
0x718b0d58 0x1fd766a export_unload_library(void*) +
0x22
0x718b0d78 0x21108ad dlclose + 0x1d
0x718b0e88 0x8fe33a csoundCloseLibrary(void*) +
0x2c (Top/csmodule.c:985)
0x718b0ec8 0x1c74af6 _start + 0x4b
0x718b0ef8 0x1fdba6c runtime_loader + 0x130
00000000 0x60910250 commpage_thread_exit + 0
Registers:
eip: 0x60910114
esp: 0x718b0b80
ebp: 0x718b0b9c
eax: 0x0000003b
ebx: 0x021bbb6c
ecx: 0x718b0b80
edx: 0x60910114
esi: 0x718b0bc0
edi: 0x00000468
cs: 0x001b
ds: 0x0023
es: 0x0023
fs: 0x0063
gs: 0x0023
ss: 0x0023
st0: nan
st1: nan
st2: nan
st3: 0
st4: 5
st5: 5
st6: 1e-06
st7: 0.0359
mm0: {0, 0, 0, 0}
mm1: {0x100, 0, 0, 0}
mm2: {0x4, 0, 0, 0}
mm3: {0, 0, 0, 0}
mm4: {0, 0, 0, 0xa000}
mm5: {0, 0, 0, 0xa000}
mm6: {0x6800, 0xaf6c, 0xbd05, 0x8637}
mm7: {0xf000, 0x911c, 0x52ef, 0x92ea}
xmm0: {0xd643, 0xec87, 0xeba4, 0x4bb5, 0xe5a1,
0x3e3f, 0xb236, 0xa90d}
xmm1: {0xb828, 0xd2b2, 0x826, 0x48a7, 0xdfb3, 0x3c98,
0x6000, 0xf024}
xmm2: {0, 0, 0, 0, 0, 0, 0, 0}
xmm3: {0, 0, 0, 0, 0, 0, 0, 0}
xmm4: {0, 0, 0, 0, 0, 0, 0, 0}
xmm5: {0xceed, 0x1767, 0xdb82, 0x47cd, 0x2bbf,
0x4568, 0x8c8a, 0xffcf}
xmm6: {0, 0, 0, 0, 0, 0, 0, 0}
xmm7: {0, 0, 0, 0, 0, 0, 0, 0}
Loaded Images:
ID Text Base Text End Data Base Data
End Type Name
--------------------------------------------------------------------------------
5569 0x00229000 0x00233000 0x00233000 0x00235000
lib /boot/home/WORK/Csound5.19.01/lib/liblo.so.7.0.0
5542 0x00266000 0x003c8000 0x003c8000 0x003da000
lib /boot/home/WORK/Csound5.19.01/lib/libvorbisenc.so.2.0.8
5558 0x003da000 0x003e7000 0x003e7000 0x003e9000
lib /boot/common/apps/Csound/lib/csound/plugins/libdoppler.so
5564 0x003ff000 0x00429000 0x00429000 0x0042a000
lib /boot/system/lib/x86/libpng16.so.16.20.0
5575 0x00609000 0x00616000 0x00616000 0x00617000
lib /boot/system/lib/x86/libmidi2.so
5571 0x00619000 0x00623000 0x00623000 0x00625000
lib /boot/common/apps/Csound/lib/csound/plugins/libpy.so
5555 0x0064c000 0x0064d000 0x0064d000 0x0064e000
lib /boot/common/apps/Csound/lib/csound/plugins/libcellular.so
5541 0x00658000 0x00697000 0x00697000 0x0069d000
lib /boot/home/WORK/Csound5.19.01/lib/libFLAC.so.8.2.0
5556 0x0079b000 0x0079c000 0x0079c000 0x0079e000
lib /boot/common/apps/Csound/lib/csound/plugins/libcs_date.so
5536 0x0080e000 0x00a65000 0x00a65000 0x00a82000
lib /boot/home/WORK/Csound5.19.01/lib/libcsound.so
5554 0x00a87000 0x00a88000 0x00a88000 0x00a8a000
lib /boot/common/apps/Csound/lib/csound/plugins/libampmidid.so
5560 0x00a8e000 0x00a9c000 0x00a9c000 0x00a9e000
lib /boot/common/apps/Csound/lib/csound/plugins/libfluidOpcodes.so
5545 0x00ab1000 0x00ac1000 0x00ac1000 0x00ac2000
lib /boot/system/lib/x86/libroot-addon-icu.so
5537 0x00ada000 0x00bb8000 0x00bb8000 0x00bbc000
lib /boot/system/lib/libiconv.so.2.5.0
5550 0x00c05000 0x00c57000 0x00c57000 0x00c59000
lib /boot/system/lib/x86/libicule.so.56.1
5534 0x00ce9000 0x00d47000 0x00d47000 0x00d4d000
lib /boot/home/WORK/Csound5.19.01/lib/libsndfile.so.1.0.21
5549 0x00e57000 0x00e61000 0x00e61000 0x00e62000
lib /boot/system/lib/x86/libicuio.so.56.1
5548 0x0107c000 0x012df000 0x012df000 0x012ec000
lib /boot/system/lib/x86/libicui18n.so.56.1
5561 0x013a4000 0x013d0000 0x013d0000 0x01438000
lib /boot/system/lib/x86/libfluidsynth.so
5559 0x014e6000 0x014e8000 0x014e8000 0x014e9000
lib /boot/common/apps/Csound/lib/csound/plugins/libfareygen.so
5544 0x014ff000 0x01503000 0x01503000 0x01505000
lib /boot/home/WORK/Csound5.19.01/lib/libogg.so.0.8.0
5553 0x01585000 0x016f0000 0x016f0000 0x016fc000
lib /boot/system/lib/x86/libicuuc.so.56.1
5551 0x01741000 0x0174b000 0x0174b000 0x0174d000
lib /boot/system/lib/x86/libiculx.so.56.1
5562 0x01814000 0x01818000 0x01818000 0x01819000
lib /boot/common/apps/Csound/lib/csound/plugins/libfractalnoise.so
5546 0x01846000 0x01992000 0x01992000 0x0199f000
lib /boot/system/lib/x86/libstdc++.so.6.0.21
5567 0x019dd000 0x01a0b000 0x01a0b000 0x01a0d000
lib /boot/common/apps/Csound/lib/csound/plugins/libmixer.so
5533 0x01a15000 0x01a4b000 0x01a4b000 0x01a52000
lib /boot/system/lib/x86/libnetwork.so
5566 0x01a59000 0x01a5a000 0x01a5a000 0x01a5c000
lib /boot/common/apps/Csound/lib/csound/plugins/libipmidi.so
5532 0x01a60000 0x01a69000 0x01a69000 0x01a6b000
lib /boot/system/lib/libintl.so.8.1.4
5574 0x01b36000 0x01bc0000 0x01bc0000 0x01bc6000
lib /boot/system/lib/x86/libmedia.so
5531 0x01c74000 0x01c76000 0x01c76000 0x01c77000
app /boot/home/WORK/Csound5.19.01/csound
5570 0x01cdd000 0x01ce0000 0x01ce0000 0x01ce1000
lib /boot/common/apps/Csound/lib/csound/plugins/libplaterev.so
5543 0x01ceb000 0x01d13000 0x01d13000 0x01d14000
lib /boot/home/WORK/Csound5.19.01/lib/libvorbis.so.0.4.5
5539 0x01da5000 0x01dc1000 0x01dc1000 0x01dc3000
lib /boot/system/lib/x86/libsupc++.so
5552 0x01dcb000 0x01df5000 0x01df5000 0x01e29000
lib /boot/system/lib/x86/libicutu.so.56.1
5568 0x01e2d000 0x01e30000 0x01e30000 0x01e31000
lib /boot/common/apps/Csound/lib/csound/plugins/libosc.so
5540 0x01e36000 0x01e4e000 0x01e4e000 0x01e4f000
lib /boot/system/lib/x86/libgcc_s.so.1
5565 0x01ed9000 0x01eef000 0x01eef000 0x01ef1000
lib /boot/system/lib/x86/libz.so.1.2.8
5563 0x01f66000 0x01f69000 0x01f69000 0x01f6a000
lib /boot/common/apps/Csound/lib/csound/plugins/libimage.so
5538 0x01f8d000 0x01f91000 0x01f91000 0x01f92000
lib /boot/system/lib/x86/libbsd.so
5530 0x01fca000 0x01fe8000 0x01fe8000 0x01feb000
lib /boot/system/runtime_loader
5535 0x020dd000 0x021b8000 0x021b8000 0x021f9000
lib /boot/system/lib/x86/libroot.so
5572 0x0228f000 0x023bd000 0x023bd000 0x02412000
lib /boot/home/WORK/Csound5.19.01/lib/libpython2.6.so.1.0
5576 0x024c9000 0x02782000 0x02782000 0x0279c000
lib /boot/system/lib/x86/libbe.so
5547 0x02917000 0x040fc000 0x040fc000 0x040fd000
lib /boot/system/lib/x86/libicudata.so.56.1
5529 0x60910000 0x60918000 0x00000000 0x00000000
system commpage
Areas:
ID Base End Size (KiB)
Protection Locking Name
--------------------------------------------------------------------------------
24577 0x00100000 0x00101000 4 rw-S
full __cloned_timesource_buf_2
24107 0x0012c000 0x0013c000 64 rw-
full rld heap
24106 0x0015a000 0x0016a000 64 rw-
full rld heap
23895 0x001b8000 0x001c0000 32 rw-
full rld heap
24042 0x00229000 0x00233000 40 r-x
full liblo.so.7.0.0_seg0ro
24043 0x00233000 0x00235000 8 rw-
full liblo.so.7.0.0_seg1rw
23741 0x00266000 0x003c8000 1416 r-x
full libvorbisenc.so.2.0.8_seg0ro
23742 0x003c8000 0x003da000 72 rw-
full libvorbisenc.so.2.0.8_seg1rw
23975 0x003da000 0x003e7000 52 r-x
full libdoppler.so_seg0ro
23976 0x003e7000 0x003e9000 8 rw-
full libdoppler.so_seg1rw
23714 0x003e9000 0x003ea000 4 rw-S
full _rld_debug_
24013 0x003ff000 0x00429000 168 r-x
full libpng16.so.16.20.0_seg0ro
24014 0x00429000 0x0042a000 4 rw-
full libpng16.so.16.20.0_seg1rw
23713 0x00430000 0x00440000 64 rw-
full rld heap
24102 0x00609000 0x00616000 52 r-x
full libmidi2.so_seg0ro
24103 0x00616000 0x00617000 4 rw-
full libmidi2.so_seg1rw
24079 0x00619000 0x00623000 40 r-x
full libpy.so_seg0ro
24080 0x00623000 0x00625000 8 rw-
full libpy.so_seg1rw
23933 0x0064c000 0x0064d000 4 r-x
full libcellular.so_seg0ro
23934 0x0064d000 0x0064e000 4 rw-
full libcellular.so_seg1rw
23739 0x00658000 0x00697000 252 r-x
full libFLAC.so.8.2.0_seg0ro
23740 0x00697000 0x0069d000 24 rw-
full libFLAC.so.8.2.0_seg1rw
23940 0x0079b000 0x0079c000 4 r-x
full libcs_date.so_seg0ro
23941 0x0079c000 0x0079e000 8 rw-
full libcs_date.so_seg1rw
23728 0x0080e000 0x00a65000 2396 r-x
full libcsound.so_seg0ro
23729 0x00a65000 0x00a80000 108 rw-
full libcsound.so_seg1rw
23730 0x00a80000 0x00a82000 8 rw-
full libcsound.so_seg2rw
23917 0x00a87000 0x00a88000 4 r-x
full libampmidid.so_seg0ro
23918 0x00a88000 0x00a8a000 8 rw-
full libampmidid.so_seg1rw
23992 0x00a8e000 0x00a9c000 56 r-x
full libfluidOpcodes.so_seg0ro
23993 0x00a9c000 0x00a9e000 8 rw-
full libfluidOpcodes.so_seg1rw
23875 0x00ab1000 0x00ac1000 64 r-x
full libroot-addon-icu.so_seg0ro
23876 0x00ac1000 0x00ac2000 4 rw-
full libroot-addon-icu.so_seg1rw
23731 0x00ada000 0x00bb8000 888 r-x
full libiconv.so.2.5.0_seg0ro
23732 0x00bb8000 0x00bbc000 16 rw-
full libiconv.so.2.5.0_seg1rw
23886 0x00c05000 0x00c57000 328 r-x
full libicule.so.56.1_seg0ro
23887 0x00c57000 0x00c59000 8 rw-
full libicule.so.56.1_seg1rw
23722 0x00ce9000 0x00d47000 376 r-x
full libsndfile.so.1.0.21_seg0ro
23723 0x00d47000 0x00d49000 8 rw-
full libsndfile.so.1.0.21_seg1rw
23724 0x00d49000 0x00d4d000 16 rw-
full libsndfile.so.1.0.21_seg2rw
23884 0x00e57000 0x00e61000 40 r-x
full libicuio.so.56.1_seg0ro
23885 0x00e61000 0x00e62000 4 rw-
full libicuio.so.56.1_seg1rw
23882 0x0107c000 0x012df000 2444 r-x
full libicui18n.so.56.1_seg0ro
23883 0x012df000 0x012ec000 52 rw-
full libicui18n.so.56.1_seg1rw
23997 0x013a4000 0x013d0000 176 r-x
full libfluidsynth.so_seg0ro
23998 0x013d0000 0x013d2000 8 rw-
full libfluidsynth.so_seg1rw
23999 0x013d2000 0x01438000 408 rw-
full libfluidsynth.so_seg2rw
23988 0x014e6000 0x014e8000 8 r-x
full libfareygen.so_seg0ro
23989 0x014e8000 0x014e9000 4 rw-
full libfareygen.so_seg1rw
23745 0x014ff000 0x01503000 16 r-x
full libogg.so.0.8.0_seg0ro
23746 0x01503000 0x01505000 8 rw-
full libogg.so.0.8.0_seg1rw
23893 0x01585000 0x016f0000 1452 r-x
full libicuuc.so.56.1_seg0ro
23894 0x016f0000 0x016fc000 48 rw-
full libicuuc.so.56.1_seg1rw
23888 0x01741000 0x0174b000 40 r-x
full libiculx.so.56.1_seg0ro
23889 0x0174b000 0x0174d000 8 rw-
full libiculx.so.56.1_seg1rw
24004 0x01814000 0x01818000 16 r-x
full libfractalnoise.so_seg0ro
24005 0x01818000 0x01819000 4 rw-
full libfractalnoise.so_seg1rw
23877 0x01846000 0x01992000 1328 r-x
full libstdc++.so.6.0.21_seg0ro
23878 0x01992000 0x01998000 24 rw-
full libstdc++.so.6.0.21_seg1rw
23879 0x01998000 0x0199f000 28 rw-
full libstdc++.so.6.0.21_seg2rw
24033 0x019dd000 0x01a0b000 184 r-x
full libmixer.so_seg0ro
24034 0x01a0b000 0x01a0d000 8 rw-
full libmixer.so_seg1rw
23719 0x01a15000 0x01a4b000 216 r-x
full libnetwork.so_seg0ro
23720 0x01a4b000 0x01a4d000 8 rw-
full libnetwork.so_seg1rw
23721 0x01a4d000 0x01a52000 20 rw-
full libnetwork.so_seg2rw
24026 0x01a59000 0x01a5a000 4 r-x
full libipmidi.so_seg0ro
24027 0x01a5a000 0x01a5c000 8 rw-
full libipmidi.so_seg1rw
23717 0x01a60000 0x01a69000 36 r-x
full libintl.so.8.1.4_seg0ro
23718 0x01a69000 0x01a6b000 8 rw-
full libintl.so.8.1.4_seg1rw
24099 0x01b36000 0x01bc0000 552 r-x
full libmedia.so_seg0ro
24100 0x01bc0000 0x01bc5000 20 rw-
full libmedia.so_seg1rw
24101 0x01bc5000 0x01bc6000 4 rw-
full libmedia.so_seg2rw
23715 0x01c74000 0x01c76000 8 r-x
full csound_seg0ro
23716 0x01c76000 0x01c77000 4 rw-
full csound_seg1rw
24057 0x01cdd000 0x01ce0000 12 r-x
full libplaterev.so_seg0ro
24058 0x01ce0000 0x01ce1000 4 rw-
full libplaterev.so_seg1rw
23743 0x01ceb000 0x01d13000 160 r-x
full libvorbis.so.0.4.5_seg0ro
23744 0x01d13000 0x01d14000 4 rw-
full libvorbis.so.0.4.5_seg1rw
23735 0x01da5000 0x01dc1000 112 r-x
full libsupc++.so_seg0ro
23736 0x01dc1000 0x01dc3000 8 rw-
full libsupc++.so_seg1rw
23890 0x01dcb000 0x01df5000 168 r-x
full libicutu.so.56.1_seg0ro
23891 0x01df5000 0x01df7000 8 rw-
full libicutu.so.56.1_seg1rw
23892 0x01df7000 0x01e29000 200 rw-
full libicutu.so.56.1_seg2rw
24040 0x01e2d000 0x01e30000 12 r-x
full libosc.so_seg0ro
24041 0x01e30000 0x01e31000 4 rw-
full libosc.so_seg1rw
23737 0x01e36000 0x01e4e000 96 r-x
full libgcc_s.so.1_seg0ro
23738 0x01e4e000 0x01e4f000 4 rw-
full libgcc_s.so.1_seg1rw
24015 0x01ed9000 0x01eef000 88 r-x
full libz.so.1.2.8_seg0ro
24016 0x01eef000 0x01ef1000 8 rw-
full libz.so.1.2.8_seg1rw
24011 0x01f66000 0x01f69000 12 r-x
full libimage.so_seg0ro
24012 0x01f69000 0x01f6a000 4 rw-
full libimage.so_seg1rw
23733 0x01f8d000 0x01f91000 16 r-x
full libbsd.so_seg0ro
23734 0x01f91000 0x01f92000 4 rw-
full libbsd.so_seg1rw
23710 0x01fca000 0x01fe8000 120 r-x
full runtime_loader_seg0ro
23711 0x01fe8000 0x01fea000 8 rw-
full runtime_loader_seg1rw
23712 0x01fea000 0x01feb000 4 rw-
full runtime_loader_bss1
23725 0x020dd000 0x021b8000 876 r-x
full libroot.so_seg0ro
23726 0x021b8000 0x021c2000 40 rw-
full libroot.so_seg1rw
23727 0x021c2000 0x021f9000 220 rw-
full libroot.so_seg2rw
24081 0x0228f000 0x023bd000 1208 r-x
full libpython2.6.so.1.0_seg0ro
24082 0x023bd000 0x0240c000 316 rw-
full libpython2.6.so.1.0_seg1rw
24083 0x0240c000 0x02412000 24 rw-
full libpython2.6.so.1.0_seg2rw
24104 0x024c9000 0x02782000 2788 r-x
full libbe.so_seg0ro
24105 0x02782000 0x0279c000 104 rw-
full libbe.so_seg1rw
23880 0x02917000 0x040fc000 24468 r-x
full libicudata.so.56.1_seg0ro
23881 0x040fc000 0x040fd000 4 rw-
full libicudata.so.56.1_seg1rw
23821 0x18385000 0x184a5000 1152 rw-
full heap
23709 0x60910000 0x60918000 32 r-xSk
full commpage
23706 0x60966000 0x6096a000 16 rw-
full user area
23708 0x708b1000 0x718b3000 16392 rw-s
full csound_1099_stack
24576 0x71d0b000 0x71d50000 276 rw-s
full Csound control_1129_stack
24517 0x71d7f000 0x71dc4000 276 rw-s
full _BMediaRoster__1128_stack
Protection Flags: r - read, w - write, x - execute, s - stack, o - overcommit,
c - cloneable, S - shared, k - kernel
Semaphores:
ID Count Last Holder Name
------------------------------------------------------------
7331 0 0 some BBlockCache lock
7332 0 0 Catalog
7333 0 0 some BLocker
7334 0 0 some BLocker
7335 0 0 token space
7336 0 0 BLooperList lock
7337 0 0 AppServerLink_sLock
7338 0 0 LocaleRosterData
7339 0 0 some BLocker
7340 0 0 Catalog
7341 0 0 media plugin manager
7342 0 0 shared buffer list
7343 0 0 port pool
7344 0 0 add-on manager
7345 0 0 media theme lock
7346 -1 0 BMediaRoster::Roster locker
7396 0 0 pthread rwlock
7397 0 0 pthread rwlock
7449 0 1099 Csound_wait
7450 0 0 BMessageQueue Lock
7451 0 0 _BMediaRoster_
7456 0 0 dormant node manager locker
7457 0 0 time source object manager
7458 0 0 BTimedEventQueue locker
7459 0 0 BTimedEventQueue locker