Gabriel M. Beddingfield wrote:
Krzysztof Foltman wrote:
This is svn r494, after quitting program when a song was playing.

Hi Krzysztof,

Sounds like you have two different bugs you're chasing. Thanks for the backtraces, too! It would help a lot if you would post the steps to make the crash happen (every time or most of the time).
Heh... I think they're right in the original mail ("on startup" and "after quitting"). The song used was the Diddley demo song.

I've ran Hydrogen in valgrind, just for extra information, and there's definitely something wrong going on, ie. it still uses the data structures that have already been freed. I'm putting it here because I don't have the account on Trac.

==8483==
==8483== Invalid read of size 4
==8483==    at 0x818B9DB: H2Core::Instrument::dequeue() (instrument.h:269)
==8483== by 0x81A16B6: H2Core::Sampler::stop_playing_notes(H2Core::Instrument*) (sampler.cpp:684) ==8483== by 0x818BDA4: H2Core::audioEngine_clearNoteQueue() (hydrogen.cpp:651) ==8483== by 0x8181C89: H2Core::audioEngine_removeSong() (hydrogen.cpp:1005)
==8483==    by 0x8181CD0: H2Core::Hydrogen::removeSong() (hydrogen.cpp:1766)
==8483==    by 0x81828FE: H2Core::Hydrogen::~Hydrogen() (hydrogen.cpp:1721)
==8483==    by 0x8099C98: HydrogenApp::~HydrogenApp() (HydrogenApp.cpp:119)
==8483==    by 0x80FB497: MainForm::~MainForm() (MainForm.cpp:193)
==8483==    by 0x812667C: main (main.cpp:308)
==8483==  Address 0x59cb454 is 12 bytes inside a block of size 164 free'd
==8483==    at 0x40222EC: operator delete(void*) (vg_replace_malloc.c:342)
==8483== by 0x81948A6: H2Core::Instrument::~Instrument() (instrument.cpp:78) ==8483== by 0x8194125: H2Core::InstrumentList::~InstrumentList() (instrument.cpp:250)
==8483==    by 0x81C1FBD: H2Core::Song::~Song() (song.cpp:90)
==8483==    by 0x8099C80: HydrogenApp::~HydrogenApp() (HydrogenApp.cpp:118)
==8483==    by 0x80FB497: MainForm::~MainForm() (MainForm.cpp:193)
==8483==    by 0x812667C: main (main.cpp:308)
==8483==
==8483== Invalid read of size 4
==8483==    at 0x818BA09: H2Core::Instrument::dequeue() (instrument.h:270)
==8483== by 0x81A16B6: H2Core::Sampler::stop_playing_notes(H2Core::Instrument*) (sampler.cpp:684) ==8483== by 0x818BDA4: H2Core::audioEngine_clearNoteQueue() (hydrogen.cpp:651) ==8483== by 0x8181C89: H2Core::audioEngine_removeSong() (hydrogen.cpp:1005)
==8483==    by 0x8181CD0: H2Core::Hydrogen::removeSong() (hydrogen.cpp:1766)
==8483==    by 0x81828FE: H2Core::Hydrogen::~Hydrogen() (hydrogen.cpp:1721)
==8483==    by 0x8099C98: HydrogenApp::~HydrogenApp() (HydrogenApp.cpp:119)
==8483==    by 0x80FB497: MainForm::~MainForm() (MainForm.cpp:193)
==8483==    by 0x812667C: main (main.cpp:308)
==8483==  Address 0x59cb454 is 12 bytes inside a block of size 164 free'd
==8483==    at 0x40222EC: operator delete(void*) (vg_replace_malloc.c:342)
==8483== by 0x81948A6: H2Core::Instrument::~Instrument() (instrument.cpp:78) ==8483== by 0x8194125: H2Core::InstrumentList::~InstrumentList() (instrument.cpp:250)
==8483==    by 0x81C1FBD: H2Core::Song::~Song() (song.cpp:90)
==8483==    by 0x8099C80: HydrogenApp::~HydrogenApp() (HydrogenApp.cpp:118)
==8483==    by 0x80FB497: MainForm::~MainForm() (MainForm.cpp:193)
==8483==    by 0x812667C: main (main.cpp:308)
==8483==
==8483== Invalid write of size 4
==8483==    at 0x818BA12: H2Core::Instrument::dequeue() (instrument.h:270)
==8483== by 0x81A16B6: H2Core::Sampler::stop_playing_notes(H2Core::Instrument*) (sampler.cpp:684) ==8483== by 0x818BDA4: H2Core::audioEngine_clearNoteQueue() (hydrogen.cpp:651) ==8483== by 0x8181C89: H2Core::audioEngine_removeSong() (hydrogen.cpp:1005)
==8483==    by 0x8181CD0: H2Core::Hydrogen::removeSong() (hydrogen.cpp:1766)
==8483==    by 0x81828FE: H2Core::Hydrogen::~Hydrogen() (hydrogen.cpp:1721)
==8483==    by 0x8099C98: HydrogenApp::~HydrogenApp() (HydrogenApp.cpp:119)
==8483==    by 0x80FB497: MainForm::~MainForm() (MainForm.cpp:193)
==8483==    by 0x812667C: main (main.cpp:308)
==8483==  Address 0x59cb454 is 12 bytes inside a block of size 164 free'd
==8483==    at 0x40222EC: operator delete(void*) (vg_replace_malloc.c:342)
==8483== by 0x81948A6: H2Core::Instrument::~Instrument() (instrument.cpp:78) ==8483== by 0x8194125: H2Core::InstrumentList::~InstrumentList() (instrument.cpp:250)
==8483==    by 0x81C1FBD: H2Core::Song::~Song() (song.cpp:90)
==8483==    by 0x8099C80: HydrogenApp::~HydrogenApp() (HydrogenApp.cpp:118)
==8483==    by 0x80FB497: MainForm::~MainForm() (MainForm.cpp:193)
==8483==    by 0x812667C: main (main.cpp:308)

It happened with "Diddley" demo song autoloaded on startup, and the only operations done were pressing Play button and quitting the program. Also, the original JACK 0.109.2 client library and server were used, not jackdmp/jackdbus.

I've then updated to current trunk, and the same operation sequence (under gdb and not valgrind, to be able to inspect other threads' stack) ended up with this:

hydrogen: libs/hydrogen/include/hydrogen/instrument.h:269: void H2Core::Instrument::dequeue(): Assertion `__queued > 0' failed.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb680c740 (LWP 9173)]
0xb7f82410 in __kernel_vsyscall ()
(gdb) thread apply all bt

Thread 4 (Thread 0xb4afeb90 (LWP 9192)):
#0  0xb7f82410 in __kernel_vsyscall ()
#1  0xb6f57c07 in poll () from /lib/tls/i686/cmov/libc.so.6
#2  0xb710741a in jack_client_core_wait (client=0xb5351ba0) at client.c:1400
#3 0xb710786a in jack_thread_wait (client=0xb5351ba0, status=0) at client.c:1554
#4  0xb71079ee in jack_client_thread (arg=0xb5351ba0) at client.c:1601
#5  0xb71fb4fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb6f61e5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 3 (Thread 0xb52ffb90 (LWP 9191)):
#0  0xb7f82410 in __kernel_vsyscall ()
#1  0xb6f57c07 in poll () from /lib/tls/i686/cmov/libc.so.6
#2 0x0819a4f0 in H2Core::alsaMidiDriver_thread (param=0xb5342898) at libs/hydrogen/src/IO/alsa_midi_driver.cpp:136
#3  0xb71fb4fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#4  0xb6f61e5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 2 (Thread 0xb680bb90 (LWP 9176)):
#0  0xb7f82410 in __kernel_vsyscall ()
#1  0xb6f20cb6 in nanosleep () from /lib/tls/i686/cmov/libc.so.6
#2  0xb6f5b1dc in usleep () from /lib/tls/i686/cmov/libc.so.6
#3 0x081a8718 in loggerThread_func (param=0x8244ed0) at libs/hydrogen/src/object.cpp:192
#4  0xb71fb4fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#5  0xb6f61e5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb680c740 (LWP 9173)):
#0  0xb7f82410 in __kernel_vsyscall ()
#1  0xb6eb6085 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb6eb7a01 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb6eaf10e in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#4 0x0818ba6e in H2Core::Instrument::dequeue (this=0xb535e8d8) at libs/hydrogen/include/hydrogen/instrument.h:269 #5 0x081a1833 in H2Core::Sampler::stop_playing_notes (this=0xb533b170, instrument=0x0) at libs/hydrogen/src/sampler/sampler.cpp:684 #6 0x0818bb0a in H2Core::audioEngine_clearNoteQueue () at libs/hydrogen/src/hydrogen.cpp:651 #7 0x08181cf2 in H2Core::audioEngine_removeSong () at libs/hydrogen/src/hydrogen.cpp:1005 #8 0x08181d39 in H2Core::Hydrogen::removeSong (this=0x828a8b8) at libs/hydrogen/src/hydrogen.cpp:1766 #9 0x08182967 in ~Hydrogen (this=0x828a8b8) at libs/hydrogen/src/hydrogen.cpp:1721 #10 0x08099c99 in ~HydrogenApp (this=0xb3d88900) at gui/src/HydrogenApp.cpp:119
#11 0x080fb4d0 in ~MainForm (this=0x82acdd8) at gui/src/MainForm.cpp:193
#12 0x081266b5 in main (argc=1, argv=0xbfd39304) at gui/src/main.cpp:308
(gdb)

As you see, nothing remarkable about the other threads.

The startup problem may be related to (previously) using jackdmp, I'll try to reproduce it with original JACK and post the results if I come across anything interesting.

Krzysztof

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to