Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b82cce880b81e71a9c00fa1edddb2c2c5deac6301dbf0a6c36657d8ad42fb6fa
Ticket: 8139aa83a446e62b0102529546efdb4e03285603
tclsh wrong result in string output when built with clang
User & Date: SVIDevelopment on 2023-01-06 14:54:33
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    We built tcl 8.6.11 with clang on Linux and noticed a problem when a string was output to either the console/stdout, a pipe, or a file. This problem does not occur when the same tclsh is compiled with gcc. 
    
    If a long string (several thousands of characters) is present in a variable, and a new string is formed in double quotes with ten to twenty characters followed by the contents of the variable, then in the output the contents of the variable are overwritten at different locations, the first of which is at position 4096, by the first 12 characters of the combined string. The internal representation of the variable as well as the combined string are not overwritten when checked afterwards. 
    
    Example:
    ==== begin example ====
    $ ./tclsh8.6 
    % info patchlevel
    8.6.11
    % puts [array get ::tcl_platform]
    osVersion 5.15.0-52-generic pointerSize 8 byteOrder littleEndian threaded 1 machine x86_64 platform unix pathSeparator : os Linux engine Tcl user builder wordSize 8
    % set dotString [string repeat . 5000]
    ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
    % set x "XXXXXXXXXXXXXXXXXXXXX$dotString" 
    XXXXXXXXXXXXXXXXXXXXX...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................XXXXXXXXXXXX.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
    % string last X $x
    20
    % 
    ==== end example ====
    $ clang --version
    Ubuntu clang version 14.0.0-1ubuntu1
    Target: x86_64-pc-linux-gnu
    Thread model: posix
    InstalledDir: /usr/bin
    
    $ lsb_release -a
    No LSB modules are available.
    Distributor ID:	Ubuntu
    Description:	Ubuntu 22.04.1 LTS
    Release:	22.04
    Codename:	jammy
    
  5. foundin changed to: "8.6.11"
  6. is_private changed to: "0"
  7. login: "SVIDevelopment"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "54be8d2ecf914ca591bab8796ebb920a82b33bb2"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "SVIDevelopment"
  14. subsystem changed to: "11. Conversions from String"
  15. title changed to:
    tclsh wrong result in string output when built with clang
    
  16. type changed to: "Bug"