Michael G Schwern via RT wrote:
I've attached the fix, and included the segfault protection afforded
by the previous patch (it now uses the nearby CROAK code path). I'm
sure that the problem will apply to at least one other piece of the
code so when I stumble across it I'll add the tests to
t/just_plain_nasty.t :-)
Looks like this patch was applied to Storable 2.10 but the bug left open.
Resolved.
This bug is caused anywhere where the PUTMARK count in the stream
mismatches the actual number of thingies dumped... which is why the
minimal test suites never found it.
I think this bug only really manifests with circular references, ie
back references in the stream, plus a bug of the above nature. So,
adding a circular reference at the "end" of each stream pointing to
some other place within the stream, and checking it still points to
the same place on the way out might be a good way to catch some more
of these.
Sam.