Overview
| Artifact ID: | 87c654b1593791912c3ff6e787318acb85c0ae2a |
|---|---|
| Ticket: | 2860233fffffffffffffffffffffffffffffffff
Calling Tcl_FindCommand() from a shared lib segfaults |
| User & Date: | eriklns on 2009-09-16 19:41:02 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
Observed -------- Tcl8.4 segfaults when calling Tcl_FindCommand() from a stubs enabled shared object. The segfault occurs at the assembler instruction "call", and the program never makes it into the function. At the moment of the call instruction, the cpu register that holds the memory location to which the call is made, holds the value 0x0. Running the code from the same shared lib in tclsh8.5 (8.5.7) does not exhibit the problem. System specification: % parray tcl_platform tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = i686 tcl_platform(os) = Linux tcl_platform(osVersion) = 2.6.18.8-0.13-default tcl_platform(platform) = unix tcl_platform(user) = erik tcl_platform(wordSize) = 4 % set tcl_patchLevel 8.4.19 How to reproduce ---------------- Attached to this report is the code for a Tcl extension that registers a new command "findcommand" in file fc.c. Also attached is the build script to produce the shared lib "fc.so". Assuming the completion of the build, you simply do: > tclsh8.4 % load ./fc.so % findcommand whatever Segmentation fault (core dumped) Preliminary analysis -------------------- A. ddd inspection Attached you find a screendump from the ddd debugger, showing: - a breakpoint at the line in the C code where the call to Tcl_FindCommand is made - the assembler instructions from that breakpoint up to the call instruction which fails. - the cpu registers just before the call instruction. Note the 0x0 value in the edx register. B. backtrace from core dump: see attached file gdb_backtrace.txt Preliminary interpretation -------------------------- Since Tcl itself has calls to Tcl_FindCommand all over the place without them giving cause to complain, there must be something out of the ordinary. Maybe an issue with the stubs interface?
- foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "eriklns"
- subsystem changed to: "None"
- title changed to:
Calling Tcl_FindCommand() from a shared lib segfaults
- type changed to: "Bug"