Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-12-21
16:06 • Ticket [2073255fff] Tcl_GetString(NULL) doesn't crash on HP-UX status st... artifact: 60884c507f user: nijtmans
2008-10-09
12:38 • Closed ticket [2073255fff]. artifact: 9fa84afeaa user: nijtmans
04:45 • Ticket [2073255fff]: 4 changes artifact: f4e992f4a3 user: nijtmans
2008-10-08
21:35
* unix/tclUnixChan.c: fix minor compiler warning * unix/tcl.m4: fix for bug [2073255] ... check-in: ac6cee85db user: nijtmans tags: trunk
2008-08-25
16:11 • Ticket [2073255fff] Tcl_GetString(NULL) doesn't crash on HP-UX status st... artifact: 4beca6e958 user: nijtmans
09:08 • New ticket [2073255fff]. artifact: 122bbc56bf user: nijtmans

Tcl_GetString(NULL) doesn't crash on HP-UX

Closed / Fixed2073255fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-08-25 09:08:29
When calling Tcl_GetString(NULL) on HP-UX, the effect is:

    UpdateStringProc should not be invoked for type 
    Abort(coredump)

The reason for this is a 'strange' feature of the HP-UX
C compiler:by default NULL-pointer references
are allowed and simply return 0. The problem with this
is that pointer reference mistakes can cause strange
behavior far from the place where the actual error is,
such as the Tcl_GetString(NULL) example.

Proposed solution: Add the "+z" options to CFLAGS
(see patch)
nijtmansplain2008-08-25 16:11:29
Logged In: YES 
user_id=61031
Originator: YES

proposed patch (configure should be re-generated as well):

*** unix/tcl.m4.origMon Aug 25 10:16:51 2008
--- unix/tcl.m4Mon Aug 25 10:24:47 2008
***************
*** 1262,1267 ****
--- 1262,1268 ----
      ])
      AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
      AS_IF([test "$tcl_ok" = yes], [
+ CFLAGS="$CFLAGS -z"
  SHLIB_CFLAGS="+z"
  SHLIB_LD="ld -b"
  SHLIB_LD_LIBS='${LIBS}'
nijtmansplain2008-10-09 04:45:08
Original patch will surely not work with gcc, so restructured a little bit.

Now committed for the Tcl8.6a3/Tk8.6a3 releases. Not worth to backport, therefore can be closed.
nijtmans Closed ticket [2073255fff]. [History diff]2008-10-09 12:38:27
nijtmansplain2008-12-21 16:06:35
Adopted same change in TEA (tclconfig trunk and tea-3-branch)
Log in (anonymous is fine) to add a comment.