-
Notifications
You must be signed in to change notification settings - Fork 6
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
GTK2+ applications don't start #41
Comments
It hangs in the |
Did you get any signal with gdb? |
That's my pressing
glibc-2.18-4.11.1.x86_64 It looks like it happens the second time entering getKdeHome() |
Nop, it shouldn't be. This is what it should look like when gdb recieved a signal
The signal handler (if any) should be called after gdb captures it. (And in any case it shouldn't call another function before gdb). |
P.S. when pasting the output of some command, please quote it as code. |
From the list of signals |
Although I still don't understand why it could hang on |
Ok, popen() executes kde-config which quits with a SIGCHLD. Then we read what it printed and then pclose hangs waiting for the process to terminate, but it already terminated... See the manpage for pclose(): |
I think the pclose()/fclose() sets up the signal handler to detect when the application goes away. The process has already finished and calls waitpid() on a process which doesn't exist. So it sits there and waits forever ... |
I've tested it outside of qtcurve and it works just fine. I've also set the SA_RESETHAND flag before invoking popen() still doesn't work. |
I got it working, it is the SIGCHILD handler ... |
I still don't think this is the right explaination. |
The runCommand worked just fine using it in a simple programm but doesn't work with some GTK applications. You didn't like that I reset the signal handler so I implemented it using posix_spawn(). What's wrong with posix_spawn now? |
I would like to find the real reason for the race, and I don't think the explaination you give is convincing (e.g. who sets up the signal handler? and why it is blocked on a |
Install "easytag" and debug yourself :) |
I do. And I cannot reproduce it. |
Maybe this is a race condition between setting up the SIGCHILD handler and catching it. I have a very fast machine. It is not the first time that I need to fix a race condition with this machine. |
However calling the command to find out the directories isn't a really nice way. Why don't you link against libkdecore and use: (void)KGlobal::dirs(); // trigger the creation KGlobal::dirs()->localkdedir() |
Linking against Qt or Kdelibs in Gtk application is asking for trouble. |
OK, I think I've finally managed to reproduce this. The
And the version with manually
Therefore, the hang only happens if there are other child processes (otherwise This is pretty much the opposite of what you said and I feel like your second patch should only make it worse. |
Also there is another unlikely race condition for piping to child process which can only be solved by manually doing |
I would say the problem is waitpid(-1, ...). I don't see a problem in the posix_spawn code. |
On Wed, Jan 15, 2014 at 8:15 AM, Andreas Schneider <[email protected]
The
|
An alternative way to do this is to use a dbus service. This can get rid of a lot of things including string parsing and also save a lot of pids since the dbus daemon can take care of spawning the process. However, this adds some complexity during update and I don't want to implement right now. |
The problem with the |
And the version with
Again, the |
Can you test the current master? |
I will try to find some time tomorrow ... |
easytag doesn't start up, but works if I run it with strace or gdb. So we have a race condition here. I guess the culprit is libglib and not your code. |
Can you run with |
|
|
Obviously, the signal handler is set up by easytag (I guess you could install the debug symbol for it to see the name of the handler). I can now reproduce the problem with the tesing code. It seems that the timing from I have pushed another workaround to master. I don't totally like this solution but I don't think there is another solution other than resetting the signal handler (and anyway, having 2-3 zombie processes is a lot better than freezing application.) Could you try it again? |
easytag forks and starts rccexternal for cddb queries. If I send the TERM signal to rccexternal easytag starts up. |
I guess it is an easytag issue too. |
Easytags fault it that it calls It will be nice if they improve the signal handling but I think the current solution can fix the problem without reseting the handler. Have you tested it yet? |
Sorry, the non-blocking version is also |
Or |
And BTW, if the only purpose of the signal handler is getting rid of zombies, on linux you can also just ignore the SIGCHLD. |
I guess the culprit is librcc (Russian Charset Conversion Library) which forks rccexternal. |
--- Comment #7 from David King 2014-01-21 20:13:12 UTC --- |
...... And have you tested the current QtCurve master yet? |
I guess the bug is https://git.gnome.org/browse/easytag/commit/?id=b698dad4c31ffc702121cc06200ff1a0e1e89864 it called wait(NULL) ... |
No, I will do that now |
master works |
Good and close...... |
Thanks, could you release a new version this fix? |
I don't think I will make a release "for" this fix but I am planing to do a release soon (by the end of this month) and in fact this is the most important blocking bug... Most of the short term TODO's are done now and I think there are enough changes/fixes for a new minor version. I will still need to do sth to the QtQuick2 dependency (because it needs update from Qt side to fully functional anyway) and also making sure there isn't any major thing that I'm missing. If things go well, it can probably happen by the end of this week. |
Hi,
I have problems starting up easytag if qtcurve is in use. I have 1.8.17 here, it works if I use 1.8.16 with the runCommand patch and start it in strace.
The text was updated successfully, but these errors were encountered: