Skip to content
Tcl Source Code View Ticket
Login

View Ticket

when loading C lib; i get core dump

Closed / Fixed218280ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:55:27
OriginalBugID: 3413 Bug
Version: 8.2
SubmitDate: '1999-11-05'
LastModified: '2000-02-05'
Severity: CRIT
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: HP-UX
OSVersion: 10.2
FixedDate: '2000-10-25'
ClosedDate: '2000-02-05'


Name:
Tara Sayyah

ReproducibleScript:
I shall say that I am not sure if this is bug or I have mishandled
something; 
Any hints/comments would be welcomed.
    
I have been porting a rather complex tcl/tk utility; disregarding that;
this utility when loading a C routine gets a coredump; I believe that I
have reduced the code to the minimum relevent lines of just loading C
routine and I still get a core dump!:
    
    C routine:
    --------------------------------------------------------------------
    #include <tcl.h>
    int Mysite_Init(Tcl_Interp *interp)
    {  
        Tcl_SetResult(interp, "Boo", TCL_STATIC);
        return TCL_OK;
    }
    ----------------------------------------------------------------------
    MakeFile:
    ----------------------------------------------------------------------
    CC=/opt/ansic/bin/cc
    LD=ld
    INCLUDE=        -I/home/taras/tcl8.2.0/include   
    CCFLAGS= +z -O -Aa -g  
    LDFLAGS=-b
    MYSITE_OBJS=mysite.o
    
    all:mysite.sl
    
    mysite.sl:$(MYSITE_OBJS) Makefile
    $(LD) $(LDFLAGS) $(INCLUDE) -o $@ $(MYSITE_OBJS)
    
    clean:
    rm -f *.o
    
    .c.o:
    $(CC) -c -o $@  $(INCLUDE) $(CCFLAGS) $*.c
    -------------------------------------------------------------------
    caller tcl:
    -------------------------------------------------------------------
    #!/home/taras/tcl8.2.0/bin/tclsh 
    puts "starts"
    load mysite.sl    
    puts "ends"
    --------------------------------------------------------------------
    output:
    --------------------------------------------------------------------
    taras@ces702> tclsh tara.tcl
    starts
    ends
    Memory fault(coredump)
    --------------------------------------------------------------------
    I am using an HP machine using HP-UX 10.2 operating system
    --------------------------------------------------------------------
    I have complied the tclsh from sources provided at scriptics site
    --------------------------------------------------------------------

ObservedBehavior:
ran gdb on core 
    ----------------------------------------------------------------
    taras@ces702>  /tmp_mnt/net/cre702/export/opt/gdb/bin/gdb tclsh core
    GNU gdb 4.18
    Copyright 1998 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you
    are
    welcome to change it and/or distribute copies of it under certain
    conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for
    details.
    This GDB was configured as "hppa2.0-hp-hpux10.20"...
    (no debugging symbols found)...
    Core was generated by `tclsh'.
    Program terminated with signal 11, Segmentation fault.
    
    warning: The shared libraries were not privately mapped; setting a
    breakpoint in a shared library will not work until you rerun the
    program.
    
    warning: Can't find file tclsh referenced in dld_list.
    Reading symbols from /home/taras/tcl8.2.0/lib/libtcl8.2.sl...done.
    Reading symbols from /usr/lib/libc.1...done.
    Reading symbols from /usr/lib/libdld.1...done.
    #0  0xc0055298 in  () from /usr/lib/libc.1
    (gdb

DesiredBehavior:
no core dumps


I don't have the compiler that you are using, so I am unable to reproduce this problem.  I did try compiling with gcc, and had no problems on our HP system:

hippo(1)$ uname -a
HP-UX hippo B.10.20 A 9000/778 2000743181 two-user license
hippo(2)$ ./out/bin/tclsh8.3 
% load mysite.sl
Boo
% exit
hippo(3)$

If you have access to gcc, can you try compiling with that instead and tell me if you still see the problem?

- eric

-- 02/01/2000 ericm
welch Closed ticket [218280ffff]. [History diff]2000-10-26 08:18:58
dgp Ticket [218280ffff]: 3 changes [History diff]2001-04-19 02:46:21
Log in (anonymous is fine) to add a comment.