Overview
| Artifact ID: | 275372479d3e59d821e5e784f6ac3f303e2ee344 |
|---|---|
| Ticket: | 2826248fffffffffffffffffffffffffffffffff
Redirecting to a ref chan results in a seg fault |
| User & Date: | andy22286 on 2009-07-23 22:17:13 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
When using a ref chan as part of an [exec] command, on redirection to the channel from another subprocess, a segmentation fault occurs. This is due to a NULL function pointer, as detailed below. See attached for sample script and associated valgrind error report. As stated by aku, akuTclpMakefile (tclUnixPipe) calls Tcl_GetChannelHandle (tclIO), this runs ->getHandleProc. This is NULL for reflected channels. akuAccording to my comment in tclIORChan.c this getHandleProc should be NULL'able, i.e. NULL allowed. Seems not. Or some check is missing somewhere. akuright, tcl.h says the same, getHandleProc can be set to NULL if not supported. akuThat means any channel type without getHandleProc will crash 'exec' and 'open|' when using a chanel of that type. akuso, we have to add a NULL check in Tcl_GetChannelHandle, and return TCL_ERROR if this occurs. akuI will likely have to do some other things around this to get a nice error message. The standard message will just claim 'not opened for reading or writing', which is bogus for this case.
- foundin changed to: "obsolete: 8.6b1"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "andy22286"
- subsystem changed to: "24. Channel Commands"
- title changed to: "Redirecting to a ref chan results in a seg fault"
- type changed to: "Bug"