From: SourceForge.net <no...@so...> - 2004-02-06 19:34:08
|
Bugs item #772288, was opened at 2003-07-16 06:18 Message generated for change (Comment added) made by hobbs You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=772288&group_id=10894 Category: 25. Channel System Group: obsolete: 8.4.3 Status: Open Resolution: None Priority: 8 Submitted By: Donal K. Fellows (dkf) >Assigned to: Jeffrey Hobbs (hobbs) Summary: Crash when std channels not open Initial Comment: The following script crashes both the HEAD and the 8.4 branch: open /dev/null when run like this (from BASH, but there are other equivalent situations): tclsh bug.tcl <&- The effect of the invokation is to make tclsh run without stdin opened (the same also happens with stdout and stderr.) This is caused by leaving the initialisation of the channel table until the call to Tcl_RegisterChannel() as part of the closing stages of the [open] implementation, which ensures that fd0 (or 1 or 2) is put in the table twice, once for stdin/out/err and once for the newly created channel for [open], with the second time being the crash. The attached patch fixes this, but causes test encoding-24.3 to fail, and will break any script that depends on setting [encoding system] early so as to alter the encodings of the std channels. This problem was discovered by rmax ---------------------------------------------------------------------- >Comment By: Jeffrey Hobbs (hobbs) Date: 2004-02-06 11:34 Message: Logged In: YES user_id=72656 we should have a test case for this. ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2003-11-06 15:22 Message: Logged In: YES user_id=72656 The alternate patch ignores Windows ... but is that 100% valid? I recently had to solve this by checking for the standard channels being NULL on Windows. I can't repro this with a variation of bug.tcl though. ---------------------------------------------------------------------- Comment By: Reinhard Max (rmax) Date: 2003-10-02 06:15 Message: Logged In: YES user_id=124643 How about this patch, at least as a workaround to prevent the crash until a better solution is found? Unlike Donal's proposal no tests fail with this patch applied. There might be better places for adding these lines, but TclpInitPlatform was the most reasonable place I have found. ---------------------------------------------------------------------- Comment By: Reinhard Max (rmax) Date: 2003-10-02 02:38 Message: Logged In: YES user_id=124643 Any news here, Jeff? Today another colleague got hit by this bug, because stdin is closed on processes started from fvwm2 buttons or menus. ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2003-07-18 13:19 Message: Logged In: YES user_id=72656 I want a much better understanding of the implications of this bug before placing it into 8.4.x ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=772288&group_id=10894 |