Overview
| Artifact ID: | ce43673d3cf2d514c9af573b052a0a2d59de64a3 |
|---|---|
| Ticket: | 415131ffffffffffffffffffffffffffffffffff
multithreaded tclsh exec fails (FreeBSD) |
| User & Date: | mad_derf on 2001-04-10 12:38:11 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
Hi all, I have been trying to use the tclsh8.1_r on a FreeBSD host (it was the only available precompiled package, but I also had the case with Tcl 8.0 and Tcl 8.3.2 compiled). Ok, so here is the problem : % exec ls error reading output from command: interrupted system call % When I link tclsh with libc.so rather than libc_r.so (the multi-threaded c library), there is no problem, but if I link with the libc_r.so, I often have the above output (I say often, because it also sometimes work ...) I went into the code (and I had to say it was tough with GDB - seems to have problem with multi-threaded applications on FreeBSD), and it seems to be coming from the unix/tclUnixPipe.c file. In the PipeInputProc (), I replaced : ------------ bytesRead = read(GetFd(psPtr->inFile), buf, (size_t) toRead); if (bytesRead > -1) { return bytesRead; } *errorCodePtr = errno; return -1; ------------ with ------------ do { bytesRead = read(GetFd(psPtr->inFile), buf, (size_t) toRead); } while ((bytesRead < 0) && (errno == EINTR)); if (bytesRead < 0) { *errorCodePtr = errno; return (-1); } else { return (bytesRead); } ------------- It seems that the SUN RPCs also use that trick (in clnt_udp.c). After applying that patch, it seems all right. Shall I commit somewhere for that patch to be integrated (if agreed) in next releases ? Hope this helps DERF - foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "mad_derf"
- subsystem changed to: "49. Threading"
- title changed to: "multithreaded tclsh exec fails (FreeBSD)"
- type changed to: "Bug"