Skip to content
Tcl Source Code History Of Ticket 548686ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 548686ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 548686ffffffffffffffffffffffffffffffffff

  1. Ticket change [64c10eb25f] (rid 92826) by nobody on 2002-04-25 16:16:39:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      running on solaris 5.7, tcl 8.3.4 compiled with gcc
      version egcs-2.91.66 19990314 (egcs-1.1.2 release)
      
      do:
      set a 0x0
      set b 0
      expr {$a||$b}; # FAIL! expected boolean value but got
      "0x0"
      
      expr {0x0||0}; # PASSES
      
      This is astonishing, to say the least.
      
      There appears to be some some problem with variable
      expansion done by expr,
      radix conversion, and short-circuiting Boolean
      evaluation.
      
      
      
    4. foundin initialized to: "obsolete: 8.3.4"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "None"
    10. title initialized to: "expr || fails with hex data"
    11. type initialized to: "Bug"
  2. Ticket change [de19b43ccb] (rid 114787) by msofer on 2002-04-25 23:44:02:

    1. assignee changed to: "msofer"
    2. subsystem changed to: "45. Parsing and Eval"
  3. Ticket change [94bf4df3da] (rid 106045) by msofer on 2002-04-25 23:44:03:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      I cannot reproduce this with either tcl8.3.4 (Activestate
      binary or compiled from tcl-core-8-3-1-branch) or the HEAD
      (linux, gcc 2.96).
      
      Can this be platform specific? Weird ...
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  4. Ticket change [1fca18ca62] (rid 91205) by nobody on 2002-04-25 23:55:46:

    1. icomment:
      Logged In: NO 
      
      After msofer responded, I retried this experiment on a
      linux-x86 box
      and on my solaris boxes.
      linux-x86 works as intendend; 
      
      solaris5.7 and solaris 5.8 fails as shown above.
      I only ran the experiment on tcl8.3.2.
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  5. Ticket change [644a5dfc47] (rid 92738) by rrh on 2002-04-26 00:17:50:

    1. icomment:
      Logged In: YES 
      user_id=526373
      
      The original submitter ([email protected]) now has a source forge
      account "rrh"
      
      
    2. login: "rrh"
    3. mimetype: "text/plain"
    4. username: "rrh"
  6. Ticket change [452e8d416a] (rid 116838) by rrh on 2002-04-26 00:23:10:

    1. icomment:
      Logged In: YES 
      user_id=526373
      
      here's more information:
      In a fresh tclsh8.3.2 on solaris, I do:
        set a 0x0; set b 0; expr {$a+$b}; expr {$a||$b}; # no
      problems!A
      then in another fresh tcl8.3.2 session I do:
        set a 0x0; set b 0; expr {$a||$b}; # FAILS!
      So the evaluation of + somehow normalizes the constant for
      ||.
      
      
      
    2. login: "rrh"
    3. mimetype: "text/plain"
    4. username: "rrh"
  7. Ticket change [ff44c7c255] (rid 108728) by msofer on 2002-04-26 00:32:25:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Could you please attach your unix/config.cache file to this
      report? I'm not yet sure what I'mlooking for, but it is
      probably in there ...
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  8. Ticket change [0b3e0ff12d] (rid 113951) by msofer on 2002-04-26 06:58:13:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      I think I found the source of the bug: INST_LOR calls
      Tcl_GetBooleanFromObj(), which then calls strtod() on the
      string. Apparently, the Solaris strtod() does not handle hex
      numbers ...
      
      Quoting from
      http://www.redhat.com/devnet/whitepapers/solaris_port/x1609.html
      
      "Note: The GNU C library includes all ISO C99 functionality.
      This introduces two kinds of problems: 
      a) traditionally used interfaces might be reused (example:
      the nan function, there was a nan symbol on some
      implementation denoting the NaN value); 
      b) silent changes in the implementation. The latter is
      especially bad but unavoidable. One often hit problem is the
      change in strtod et.al to allow the hexadecimal
      floating-point number notation which suddenly lets strtod
      accept expressions it would not have before."
      
      I think I can find a workaround for this - the call to
      strtod might be premature in Tcl_GetBooleanFromObj(), or the
      the call to Tcl_GetBooleanFromObj() might be premature in
      INST_LOR; however, it will not happen tonight. 
      
      Also, it might be a good opportunity to look for other
      hex/strtod bugs lurking in there.
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  9. Ticket change [f34b44ac11] (rid 129684) by hobbs on 2002-04-26 07:22:09:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      This problem occurs on Windows2000 as well for 8.3, but not 
      8.4.  Same on HP-11 (bad on 8.3, ok on 8.4).  I suspect 
      that the WideInt stuff changed the way in which nums are 
      identified in some way.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  10. Ticket change [ae10189093] (rid 101569) by dkf on 2002-04-26 15:15:45:

    1. assignee changed to: "dkf"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      I can't reproduce using 8.4a5 on Solaris8, but to help I
      attach the bytecode produced (the instruction offsets are a
      little odd because of how I'm doing the instrumentation)
      
        Command 4: "expr {$a||$b}"
          (16) loadScalar1 0  # var "a"
          (18) jumpTrue1 6    # pc 24
          (20) push1 1        # "0"
          (22) jump1 4        # pc 26
          (24) push1 3        # "1"
          (26) dup 
          (27) jumpTrue1 5    # pc 32
          (29) loadScalar1 1  # var "b"
          (31) lor 
          (32) done 
      
      So, what is the problem?  Is the fault coming from
      INST_JUMP_TRUE1 or INST_LOR?  Actually, it doesn't really
      matter; the real problem is indeed Tcl_GetBooleanFromObj()
      (called by both those instructions) being unable to handle
      0x0 on some platforms.
      
      Ah!  Oh.  I see a problem because only strtoll() and
      strtod() are used to try to parse the string, and not
      strtol().  I'll fix this bug (which still exists on the head
      on 64-bit machines!) and backport to the 8.3 branch.
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. subsystem changed to: "10. Objects"
    6. username: "dkf"
  11. Ticket change [d35e06feb2] (rid 123278) by dkf on 2002-04-26 15:46:03:

    1. closedate changed to: "2002-04-26T08:46:03"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      OK, I think I've got this fully fixed in both the 8.3 branch
      (which didn't handle things like 0xac at all) and in the
      HEAD (which just came unstuck on some platforms in selected
      situations.)
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dkf"
  12. Ticket change [57a1bf868c] (rid 117650) by dgp on 2002-04-26 18:34:36:

    1. closedate changed to: "2002-04-26T11:34:36"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      Tcl's core-8-3-1-branch is now broken on Linux:
      
      cc -pipe -c -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES
      -Wall -Wconversion -Wno-implicit-int -fPIC -I./../generic
      -I. -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_GETCWD=1
      -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1
      -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_UNISTD_H=1
      -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1
      -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1
      -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1
      -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1
      -DNEED_MATHERR=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_SYS_IOCTL_H=1
      -DSTATIC_BUILD=1         -DTCL_SHLIB_EXT=\".so\"
      ./../generic/tclObj.c
      ./../generic/tclObj.c: In function `SetBooleanFromAny':
      ./../generic/tclObj.c:1059: too few arguments to function
      `strtol'
      make: *** [tclObj.o] Error 1
      
      
      
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. username: "dgp"
  13. Ticket change [067ad5f2b0] (rid 89235) by dgp on 2002-04-26 19:15:29:

    1. closedate changed to: "2002-04-26T12:15:29"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      seems it was just a missing argument typo.
      
      committing fix to the fix.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. username: "dgp"
  14. Ticket change [d5813d430f] (rid 123635) by dkf on 2002-04-27 04:07:16:

    1. closedate changed to: "2002-04-26T21:07:16"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      Thanks for fixing that; the old brain must've been on the
      blink for me to (conceptually) copy the arguments from
      strtod() instead of strtol() in the other editor window, and
      I had to leave my office in a hurry (recarpeting!) so I
      didn't have time to get the (blindingly obvious) fix in.
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. username: "dkf"