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

Jack2 on Windows 10 crashes when stopped #648

Open
ReinholdH opened this issue Oct 17, 2020 · 33 comments
Open

Jack2 on Windows 10 crashes when stopped #648

ReinholdH opened this issue Oct 17, 2020 · 33 comments

Comments

@ReinholdH
Copy link

With Jack2 1.9.16 x64 (jack2-win64-v1.9.16.exe)

When stopping Jack2 a crash message appreas in the message box. See message attached.
Crash_message_when_Jack_is_stopped.txt

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 17, 2020 via email

@ReinholdH
Copy link
Author

It happens with the default setting.

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 17, 2020 via email

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 17, 2020 via email

@ReinholdH
Copy link
Author

Thx, but not familiar how to setup a dummy interface on Windows that is visible in QjackCtl. Any help is appreciated.

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@ReinholdH
Copy link
Author

Thx. I tried your older version of qjackctl and it does not crash when stopped. The old one is fine.
I use the official qjackctl which is included in jack2-win64-v1.9.16.exe. The qjackctl version is 0.6.3 using JACK 1.9.16.

When stopping Jack the message is displayed
JACK was stopped
Jack has crashed

@sletz sletz closed this as completed Oct 20, 2020
@sletz sletz reopened this Oct 20, 2020
@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@falkTX
Copy link
Member

falkTX commented Oct 20, 2020

I removed that specific win32 bit because the logic that qjackctl had for a variable that is set as true when user clicks to stop jack is no longer there.
The other, new variables related to something else (jack client shutdown), which is not the same and would lead to confusion.

Cant we just make qjackctl call a proper terminate on the process first, before attempting to kill it?
Making jackd.exe not having a chance to clean itself up is pretty bad IMO, this is why we have issues with "jack_db" as it is never removed (a step done at jackd exit)

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@falkTX
Copy link
Member

falkTX commented Oct 20, 2020

Last time I checked, jackd listens to the ctrl_c CLI thing, which is similar to WM_CLOSE.
But need to retry this

@falkTX
Copy link
Member

falkTX commented Oct 20, 2020

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@sletz
Copy link
Member

sletz commented Oct 20, 2020

I guess this code is there because it is compiled in libjackserver DLL which is then used by the jackdmp binary.

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 20, 2020 via email

@rncbc
Copy link
Contributor

rncbc commented Oct 20, 2020

just raise a PR to https://github.com/rncbc/qjackctl when you conclude your investigations :)
i'll be glad to blindly merge whatever (as long it only affects the windows build).
cheers

@rncbc
Copy link
Contributor

rncbc commented Oct 21, 2020

anyway, rncbc/qjackctl@0aadfd4 is probably a comeback to m_bJackStopped variable, neé m_bJackKilled... ;)

fair warning: not tested whatsoever in the field: counting on you Windows freaks to do just that

cheers

@falkTX
Copy link
Member

falkTX commented Oct 21, 2020

Would be best to try to stop jack nicely first. But that is still a nice commit to have in case the clean exit fails and qjackctl ends up calling "kill" anyway.
I will do some tests regarding trying a clean stop soon.

@rncbc
Copy link
Contributor

rncbc commented Oct 21, 2020

as far as I can remember, and probably @sletz maybe also recall from more than a decade ago, invoking QProcess:terminate() -- as we/I do in good old POSIX/GNU/Linux--is just a dang no-op in windows (yeah, terminate() just sends a WM_CLOSE message to the target process and what we need really is calling TerminateProcess()! omg, there's no event-loop to receive just that on the jack-server win32/64 side whatsoever!

bummer

@sletz
Copy link
Member

sletz commented Oct 21, 2020

No precise remembering on any specific QT thing, I'm afraid.

@rncbc
Copy link
Contributor

rncbc commented Oct 21, 2020

@sletz, np.

anyway it is all right there documented in the Qt docs:
https://doc.qt.io/qt-5/qprocess.html#terminate

@falkTX
Copy link
Member

falkTX commented Oct 21, 2020

That is odd, according to official docs there are other ways to handle this.
https://docs.microsoft.com/en-us/windows/win32/procthread/terminating-a-process

In any case, we just need to find something that works.
Creating a dummy handle just to receive WM_CLOSE is similar to what lbjackserver is doing already, so we can just expand that.

@rncbc
Copy link
Contributor

rncbc commented Oct 21, 2020

i wouldn't go anyway far just for silencing a dang and annoying line on the qjackctl messages... but that's your call anyway :)

@falkTX
Copy link
Member

falkTX commented Oct 21, 2020

It is not just about silencing a "stop", it is killing jackd instead of letting it nicely close.
This leads to issues when trying to start jackd again.

@rncbc
Copy link
Contributor

rncbc commented Oct 21, 2020

have you tested it? does the "JACK has crashed" message ever resulted in a non restartable jackd?

besides, according to the Qt docs, QProcess::kill() is no more no less than calling TerminateProcess() on windows. so case is closed.

@falkTX
Copy link
Member

falkTX commented Oct 21, 2020

Yes, killing jackd can lead to not being able to start it again (until a reboot)
Somewhat relevant #647
It is during cleanup/stop that jackd deletes the meta-data DB stuff.

Anyway, it is just a good practice to stop processes cleanly.

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

No branches or pull requests

5 participants