From kde-core-devel Sun Apr 01 17:42:03 2007 From: Krzysztof Lichota Date: Sun, 01 Apr 2007 17:42:03 +0000 To: kde-core-devel Subject: Re: Race condition in KUniqueApplication Message-Id: <460FEEEB.8030709 () lichota ! net> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=117544922606905 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------enig89CCC2CFC8637CD680183116" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig89CCC2CFC8637CD680183116 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Krzysztof Lichota napisa=C5=82(a): > While investigating Ark bug I have come across possible race condition > in KUniqueApplication. >=20 > It does the following (if --nofork is not set): > - fork a child > - child checks if application is running, if not spawns it > - child reports to parent using pipe if application is running > - parent sends to application DCOP call to create new instance > - if DCOP call fails, it just aborts >=20 > If application is during shutdown (which happens often with Ark when it= > is unpacking files), the check for application running in child is > successful, while the DCOP call in parent fails and starting app fails.= >=20 > IMO the right thing to do would be to make DCOP call in child and repea= t > call (and spawning the process) if it fails. This involves many changes= > in the code, so I tried the other approach: repeat everything in parent= > process. This works much better (although does not solve Ark bug > completely, so I have to investigate it further). > Anyway, the patch (preliminary, it is not intended for applying) is > attached, what do you think of this whole problem? Have I missed > something? Should I try to move the DCOP call and loop in child? Any comments? Krzysztof Lichota --------------enig89CCC2CFC8637CD680183116 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGD+7rSHJB/1EhaUwRAlubAKChuCJJGSpEdhdjkYEL2OYkIefsIACgjbJW boh9zf8sluWfPRrhz3QVJTM= =aJoA -----END PGP SIGNATURE----- --------------enig89CCC2CFC8637CD680183116--