Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1084 tcl with threads will not exit

obsolete: 8.2
closed-fixed
nobody
2
2000-10-26
2000-10-26
Anonymous
No

OriginalBugID: 3871 Bug
Version: 8.2
SubmitDate: '1999-12-13'
LastModified: '2000-04-25'
Severity: CRIT
Status: Released
Submitter: techsupp
ChangedBy: hobbs
RelatedBugIDs: 3414 4139
OS: Solaris
OSVersion: Solaris 2.5.1 , 2.6 , 2.7
FixedDate: '2000-04-25'
FixedInVersion: 8.3.1
ClosedDate: '2000-10-25'

Name:
Amit Khivesara

ReproducibleScript:
In a tcl program if we do a ::system("") command which
starts a child which is run in the background.
e.g .::system("tail -f /etc/passwd&").

The program will not exit since the Notify Thread will not come out of the select in tclUnixNotify.c

ObservedBehavior:
This is because the pipe is closed by the other thread
but the fork of the child in ::system still has the file
descripter open.

DesiredBehavior:
It should exit.

PatchFiles:
The bug is in tclUnixNotify.c in method NotifierThreadProc.
The fds should be FD_CLOEXEC.

i.e.
if (pipe(fds) != 0) {
panic("NotifierThreadProc: could not create trigger pipe.");
}
/** Lines added are for BUG!!!*/
fcntl(fds[0],F_SETFD,FD_CLOEXEC);
fcntl(fds[1],F_SETFD,FD_CLOEXEC);

This is the same problem as was noted in 4139, fixed with different
fix (sending 'q' through triggerPipe).
-- 04/25/2000 hobbs

Discussion

  • Brent B. Welch
    Brent B. Welch
    2000-10-26

    • priority: 5 --> 2
    • status: open --> closed-fixed