.
D 2005-10-31T05:32:55
J assignee vincentdarley
J cmimetype text/plain
J comment Tcl/Tk\sversion\s:\s8.4.6\s(exists\sin\s8.4.11)\nPlatform:\sSun\sSPARC\sSolaris\s9\s\n\nIn\sthe\schild\ssection\sof\sTclpCreateProcess()\sin\nunix/tclUnixPipe.c,\safter\sthe\s"pid\s=\sfork();\sif\s(\spid\n....)"\scode,\sthe\schild\sprocess\ssets\sup\sstd\sfile\ndescriptors,\srestores\ssignal\shandling,\sand\sexecutes\sthe\nnew\sprocess.\n\nUnfortunately,\sthe\schild\sleaves\sall\sexisting\sfile\ndescriptors\sopen!\sI\sbelieve\sthere\sshould\sbe\san\soption\n(perhaps\sthe\sdefault)\sto\sclose\sall\sopen\sfile\ndescriptors\sbefore\sexec()\sso\sthe\schildren\s(and\ngrandchildren,...)\sdon't\sinherit\sthem.\sIf\sit\sis\san\noption\sthen\s"exec"\swill\sneed\san\sinterface\sto\sthis\noption,\sto\sallow\sthe\sscript\swriter\sto\sclose\sall\sopen\nfile\sdescriptors.\n\nRegards,\nPeter\sBray\nSydney,\sAustralia\n\nPS:\sIn\sour\scase\sa\sUI,\swhich\sloads\sa\sshared\slibrary\sthat\nconnects\sto\sa\sserver\s(TCP/IP),\sused\s"exec"\sto\sstart\sa\nbackgrounded\s(daemonised\sactually)\scopy\sof\sfirefox\sto\ndisplay\sthe\suser\shelp.\nLSOF\sshows\sthat\sfirefox\sinherited\sthe\ssocket\nconnections\sand\sother\sfile\sdescriptors,\sand\swhen\sthe\sUI\nexited,\sthe\sfirefox\sprocess\sstill\shad\sreferences\sto\nthese\sfile\sdescriptors,\smeaning\sthat\sthe\sserver\sdid\snot\ndetect\sa\sconnection\sclose.\sTrouble\sensued\sand\smemory\nand\scpu\sexited\sstage\sleft...\sas\sthe\sserver\stry\sto\nbuffer\sdata\sfor\sa\sclient\sthat\swas\snot\sreading\sfrom\sits\nsocket\sconnection.
J foundin obsolete:\s8.4.11
J priority 5\sMedium
J resolution None
J status Open
J submitter illumino
J subsystem 37.\sFile\sSystem
J title exec\simplemenation\sfails\sto\sclose()\sopen\sfile\sdescriptors
J type Bug
K 1343211fffffffffffffffffffffffffffffffff
U illumino
Z 598cda3c00f2ef828c24334715c4a007