Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2007-02-23
10:20 • Closed ticket [1602838fff]: Late crash with --{exec}-prefix=~/... plus 6 oth... artifact: 2d2db01f53 user: sf-robot
2007-02-09
08:00 • Pending ticket [1602838fff]. artifact: b3137ed2da user: hobbs
2007-01-18
18:49 • Ticket [1602838fff]: 1 change artifact: a678501e0e user: dkf
2006-11-26
04:41 • Ticket [1602838fff]: 4 changes artifact: 822b7020d1 user: jcw
2006-11-25
21:36 • New ticket [1602838fff]. artifact: 63b08cb8da user: jcw

Late crash with --{exec}-prefix=~/...

Closed / Invalid1602838fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2006-11-25 21:36:22
When called with non-absolute paths of the form "~/...", a Tcl build produces a tclsh binary and installs it.

However, the resulting exe (Mac OS X 10.4.8, Intel) crashes:

$ w/tclg/bin/tclsh8.4 
Bus error

The commands I used for the build were:

rm -rf /tmp/tclg
mkdir -p /tmp/tclg
cd /tmp/tclg
/Users/Shared/Oss/tcl84-cvs/unix/configure --enable-symbols \
      --disable-shared --prefix=~/w/tclg --exec-prefix=~/w/tclg
make install

When I use this configure instead, the resulting tclsh is fine:

/Users/Shared/Oss/tcl84-cvs/unix/configure --enable-symbols \
      --disable-shared --prefix=~/w/tclg --exec-prefix=~/w/tclg

Here's the stack trace:

$ gdb w/tclg/bin/tclsh8.4
GNU gdb 6.3.50-20050815 (Apple version gdb-573) (Fri Oct 20 15:50:43 GMT 2006)
Copyright 2004 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 "i386-apple-darwin"...Reading symbols for shared libraries ... done

(gdb) r
Starting program: /Users/jcw/w/tclg/bin/tclsh8.4 
Reading symbols for shared libraries ...... done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x0001a0c2 in TclpFindVariable (name=0xada10 "HOME", lengthPtr=0xbfffedd4) at /Users/Shared/Oss/tcl84-cvs/unix/tclUnixInit.c:970
970         for (i = 0, env = environ[i]; env != NULL; i++, env = environ[i]) {
(gdb) p i
$1 = 0
(gdb) p environ
$2 = <unknown type>
(gdb) p env
$3 = 0x0
(gdb) bt 9
#0  0x0001a0c2 in TclpFindVariable (name=0xada10 "HOME", lengthPtr=0xbfffedd4) at /Users/Shared/Oss/tcl84-cvs/unix/tclUnixInit.c:970
#1  0x0004c920 in TclGetEnv (name=0xada10 "HOME", valuePtr=0xbfffee24) at /Users/Shared/Oss/tcl84-cvs/unix/../generic/tclEnv.c:503
#2  0x00076fd2 in SetFsPathFromAny (interp=0x0, objPtr=0x1801e28) at /Users/Shared/Oss/tcl84-cvs/unix/../generic/tclIOUtil.c:6111
#3  0x000038fb in Tcl_ConvertToType (interp=0x0, objPtr=0x1801e28, typePtr=0xba178) at /Users/Shared/Oss/tcl84-cvs/unix/../generic/tclObj.c:471
#4  0x00075cba in Tcl_FSConvertToPathType (interp=0x0, objPtr=0x1801e28) at /Users/Shared/Oss/tcl84-cvs/unix/../generic/tclIOUtil.c:5019
#5  0x000764ba in Tcl_FSGetNormalizedPath (interp=0x0, pathObjPtr=0x1801e28) at /Users/Shared/Oss/tcl84-cvs/unix/../generic/tclIOUtil.c:5512
#6  0x0007352e in Tcl_FSOpenFileChannel (interp=0x0, pathPtr=0x1801e28, modeString=0xaa88c "r", permissions=0) at /Users/Shared/Oss/tcl84-cvs/unix/../generic/tclIOUtil.c:2153
#7  0x0004a15e in OpenEncodingFile (dir=0x601310 "~/w/tclg/lib/tcl8.4", name=0xbffff460 "us-ascii") at /Users/Shared/Oss/tcl84-cvs/unix/../generic/tclEncoding.c:1411
#8  0x00049e7c in LoadEncodingFile (interp=0x0, name=0xbffff460 "us-ascii") at /Users/Shared/Oss/tcl84-cvs/unix/../generic/tclEncoding.c:1310
(More stack frames follow...)

If the build is so sensitive to paths, shouldn't it fail i.s.o. installing the resulting binary?

-jcw
jcwplain2006-11-26 04:41:46
Logged In: YES 
user_id=1983
Originator: YES

This probably happened only because I *pasted* the build commands into as bash session - normally, interactive input would have expanded the "~" before passing it on.

-jcw
dkf Ticket [1602838fff]: 1 change [History diff]2007-01-18 18:49:01
hobbsplain2007-02-09 08:00:48
Logged In: YES 
user_id=72656
Originator: NO

So should I assume that there is something to fix here?  It sounds like more "don't do that ..."
sf-robotplain2007-02-23 10:20:09
Logged In: YES 
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
Log in (anonymous is fine) to add a comment.