Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashing on close #1867

Closed
iqwoo opened this issue Oct 6, 2023 · 7 comments
Closed

Crashing on close #1867

iqwoo opened this issue Oct 6, 2023 · 7 comments
Labels
Milestone

Comments

@iqwoo
Copy link

iqwoo commented Oct 6, 2023

Hydrogen version * : 1.2.2
Operating system + version : Archlinux
Audio driver + version : Jack


Quitting Hydrgen results in a crash with this output:

Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_7_L type = 32 bit float mono audio port_index = 29
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33333 ms, missed buffer
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_7_R type = 32 bit float mono audio port_index = 30
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_8_L type = 32 bit float mono audio port_index = 31
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_8_R type = 32 bit float mono audio port_index = 32
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_9_L type = 32 bit float mono audio port_index = 33
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_9_R type = 32 bit float mono audio port_index = 34
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33333 ms, missed buffer
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_10_L type = 32 bit float mono audio port_index = 35
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_10_R type = 32 bit float mono audio port_index = 36
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33333 ms, missed buffer
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_11_L type = 32 bit float mono audio port_index = 37
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_11_R type = 32 bit float mono audio port_index = 38
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_12_L type = 32 bit float mono audio port_index = 39
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_12_R type = 32 bit float mono audio port_index = 40
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_13_L type = 32 bit float mono audio port_index = 41
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_13_R type = 32 bit float mono audio port_index = 42
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33333 ms, missed buffer
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33333 ms, missed buffer
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_14_L type = 32 bit float mono audio port_index = 43
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_14_R type = 32 bit float mono audio port_index = 44
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_15_L type = 32 bit float mono audio port_index = 45
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_15_R type = 32 bit float mono audio port_index = 46
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33333 ms, missed buffer
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_16_L type = 32 bit float mono audio port_index = 47
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_16_R type = 32 bit float mono audio port_index = 48
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33333 ms, missed buffer
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_17_L type = 32 bit float mono audio port_index = 49
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_17_R type = 32 bit float mono audio port_index = 50
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33333 ms, missed buffer
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_18_L type = 32 bit float mono audio port_index = 51
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33333 ms, missed buffer
Jack: JackClient::PortRegister ref = 3 name = Hydrogen:Track_18_R type = 32 bit float mono audio port_index = 52
Jack: JackClient::TransportLocate pos = 0
Jack: RequestNewPos pos = 0
Jack: JackActivationCount::Signal value = 0 ref = 3
Jack: JackActivationCount::Signal value = 0 ref = 3
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 18
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
Jack: JackClient::TransportLocate pos = 0
Jack: RequestNewPos pos = 0
Jack: JackClient::TransportLocate pos = 0
Jack: RequestNewPos pos = 0
Jack: JackClient::PortUnRegister port_index = 16
Jack: JackClient::PortUnRegister port_index = 15
Jack: JackGraphManager::GetBuffer : port = 15 is released state
Jack: JackGraphManager::GetBuffer : port = 16 is released state
Jack: JackClient::Deactivate
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 3
Jack: JackClient::kXRunCallback
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33133 ms, missed buffer
Jack: JackClient::Deactivate res = 0
Jack: JackPosixThread::Kill
Jack: jack_client_close
Jack: JackClient::Close ref = 4
Jack: JackClient::Deactivate
Jack: JackSocketClientChannel::Stop
Jack: JackPosixThread::Kill
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33133 ms, missed buffer
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33133 ms, missed buffer
Jack: JackClient::ClientNotify ref = 4 name = Hydrogen-midi notify = 1
Jack: JackClient::RemoveClient name = Hydrogen-midi, ref = 4 
Jack: JackClient::kRemoveClient fName = Hydrogen name = Hydrogen-midi
Jack: JackClientSocket::Close
Jack: JackClientSocket::Close
Jack: JackLibClient::~JackLibClient
Jack: JackShmReadWritePtr1::~JackShmReadWritePtr1 4
Jack: Succeeded in unlocking 426 byte memory area
Jack: jack_client_close res = 0
Jack: JackClient::Deactivate
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
Jack: JackClient::ClientNotify ref = 3 name = Hydrogen notify = 18
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33133 ms, missed buffer
(E) ::static int H2Core::AudioEngine::audioEngine_process(uint32_t, void*) Failed to lock audioEngine in allowed 1.33133 ms, missed buffer
Jack: JackClient::Deactivate res = 0
Jack: JackPosixThread::Kill
terminate called without an active exception
(E) ::void handleFatalSignal(int) Fatal signal 6
(E) ::void handleFatalSignal(int) /usr/bin/hydrogen(+0x225a92) [0x55af48ba3a92]
(E) ::void handleFatalSignal(int) /usr/lib/libc.so.6(+0x3e710) [0x7f9f48399710]
(E) ::void handleFatalSignal(int) /usr/lib/libc.so.6(+0x8e83c) [0x7f9f483e983c]
(E) ::void handleFatalSignal(int) /usr/lib/libc.so.6(raise+0x18) [0x7f9f48399668]
(E) ::void handleFatalSignal(int) /usr/lib/libc.so.6(abort+0xd7) [0x7f9f483814b8]
(E) ::void handleFatalSignal(int) /usr/lib/libstdc++.so.6(+0x9ca6f) [0x7f9f486eba6f]
(E) ::void handleFatalSignal(int) /usr/lib/libstdc++.so.6(+0xb011c) [0x7f9f486ff11c]
(E) ::void handleFatalSignal(int) /usr/lib/libstdc++.so.6(+0xb0189) [0x7f9f486ff189]
(E) ::void handleFatalSignal(int) /usr/lib/libstdc++.so.6(__gxx_personality_v0+0x23d) [0x7f9f486fe9cd]
(E) ::void handleFatalSignal(int) /usr/lib/libgcc_s.so.1(+0x1a6f4) [0x7f9f485576f4]
(E) ::void handleFatalSignal(int) /usr/lib/libgcc_s.so.1(_Unwind_ForcedUnwind+0x130) [0x7f9f48557e20]
(E) ::void handleFatalSignal(int) /usr/lib/libc.so.6(+0x95187) [0x7f9f483f0187]
(E) ::void handleFatalSignal(int) /usr/lib/libc.so.6(+0x8ae9b) [0x7f9f483e5e9b]
(E) ::void handleFatalSignal(int) /usr/lib/libc.so.6(+0x3e710) [0x7f9f48399710]
(E) ::void handleFatalSignal(int) /usr/lib/libc.so.6(+0x89446) [0x7f9f483e4446]
(E) ::void handleFatalSignal(int) /usr/lib/libc.so.6(+0x903eb) [0x7f9f483eb3eb]
(E) ::void handleFatalSignal(int) /usr/lib/libhydrogen-core-1.2.2.so(_ZN6H2Core11AudioEngine10tryLockForENSt6chrono8durationIlSt5ratioILl1ELl1000000EEEEPKcjS7_+0x8d) [0x7f9f49dc7c9d]
(E) ::void handleFatalSignal(int) /usr/lib/libhydrogen-core-1.2.2.so(_ZN6H2Core11AudioEngine19audioEngine_processEjPv+0xe5) [0x7f9f49dd3d05]
(E) ::void handleFatalSignal(int) /usr/lib/libjack.so.0(+0x1444d) [0x7f9f480d744d]
(E) ::void handleFatalSignal(int) /usr/lib/libjack.so.0(+0x13be8) [0x7f9f480d6be8]
(E) ::void handleFatalSignal(int) /usr/lib/libjack.so.0(+0x31bb1) [0x7f9f480f4bb1]
(E) ::void handleFatalSignal(int) /usr/lib/libc.so.6(+0x8c9eb) [0x7f9f483e79eb]
(E) ::void handleFatalSignal(int) /usr/lib/libc.so.6(+0x1107cc) [0x7f9f4846b7cc]
@theGreatWhiteShark
Copy link
Contributor

Hey @iqwoo ,

Are you able to reproduce this crash? I already saw it a couple of times but was not able to consistently reproduce it in order to debug it.

@iqwoo
Copy link
Author

iqwoo commented Oct 7, 2023 via email

@theGreatWhiteShark
Copy link
Contributor

Yes I'm able.
It happens everytime I close hydrogen

Nice. Can you post your JACK settings? Is this happening with just a particular song and e.g. just when you started playback or every single time including when using the default song?

@iqwoo
Copy link
Author

iqwoo commented Oct 20, 2023

Sorry for the delay.
It's happening on two different system (my desktop and my laptop) with two different USB Audio Device (Behringer XAIR XR18 and Zoom U-44)
I use QjackCtl to start Jackd: Those are the settings for U-44 but the ones for XR18 are the same

immagine

immagine

And this is the content of my .jackrdc file:

/usr/bin/jackd -dalsa -dhw:U44 -r48000 -p1024 -n3 -Xraw -I60 -O60

@theGreatWhiteShark
Copy link
Contributor

Hmm... I can't reproduce the crash with your config.

Could you run

jackd --version

Also, could you check this build of Hydrogen? (or alternatively build from source in branch phil-address-1867-artifacts) I found a bug which could be the cause. But I'm not sure.

Does the crash also occur when restarting the audio driver in the Preferences or just during shutdown? Does it matter whether playback is rolling or other JACK clients are present?

@iqwoo
Copy link
Author

iqwoo commented Nov 1, 2023

jackdmp version 1.9.22 tmpdir /dev/shm protocol 9

The crash also occurs when I restart the audio driver in preferences.
It does not matter if the playback is rolling.
It does not matter if other clients are present.

I tried the appimage you sent me and the crash did not happened neither quitting nor restarting the audio driver. Maybe that bus is the cause.
I'm curious now, can you explain to me the bug? (I'm not as good as you but I was a developer in industrial automation and I used Qt in the past quite a lot so I think that at least I can understand something)

@theGreatWhiteShark
Copy link
Contributor

I tried the appimage you sent me and the crash did not happened neither quitting nor restarting the audio driver.

So, the issue is resolved? Awesome!

I changed the following: The audio engine of Hydrogen was not locked while stopping the driver https://github.com/hydrogen-music/hydrogen/pull/1887/files#diff-1ee5d29336f73a9ef185a2ab6316223cb9dead1b5787e306782239f148b74807L1036 . This means the state of the engine could get into a dirty state while JACK was processing its callback.

These lines were encountered every time the JACK driver was stopped incl. on shutdown or restarting the driver with other parameters. Whether or not this dirty state occurs is depending largely on CPU load and capability. Multicores with lots of idle time and power do spend only a fraction of their time within the callback function. But less powerful systems might be in there most of the time. That might explain why you did encounter the bug every time and I did only very rarely. But why it was crashing instead of just being "dirty"? No idea. Hard to tell without reproducing it. But since its fixed, we are fine :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants