Race condition in KUniqueApplication

Krzysztof Lichota krzysiek at lichota.net
Sun Apr 1 18:42:03 BST 2007


Krzysztof Lichota napisaƂ(a):
> While investigating Ark bug I have come across possible race condition
> in KUniqueApplication.
> 
> 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
> 
> 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.
> 
> IMO the right thing to do would be to make DCOP call in child and repeat
> 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070401/018240fa/attachment.sig>


More information about the kde-core-devel mailing list