On Monday 27 October 2008 18:18:26 Will Coleda wrote:

> Attached is a PIR-only file (no tcl required) that triggers the same
> GC-related segfault (tested in r32210)

Fixed in r32229.  The problem is that retrieving the STRING value of a String 
Key returned that STRING directly.  Modifying its contents modifies the 
STRING in place -- and freeing that STRING frees its contents.  (In theory, 
the Key PMC's mark() entry should take care of that, but the chance of 
modifying a constant STRING's value is bad.)

I changed key_string() to return a COW string in this circumstance instead.  
That means anyone can modify the received STRING without modifying its 
parent.

I also added your code as a test case in t/pmc/key.t.

-- c

Reply via email to