Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9b5a81eafd7758d7d282c4ad25cb3b18a6cd1a7a
Ticket: 218039ffffffffffffffffffffffffffffffffff
Tcl on Solaris 2.6 crashes when exceptions are thrown by a .
User & Date: nobody on 2000-10-26 00:52:28
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1349 Bug
    Version: 8.0.4
    SubmitDate: '1999-03-02'
    LastModified: '1999-09-16'
    Severity: CRIT
    Status: Closed
    Submitter: pat
    ChangedBy: hobbs
    OS: Solaris
    OSVersion: 2.6
    Machine: Other
    FixedDate: '2000-10-25'
    ClosedDate: '1999-09-16'
    
    
    Name:
    Philip Ehrens
    
    Extensions:
    BLT, X, Expect, Tk
    
    ReproducibleScript:
    load test.so
    test
    
    
    
    
    ObservedBehavior:
    When the following code fragment is compiled into a .so and loaded
    into Tcl on Solaris, it crashes on a call to "test".
    This occurs on Tcl versions 8.0.2-8.0.4.  I have not tested 8.0.5.
    The problem DOES NOT occur when the Tcl package is compiled with
    gcc-2.7.2.3 -- but does manifest with all versions of egcs.
    
    The code works fine under Linux -- this bug is specific to Solaris.
    
    #include <tcl.h>
    #include <math.h>
    
    extern "C"
    {
        int Test_Init( Tcl_Interp *interp );
    
    int TestCmd(
        ClientData clientData, Tcl_Interp *interp, int argc, char*argv[] )
    {
        try
        {
            throw( 1 );
        }
        catch( ... )
        {}
    
        sprintf( interp->result, "OK" );
        return TCL_OK;
    }
    
    int Test_Init( Tcl_Interp *interp )
    {
        Tcl_CreateCommand( interp, "test", TestCmd, (ClientData)NULL,
                           (Tcl_CmdDeleteProc *)NULL );
        
        Tcl_PkgProvide( interp, "test", "1.1" );
        return TCL_OK;
    }
    
    }
    
    
    
    
    DesiredBehavior:
    The script should return "OK", instead it aborts!
    
    
    
    
    
    This looks to possibly be a compiler bug, since it bombs on
    egcs but not gcc and is C++ related.  However, this is not
    the cleanest code either.  The user should not use interp->result
    directly - they risk getting stomped there. 
    -- 09/16/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.0.4"
  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: "69. Other"
  10. title changed to:
    Tcl on Solaris 2.6 crashes when exceptions are thrown by a .
    
  11. type changed to: "Bug"