Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 87ba4e367ae62b27169d99c99be6bf1d28572253
Ticket: 219045ffffffffffffffffffffffffffffffffff
Core dumps on SIGINT in multithreaded application after retu
User & Date: nobody on 2000-10-26 01:09:51
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    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
    
  4. foundin changed to: "final: 8.2.3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "49. Threading"
  10. title changed to:
    Core dumps on SIGINT in multithreaded application after retu
    
  11. type changed to: "Bug"