Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f1fd1bd1527061c410ae24b106abb010b12494cced66e57abd0419c8c99428f0
Ticket: 3298012fffffffffffffffffffffffffffffffff
RebuildTable failure for big dicts
User & Date: dgp on 2017-11-08 03:09:04
Changes

  1. closedate changed to: "2458065.6312977"
  2. closer changed to: "dgp"
  3. comment changed to:
    With enough time and RAM....
    
    % set count 805306368
    805306368
    % while {[incr count -1]} {
    dict set d [expr {rand()}] 0
    }
    % dict size $d
    805306367
    % llength $d
    max length of a Tcl list (536870909 elements) exceeded
    % dict set d [expr rand()] 0
    
    Program received signal SIGSEGV, Segmentation fault.
    0x0000000000507084 in RebuildTable (tablePtr=0x7ab7e0)
        at /home/dgp/64bit/tcl8.5/unix/../generic/tclHash.c:1051
    1051            *newChainPtr = NULL;
    ...
    (gdb) print tablePtr->numBuckets * sizeof(Tcl_HashEntry *)
    $3 = 0
    
    The number of buckets overflowed the int range, and the
    attempt to write beyond the end of the empty bucket array
    segfaults.  The exact dict insert at which this happens is
    a function of the hash table tuning parameters.
    
  4. login: "dgp"
  5. mimetype: "text/plain"
  6. resolution changed to: "Fixed"
  7. severity changed to: "Minor"
  8. status changed to: "Closed"