Tcl Source Code

Ticket Change Details
Login
Overview

Artifact ID: 59156f2f06e356657cf6eba8eeb00feb0e3b226e
Ticket: 82e7f673254fd008222f542bde322a0ebb856e3d
SIGSEGV due to [string replace]
User & Date: anonymous 2014-04-30 01:11:06
Changes

  1. icomment:
    apply {{} {
      set a [join {a b} {}]
      puts [string length [string replace ___! 0 2 $a]]  ;# doesn't crash
      puts [string length [string replace ___! 0 2 $a[unset a]]]  ;# crashes
    }}
    
    it looks like it can happen when the replacement is unshared (suggesting it's trying to edit in place?)
    
    possible cause at tclExecute.c:5705 - the only way into that block is when value3Ptr is unshared, then it's used as the result, and the refcount is subsequently decremented, and the result obj gets freed.
    
  2. login: "anonymous"
  3. mimetype: "text/plain"