Tcl Source Code

View Ticket
Login
Ticket UUID: 1325099
Title: Solaris coredump with pure Tcl
Type: Bug Created on: 2005-10-12 18:19:01
Submitter: nobody Assigned to: dkf
Subsystem: 37. File System Severity:
Priority: 9 Immediate Last modified: 2005-10-13 05:46:02
Status: Closed Closed by: dkf
Resolution: Fixed Closed on: 2005-10-12 22:46:02
Version: obsolete: 8.5a4
Description:
Tested on Solaris 8, 9 with both tclsh and tclkit8.5a4

file exists ~//.nonexistant
file exists ~///.nonexistant
etc.

causes tcl to dump core when executed inside a script.

file exists ~/.nonexistant

does not. Same happens for file isfile, etc.

Even more puzzling, if I execute the code interactively
from tclkit
prompt, it works!  If I execute it from a script, it
coredumps.

The same code works ok on Linux.
User Comments:
hobbs added on 2005-10-13 01:38:37:
Logged In: YES 
user_id=72656

Confirmed in 8.5, not a problem in 8.4.

dbx stack trace:

signal SEGV (no mapping at the fault address) in
SetFsPathFromAny at line 2332 in file "tclPathObj.c"
 2332                       TclpNativeJoinPath(transPtr,
TclGetString(*objv++));
(dbx) where
=>[1] SetFsPathFromAny(interp = 0x8063810, pathPtr =
0x806c4b8), line 2332 in "tclPathObj.c"
  [2] Tcl_ConvertToType(interp = 0x8063810, objPtr =
0x806c4b8, typePtr = 0xfefb89f4), line 599 in "tclObj.c"
  [3] Tcl_FSConvertToPathType(interp = 0x8063810, pathPtr =
0x806c4b8), line 1128 in "tclPathObj.c"
  [4] CheckAccess(interp = 0x8063810, pathPtr = 0x806c4b8,
mode = 0), line 1387in "tclCmdAH.c"
  [5] Tcl_FileObjCmd(dummy = (nil), interp = 0x8063810, objc
= 3, objv = 0x804758c), line 925 in "tclCmdAH.c"
  [6] TclEvalObjvInternal(interp = 0x8063810, objc = 3, objv
= 0x804758c, command = 0x806a7d3 "file exists
~//.nonexistant\nfile exists ~///.nonexistant\n", length =
28, flags = 0), line 3379 in "tclBasic.c"
  [7] Tcl_EvalEx(interp = 0x8063810, script = 0x806a7b8
"file exists ~/.nonexistant\nfile exists
~//.nonexistant\nfile exists ~///.nonexistant\n", numBytes =
84, flags = 0), line 3850 in "tclBasic.c"

dkf added on 2005-10-13 05:46:02:
Logged In: YES 
user_id=79902

Oooh, that looks bad:
  TclGetString(*objv++)
combining a macro and post-increment can't be good. (And
it's my fault; must have been tired when I did that.)

FWIW, it crashed for me on Linux too. The non-crash was
probably a library versioning problem come to save the day...

Fix works for me on Linux; please reopen if it fails on Sol
(or anywhere else).