Skip to content
Tcl Source Code History Of Ticket 1943546fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1943546fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1943546fffffffffffffffffffffffffffffffff

  1. Ticket change [03048701cc] (rid 119748) by kaitzschu on 2008-04-16 01:09:28:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Confirmed on Fedora Core 7, OpenSuse 10.2, Windows 2000 and XP.
      
      When running attached script it emits quite a few blankish lines and after that spits out
      
      error writing "stdout": invalid argument
      
      without any apparent reason. And stdout is still writable. In comp.lang.tcl Twylite figured out that [$t get ...] returns not-quite-empty value 0xC3 and considered "some sort of encoding problem" being there.
      
      Drawing widget or changing length of sample text changes snippets behavior, selected category is mostly a guess.
      
      Expected behavior: not giving me errors, naturally .)
      
    4. foundin initialized to: "obsolete: 8.5.2"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "kaitzschu"
    10. subsystem initialized to: "24. Channel Commands"
    11. title initialized to: "Strangely failing [puts]"
    12. type initialized to: "Bug"
  2. Ticket change [41aafd4d12] (rid 116231) by kaitzschu on 2008-04-16 08:09:28:

    1. icomment:
      
      
      File Added - 274716: pitsana.tk
      
      
      
    2. login: "kaitzschu"
    3. mimetype: "text/plain"
    4. username: "kaitzschu"
  3. Add attachment "pitsana.tk" [50d696f134] (rid 126042) by kaitzschu on 2008-04-16 08:09:28.

  4. Ticket change [a88c2555fe] (rid 99014) by andreas_kupries on 2008-04-17 00:22:50:

    1. icomment:
      Logged In: YES 
      user_id=75003
      Originator: NO
      
      Testing this on Linux (SuSe 9), confirmed.
      
      Notes:
      * Adding a \t to the puts seems to prevent the error, but also seems to cause an infinite loop.
      * Printing information in a separate puts has no influence on either, allowing us to monitor the various variables.
      * Adding \t does cause infinite loop, with $i reaching '2.0' and then staying there forever.
      * Without the \t the reported error occurs when $i is 1.63. This seems to coincide with the a-umlaut character (The char after 'pitki').
      
      ... It seems that the infinite loop is just a bad end condition
      ... xi = 1.0, 'xi display lineend' comes back as 1.0 as well, and that value is never reached by the loop (starts at 1.82, drops to 1.1, then increments to either 1.63 for error, or 2.0 without).
      
      * I managed to reduce the string, use 'M a-umlaut u', i.e. just 3 chars, and that is good enough. Having the a-umlaut as first char, or only two chars, i.e. without u makes the problem go away.
      
      I am suspecting that it is less in puts, and more something in the text widget creating a bad internal string.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  5. Ticket change [8f8f26d0fd] (rid 120292) by nobody on 2008-08-16 09:24:48:

    1. icomment:
      Logged In: NO 
      
      With the current Tcl/Tk HEAD as of today:
      
      There may be 2 bugs here.  1 seems to be that the TkTextIndex (both of them for the [.t get]) ->linePtr are the same for every iteration, and the other is that the byteIndex advances when it's supposed to be a display line advancement.
      
      I added this to just before the TextGetText() call in the TEXT_GET path:
      printf("index1Ptr->linePtr %p index1Ptr->byteIndex %d\n", (void *)index1Ptr->linePtr, index1Ptr->byteIndex);
      printf("index2Ptr->linePtr %p index2Ptr->byteIndex %d\n", (void *)index2Ptr->linePtr, index2Ptr->byteIndex); 
      
      ...
      Tcl_Obj *get = TextGetText(textPtr, index1Ptr, index2Ptr, visible);
      
      Then I added this bit of code:  
       {
       char *p;
       int len;
       p = Tcl_GetStringFromObj(get, &len);
       printf("length %d\n%s\n", len, p);
       printf("p[0] = %x\n", p[0] & 0xff);
       } 
      
       index1Ptr->linePtr 0x820aca0 index1Ptr->byteIndex 63
       index2Ptr->linePtr 0x820aca0 index2Ptr->byteIndex 63
      
       index1Ptr->linePtr 0x820aca0 index1Ptr->byteIndex 64
       index2Ptr->linePtr 0x820aca0 index2Ptr->byteIndex 65 
       length 1 
      
       p[0] = c3 
      
      That's the only point that it has a byteIndex > 0, and that's when it produces the error in the puts path.  From what I've read 0xc3 is not a valid UTF-8 character.  0xC3,0x83 on the other hand might be.  I'm not sure whether the bug is in GetIndex of the text widget (which returns the invalid byteIndex) or TextGetText -- they both may have bugs.
      
      
      
    2. login: "[email protected]"
    3. mimetype: "text/plain"
    4. username: "[email protected]"
  6. Ticket change [a2ead7adf9] (rid 259002) by serhiy.storchaka on 2026-10-18 12:58:57:

    1. icomment:
      This is a Tk text widget bug: <tt>display lineend</tt> can land inside a multi-byte character, so <nowiki>[.t get]</nowiki> returns the lone first byte of "รค" and <nowiki>[puts]</nowiki> fails. Moved to the Tk tracker as [https://core.tcl-lang.org/tk/tktview/18f35ed566|18f35ed566], with a smaller reproducer. The script attached here no longer fails with the current branches, since Tk [https://core.tcl-lang.org/tk/tktview/7d8d10e4a9|7d8d10e4a9] lays out an unmapped text widget at its requested size, but the bug itself remains.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
  7. Ticket change [e9a4b3fea2] (rid 259003) by serhiy.storchaka on 2026-10-18 12:58:57:

    1. login: "serhiy.storchaka"
    2. resolution changed to: "Duplicate"
    3. status changed to: "Closed"
  8. Ticket change [44da5273c4] (rid 259958) by serhiy.storchaka on 2026-10-22 17:19:27:

    1. closedate changed to: "2461332.0409414005"
    2. closer changed to: "serhiy.storchaka"
    3. login: "serhiy.storchaka"