Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2000-10-26
08:34 • Closed ticket [219045ffff]: Core dumps on SIGINT in multithreaded application af... artifact: d2289063b0 user: welch
01:09 • New ticket [219045ffff]. artifact: 87ba4e367a user: nobody

Core dumps on SIGINT in multithreaded application after retu

Closed / Fixed219045ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:09:51
OriginalBugID: 4112 Bug
Version: 8.2.3
SubmitDate: '2000-02-01'
LastModified: '2000-02-07'
Severity: CRIT
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: Solaris
OSVersion: Solaris 2.7
Machine: Sun Ultra 30
FixedDate: '2000-02-07'
FixedInVersion: 8.3b1
ClosedDate: '2000-10-25'


Name:
Stephan Voges

CustomShell:
We redefine the "puts" command.

ObservedBehavior:
We use Tcl 8.2.3 in a multithreaded application.  This application installs its own handler for SIGINT.  We observe that if the script contains an "exec" command, any Ctrl-C after the "exec" will cause a core dump.  Searching for the string "SIGINT" through the Tcl source, we found that in the file tclUnixPipe.c, there is a function RestoreSignals that sets the handler for SIGINT back to default.  If we modify this code to set it to our handler, the problem goes away.  We also noticed that RestoreSignals is called in a process spawned by vfork, which according to the man pages is not MT-safe.

DesiredBehavior:
Tcl shouldn't change our signal handlers.  If it needs to temporarily, or if something else might, it should save state and restore state afterwards.

Patch:
Diff output: note that this was just a hack, we declared our handler 
30a31
>  extern void my_handler (int sig);
493c494
<     signal(SIGINT, SIG_DFL);
---
>     signal(SIGINT, my_handler);

PatchFiles:
tclUnixPipe.c



This should be solved in 8.3, where we no longer attempt to use
vfork at all due to reasons like the above.  Please tell us if
that doesn't fix this particular case (it did solve other signal
related issues with vfork). 
-- 02/05/2000 hobbs
User verified that 8.3b2 works as expected. 
-- 02/07/2000 hobbs
welch Closed ticket [219045ffff]. [History diff]2000-10-26 08:34:05
Log in (anonymous is fine) to add a comment.