From kde-core-devel Sun Jan 23 09:41:50 2011 From: Thiago Macieira Date: Sun, 23 Jan 2011 09:41:50 +0000 To: kde-core-devel Subject: Re: The hidden problem with using QProcess/KProcess in kdelibs... Message-Id: <20110123094149.212D773F9 () nargothrond ! macieira ! info> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=129577575107297 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart35994342.mHadpO3o96" --nextPart35994342.mHadpO3o96 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Saturday, 22 de January de 2011 17:16:10 Dawit A wrote: > The above snippet of code is something I clipped from > http://git.videolan.org/?p=vlc.git;a=blob;f=bin/vlc.c;h=70eeed0d2299e2f3cf0c > 2f6819120f02d0703152;hb=HEAD > > One cannot easily tell where QCoreApplication's ctor is getting > called, but I suspect it is sometime after the call to libvlc_new(...) > at line #201 and hence after all these signal blocking has occurred ?? > Since I was really not sure and did not want to waste to much time > mucking around in a rather large and complex code base, I actually > created a small test case to simulate the condition. I can clean that > up and post it here if you want. > > Oh and the code that instantiates QCoreApplication seems to be located > around line #533 in: > http://git.videolan.org/?p=vlc.git;a=blob;f=modules/gui/qt4/qt4.cpp;h=e27c4e > d33161c1979db7fbe6f1d0f466db1c7e09;hb=HEAD Well, there are two components here: the signal handler and the signal mask. The line: signal(SIGCHLD, SIG_DFL); unsets the handler. It's bad if it's called after QCoreApplication. If it's called before, it's harmless. However, if all signals are blocked (and they seem to be), then the signal handler is installed but never called. -- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Senior Product Manager - Nokia, Qt Development Frameworks PGP/GPG: 0x6EF45358; fingerprint: E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358 --nextPart35994342.mHadpO3o96 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iD8DBQBNO/ffM/XwBW70U1gRAlZ+AKCMibS5map5sg+giF0Z54itNE43ogCfWZpA EGw+DOHvWSLtTDo7tTwF4rQ= =eieD -----END PGP SIGNATURE----- --nextPart35994342.mHadpO3o96--