Subject: | Library is not 100% threadsafe |
One-liner reproduction case:
perl -e 'use Compress::Raw::Zlib; use threads; my $x = new Compress::Raw::Zlib::Deflate(); threads->new(sub {})->join()'
Causes the error: *** Error in `perl': double free or corruption (!prev): 0x0000000000764df0 ***
This seems to be because the Compress::Raw::Zlib::Deflate object gets cloned to the new thread with the same pointer.
I am unsure how to go about fixing this. The easiest method would be adding "sub CLONE_SKIP { 1; }" to all packages. -- This will not actually *solve* the problem, but would at least prevent the crash at the cost of the cloned objects being undef.
Thank you.