Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8bf2356acd2e7e7aa73b4cd517bec8dae0f0340e8db91a1fcd0a7369b877ba7a
Ticket: 7cddd2845cab04ddeb4d735df0643eb8637a4739
Memory access crash if more than INT_MAX operands to an uncompiled command
User & Date: apnadkarni on 2023-04-13 15:03:55
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    The `{*}` expansion works (or seems to) for large lists when the script is compiled. Uncompiled scripts result in invalid memory access and a crash.
    
    ```
    % set l [list {*}[testbigdata list 0x7fffffff]]; llength $l
    2147483647 -> works
    % unset l
    % set list list
    list
    % set l [$list {*}[testbigdata list 0x7fffffff]]; llength $l
    ...crash...
    ```
    
    Number of arguments supported is limited to MAX_INT (I think) but (a) it is curious that the compiled version works but not uncompiled, and (b) rather than invalid memory, a Tcl exception should be raised or if that is not possible, a controlled Tcl_Panic rather than writes to random memory.
    
  5. foundin changed to: "9.0"
  6. is_private changed to: "0"
  7. login: "apnadkarni"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "9546e9877f1a8899e25a89082561ee694e7fb402"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "apnadkarni"
  14. subsystem changed to: "- New Builtin Commands"
  15. title changed to:
    Memory access crash - large list, expansion operator {*}, uncompiled
    
  16. type changed to: "Bug"