Tcl version: 8.4+
OS: Linux Red Hat 4, 5
Maybe, it is a Linux bug, but it appeared in Tcl's stdin handling. I got
the problem in C, but I created a Tcl script that fails the same way.
If you execute a certain command though system()/exec which fails, stdin
stream does not provide any more input except already buffered in C code.
My Tcl script is more that 8K long because I initially got the problem on
the very next byte after 8K, but attached test fails a bit earlier.
Important: file must be redirected to stdin:
> tclsh <xxx.tcl
Read(0) just returns 0 as if it is the end of pipe/socket. If you specify
file name as an argument, the script works.
I cannot classify the problem. Just weird. Stdin stays open, /proc/pid/fd
shows it, but 0 handle is damaged. Fork/clone is doing something bad to to
the parent's stdin.
Any help is appreciated. I cannot depend on any developer who can call
system() and break stdin. Yes, I know that such redirection seem to make no
sense, but it does; it is just a simplified version.
Alexandre Ferrieux
50. Embedding Support
current: 8.4.19
Public
|
Date: 2009-03-01 20:43 Thanks!!! |
|
Date: 2009-03-01 10:57 OK got it. This is not a Tcl nor Linux problem, just one specific behavior |
|
Date: 2009-02-28 18:53 File Added: tra |
|
Date: 2009-02-28 17:33 File Added: tra |
|
Date: 2009-02-28 12:23 Please attach an strace: |
| Filename | Description | Download |
|---|---|---|
| xxx.tcl | Script that does not reach the end | Download |
| tra | strace -f -tt -o tra tclsh < xxx.tcl | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| close_date | - | 2009-03-01 10:57 | ferrieux |
| allow_comments | 1 | 2009-03-01 10:57 | ferrieux |
| resolution_id | None | 2009-03-01 10:57 | ferrieux |
| status_id | Open | 2009-03-01 10:57 | ferrieux |
| File Deleted | 315599: | 2009-02-28 18:55 | eugene_cdn |
| File Added | 315599: tra | 2009-02-28 18:53 | eugene_cdn |
| File Added | 315586: tra | 2009-02-28 17:33 | eugene_cdn |
| assigned_to | nobody | 2009-02-28 12:46 | dkf |
| artifact_group_id | None | 2009-02-28 12:46 | dkf |
| category_id | None | 2009-02-28 12:46 | dkf |
| File Added | 315531: xxx.tcl | 2009-02-28 06:56 | eugene_cdn |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use