Skip to content
Tcl Source Code History Of Ticket 43b434812a
Login

History Of Ticket 43b434812a

Artifacts Associated With Ticket 43b434812a

  1. Ticket change [6089758f12] (rid 185635) by chrstphrchvz on 2020-08-21 09:28:27:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      Using Ubuntu 18.04 i686 (32 bit Intel), Tcl 9.0 ([c1e3046f2f]) appears to configure with <tt>TclOSstat()</tt> defined as <tt>stat64()</tt>, but also with <tt>Tcl_StatBuf</tt> defined to <tt>struct stat</tt> rather than <tt>struct stat64</tt>. Since <tt>struct stat64</tt> is larger (96 bytes rather than 88), calling <tt>stat64()</tt> with a pointer to <tt>struct stat</tt> will write to memory outside of the <tt>struct stat</tt>. (The <tt>struct stat</tt> is likely also invalid after doing so.)
      
      I notice this because I can't even start tclsh9.0 without it crashing in <tt>TclpMatchInDirectory()</tt> (tclUnixFile.c): calling <tt>TclOSstat()</tt> (<tt>stat64()</tt>) at line 312 clobbers the address stored in <tt>ds.string</tt>, and when <tt>Tcl_DStringSetLength()</tt> is called at line 380, it writes to an invalid address when doing <tt>dsPtr-&gt;string&#91;length&#93; = 0</tt> (tclUtil.c line 2808).
      
      I don't observe this issue in Tcl 8.7 ([95051c8d1e]) where <tt>TclOSstat()</tt> and <tt>Tcl_StatBuf</tt> are defined as <tt>stat64()</tt> and <tt>struct stat64</tt> respectively.
      
    5. foundin initialized to: "9.0"
    6. is_private initialized to: "0"
    7. login: "chrstphrchvz"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "chrstphrchvz"
    13. subsystem initialized to: "37. File System"
    14. title initialized to:
      Tcl 9.0 uses stat64() but not struct stat64 on Linux i686
      
    15. type initialized to: "Bug"
  2. Ticket change [d87fc87666] (rid 185636) by jan.nijtmans on 2020-08-21 10:05:55:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      See also the comments in this ticket: [https://core.tcl-lang.org/tcl/info/02b58d5d04]
      
      Tcl 9.0 should use "Implicit LFS", while Tcl 8.x uses "Explicit LFS". What's missing is the "configure" part of determining `$(getconf LFS_CFLAGS)`, `$(getconf LFS_LDFLAGS)` and `$(getconf LFS_LIBS)`.
      
      Thanks for reminding me, I know for UNIX this is not complete yet (for MacOS and Windows it is done already)
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
  3. Ticket change [0a83b0484e] (rid 185646) by jan.nijtmans on 2020-08-21 12:31:23:

    1. closedate changed to: "2459083.02179825"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Well, until the implementation of [02b58d5d04] is complete, Tcl 9 should continue to use "struct stat64" on 32-bit platforms. Should be fixed now.
      
      Thanks!
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"