Skip to content
Tcl Source Code History Of Ticket 3d01d51bc45cf7c5
Login

History Of Ticket 3d01d51bc45cf7c5

Artifacts Associated With Ticket 3d01d51bc45cf7c5

  1. Ticket change [e219faca47] (rid 208663) by pointsman on 2023-02-11 00:26:24:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-plain"
    4. comment initialized to:
      This script:
      
      package require Tcl 9.0
      set fd [open large.txt w+]
      puts $fd [string repeat [string repeat [string repeat abc 1000] 1000] 1000]
      close $fd
      
      runs without sign of error.
      
      On debian 11.6 the created file large.txt has a size 1 byte (a linefeed). Seems wrong to me.
      
    5. foundin initialized to: "9.0, trunk"
    6. is_private initialized to: "0"
    7. login: "pointsman"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "4ca203a8e925aecdd9419645f936bccf18cd6ea7"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "pointsman"
    14. subsystem initialized to: "25. Channel System"
    15. title initialized to: "Tcl 9: Cannot write large strings to file"
    16. type initialized to: "Bug"
  2. Ticket change [92c707debe] (rid 209211) by apnadkarni on 2023-02-25 16:50:59:

    1. assignee changed to: "apnadkarni"
    2. icomment:
      Tcl_Size (WriteObj) -> int (Write) truncation at work again. Examining...
      
    3. login: "apnadkarni"
    4. mimetype: "text/plain"
  3. Ticket change [944446fc08] (rid 209216) by apnadkarni on 2023-02-25 17:24:46:

    1. icomment: "Proposed fix [57fb62005d]"
    2. login: "apnadkarni"
    3. mimetype: "text/x-fossil-plain"
  4. Ticket change [1f2d42b8e6] (rid 209231) by jan.nijtmans on 2023-02-26 12:44:44:

    1. icomment: "Proposed Solution is 100% OK with me. Thanks!"
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  5. Ticket change [90c5461c0c] (rid 209244) by jan.nijtmans on 2023-02-26 14:35:04:

    1. icomment:
      Build is failing on Windows:
      
      [https://github.com/tcltk/tcl/actions/runs/4274069270/jobs/7440407165]
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  6. Ticket change [e4dd54c333] (rid 209284) by apnadkarni on 2023-02-27 03:15:47:

    1. icomment:
      Added the perf constraint to prevent failures on large IO tests in limited environments like github actions.
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  7. Ticket change [295bf672c8] (rid 209290) by jan.nijtmans on 2023-02-27 12:01:27:

    1. closedate changed to: "2460003.00101183"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Fixed [186e4d93170ed65f|here]
      
      Many thanks, Ashok!
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
  8. Ticket change [24a98533c5] (rid 213727) by pointsman on 2023-04-23 23:38:20:

    1. closedate changed to: "2460058.48496203"
    2. closer changed to: "pointsman"
    3. icomment:
      The fix for[3d01d51bc4] with commit [186e4d9317] didn't really fix the problem.
      
      Look at 
      https://core.tcl-lang.org/tcl/artifact?udc=1&ln=4262-4278&name=ce11265346dd36a3
      
      In that loop the scr pointer will not be incrementend. Which means that after every INT_MAX bytes written it starts over from the start of the string instead of continuing. This explains the output of the examples given so far.
      
      An obvious fix is
      
      https://core.tcl-lang.org/tcl/artifact?udc=1&ln=4276&name=abf0f8ddf7519a1f
      
      But this raises the question what WriteChars(chanPtr, src, chunkSize) does if the chunkSize ends in the middle of a multibyte char?
      
      Some answers to that question doesn't look promissing (need a Tcl 9 tcltest to run this example script):
      
      set s [testbigdata string 0x7FFFFFFE]
      # The character to append in the next line is EM DASH, 
      # code point 0x2014 (decimal 8212, UTF-8 #xE2 #x80 #x94, 
      append s —
      set fd [open out.txt w+]
      puts $fd $s
      close $fd
      
      If I run this (on debian) I get:
      
      error writing "file6": invalid or incomplete multibyte or wide character
          while executing
      "puts $fd $s"
      
    4. login: "pointsman"
    5. mimetype: "text/plain"
  9. Ticket change [351fab4600] (rid 213728) by pointsman on 2023-04-23 23:44:35:

    1. closedate changed to: "2460058.48930185"
    2. icomment:
      [Sorry, hadn't changed from plain text to links only. For your convenience here the same again:]
      
      The fix for[3d01d51bc4] with commit [186e4d9317] didn't really fix the problem.
      
      Look at 
      [https://core.tcl-lang.org/tcl/artifact?udc=1&ln=4262-4278&name=ce11265346dd36a3]
      
      In that loop the scr pointer will not be incrementend. Which means that after every INT_MAX bytes written it starts over from the start of the string instead of continuing. This explains the output of the examples given so far.
      
      An obvious fix is
      
      https://core.tcl-lang.org/tcl/artifact?udc=1&ln=4276&name=abf0f8ddf7519a1f
      
      But this raises the question what WriteChars(chanPtr, src, chunkSize) does if the chunkSize ends in the middle of a multibyte char?
      
      Some answers to that question doesn't look promissing (need a Tcl 9 tcltest to run this example script):
      
      set s [testbigdata string 0x7FFFFFFE]
      # The character to append in the next line is EM DASH, 
      # code point 0x2014 (decimal 8212, UTF-8 #xE2 #x80 #x94, 
      append s —
      set fd [open out.txt w+]
      puts $fd $s
      close $fd
      
      If I run this (on debian) I get:
      
      error writing "file6": invalid or incomplete multibyte or wide character
          while executing
      "puts $fd $s"
      
    3. login: "pointsman"
    4. mimetype: "text/x-fossil-plain"