kdecore :: KProcIO :: readln ( . , false ) easily causes recursion problems, patch included

Tilman Vogel Tilman.Vogel at web.de
Mon Oct 13 17:33:25 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear KDE core developers,

I just tried to use KProcIO without the default autoAck behaviour of
readln(). I ran into problems since the explicit use of ackRead() easily
leads to recursion. To find out what I am doing wrong, I searched in the
KDE code for examples of KProcIO use without auto-acknowledgement but
only found KSpell and in KSpell there are some mechanisms implemented to
tackle with these recursion problems...

I am attaching a tiny patch which does not change the behaviour of
KProcIO when using auto-acknowledgement but still changes its behaviour
substantially when not using auto-acknowledgement. That's why I am not
sure if you want to apply it to CVS and for which version... The patch
should not break any existing uses of readln()/ackRead() but only stop
_unwanted_ recursion causing lock-ups.

Actually the only reason why the auto-acknowledging code works, is
because it does _not_ call ackRead() even though that is, what is
advertised in the documentation....

The patch contains a small example for what I am talking about.

Thanks for any comments or questions,

Tilman Vogel




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/itPV81+NfhcAidURAg7NAJ9FlJICM1kTvATx7L+z6z/zSjXVMACfc1r8
xucPLnuEM+O006MqazHwCJo=
=vNER
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kprocio-recursion-prevention.patch
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031013/8f09f58a/attachment.ksh>


More information about the kde-core-devel mailing list