|
2009-07-25
| ||
| 00:43 | • Closed ticket [2826248fff]: Redirecting to a ref chan results in a seg fault... artifact: 8902295319 user: andreas_kupries | |
|
2009-07-24
| ||
| 05:52 | • Ticket [2826248fff]: 4 changes artifact: b1bdd82cb3 user: andreas_kupries | |
| 05:28 | • Ticket [2826248fff]: 4 changes artifact: ade225cc38 user: andreas_kupries | |
| 05:27 | • Ticket [2826248fff]: 4 changes artifact: e068115df4 user: andreas_kupries | |
| 05:27 | • Add attachment io-unos-channels-in-exec.patch to ticket [2826248fffffff... artifact: 32a76d1d9f user: andreas_kupries | |
| 05:22 | • Ticket [2826248fff] Redirecting to a ref chan results in a seg fault status ... artifact: 90ed3ac4dd user: andy22286 | |
| 05:19 | • Add attachment chan.tcl.valgrind to ticket [2826248fffffffff|2826248fff... artifact: b0966fea24 user: andy22286 | |
| 05:19 | • Ticket [2826248fff] Redirecting to a ref chan results in a seg fault status ... artifact: d2051dea5b user: andy22286 | |
| 05:19 | • Ticket [2826248fff]: 4 changes artifact: 197f68d25d user: andy22286 | |
| 05:19 | • Ticket [2826248fff]: 4 changes artifact: c6ef51aa7b user: andy22286 | |
| 05:17 | • Add attachment chan.tcl to ticket [2826248fff] artifact: 99f621ddf5 user: andy22286 | |
| 05:17 | • Ticket [2826248fff] Redirecting to a ref chan results in a seg fault status ... artifact: c374524074 user: andy22286 | |
|
2009-07-23
| ||
| 22:17 | • New ticket [2826248fff]. artifact: 275372479d user: andy22286 | |
Redirecting to a ref chan results in a seg fault
Closed / Fixed2826248fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2009-07-23 22:17:13
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.
andy22286plain2009-07-24 05:17:13
File Added - 336313: chan.tcl
andy22286plain2009-07-24 05:19:09
File Added - 336314: chan.tcl.valgrind
andy22286plain2009-07-24 05:19:21
File Deleted - 336314:
andy22286plain2009-07-24 05:19:52
File Added - 336315: chan.tcl.valgrind
andy22286plain2009-07-24 05:22:42
The sample script fails as detailed in the bug description on: Linux 2.6.28-13-generic Ubuntu 9.04 GNU/Linux
andreas_kupriesplain2009-07-24 05:27:14
File Added - 336317: io-unos-channels-in-exec.patch
andreas_kupriesplain2009-07-24 05:28:41
Attached a patch fixing the problem for me.
andreas_kupriesplain2009-07-24 05:52:38
Passes testsuite. Committed for HEAD. Keeping open, check 8.5 branch as well.
andreas_kupriesplain2009-07-25 00:43:06
allow_comments - 1 Backported to 8.5. Closing.
Log in (anonymous is fine) to add a comment.
Attachments:
- io-unos-channels-in-exec.patch [download] added by andreas_kupries on 2009-07-24 05:27:13. [details]
- chan.tcl.valgrind [download] added by andy22286 on 2009-07-24 05:19:52. [details]
- chan.tcl [download] added by andy22286 on 2009-07-24 05:17:13. [details]