Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-16
23:47 • Ticket [218039ffff] Tcl on Solaris 2.6 crashes when exceptions are thrown by a .... artifact: c3c54a7f03 user: dgp
2000-10-26
08:13 • Closed ticket [218039ffff]. artifact: add530a99a user: welch
00:52 • New ticket [218039ffff]. artifact: 9b5a81eafd user: nobody

Tcl on Solaris 2.6 crashes when exceptions are thrown by a .

Closed / Invalid218039ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:52:28
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
welch Closed ticket [218039ffff]. [History diff]2000-10-26 08:13:43
dgp Ticket [218039ffff]: 4 changes [History diff]2001-04-16 23:47:41
Log in (anonymous is fine) to add a comment.