Created attachment 28052 [details] [review] patch to xdg-mime to work around kdeinit/ktradertest bug in KDE4 Under KDE, xdg-mime will use ktradertest to look up MIME handlers. In KDE4, ktradertest starts kdeinit (with --suicide --new-startup) if there is not already a running instance around (which, apparently, there is usually not). This copy of kdeinit will persist for about 15 seconds after it is last needed, presumably as an optimization to allow several clients to use the same instance. However, kdeinit does not close its standard output, so when ktradertest is piped into grep by xdg-mime, grep will not exit until the kdeinit process started by ktradertest exits (because kdeinit still has grep's standard input open, even after ktradertest has exited). This causes xdg-mime to take about 15 seconds! The true fix for this is to fix kdeinit/ktradertest, but xdg-mime can and probably should work around it by running a "patsy" version of ktradertest just to get kdeinit to start. Patch attached. We ran into this bug in Chromium, in the default browser detection code. See http://code.google.com/p/chromium/issues/detail?id=17179 for reference.
for the record, KDE bug: http://bugs.kde.org/show_bug.cgi?id=201714 ktradertest is a KDE 3 only utility. On KDE 4, ktraderclient replaces it.
ktraderclient is now used under KDE 4 session (fixed in CVS). On KDE 3, the pair is ktradertest/kdeinit. On KDE 4, the pair is ktraderclient/kdeinit4. I _guess_ you have some KDE 3 bits and you're running a KDE 4 session. The call to ktradertest starts kdeinit and there isn't a running instance as you're not running a KDE 3 session. is the bug still reproducible with current fix from CVS ?
Not the original bug, no, but now there's a syntax error on line 537 of xdg-mime where there are a bunch of commented lines inside an if statement. Putting "true" in there fixes the syntax, but that part of the code is what would set the default application for a MIME type in KDE4. So there's some work to be done yet to implement that. Interestingly ktradertest gives different results than ktraderclient, and they're apparently wrong (comparing to KDE4's system settings GUI), even after causing this 15 second delay. So ktraderclient is definitely the thing to do here.
(In reply to comment #3) > Not the original bug, no, but now there's a syntax error on line 537 of > xdg-mime where there are a bunch of commented lines inside an if statement. > Putting "true" in there fixes the syntax, but that part of the code is what > would set the default application for a MIME type in KDE4. So there's some work > to be done yet to implement that. true, I'm on it right now. until it's properly fixed, I removed the unused code to avoid the syntax error. > Interestingly ktradertest gives different results than ktraderclient, and > they're apparently wrong (comparing to KDE4's system settings GUI), > even after causing this 15 second delay. So ktraderclient is definitely the > thing to do here. I didn't expect using ktraderclient under KDE4 still causes the 15s delay or wrong output ...
(In reply to comment #4) > > Interestingly ktradertest gives different results than ktraderclient, and > > they're apparently wrong (comparing to KDE4's system settings GUI), > > even after causing this 15 second delay. So ktraderclient is definitely the > > thing to do here. > > I didn't expect using ktraderclient under KDE4 still causes the 15s delay or > wrong output ... It doesn't. Sorry I didn't make that clear. I was just observing how broken ktradertest is on KDE4. Using ktraderclient works fine.
I guess we can consider this bug fixed in CVS.
(In reply to comment #6) > I guess we can consider this bug fixed in CVS. > Close?
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.