Skip Menu |
 

This queue is for tickets about the Compress-Raw-Zlib CPAN distribution.

Report information
The Basics
Id: 102110
Status: open
Priority: 0/
Queue: Compress-Raw-Zlib

People
Owner: Nobody in particular
Requestors: anall [...] andreanall.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.068
Fixed in: (no value)



Subject: Library is not 100% threadsafe
Download (untitled) / with headers
text/plain 630b
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.
Download (untitled) / with headers
text/plain 1001b
On Fri Feb 13 14:11:35 2015, anall wrote: Show quoted text
> 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.
Thanks for the bug report. The trick with this one is to decide which thread "owns" the Compress::Raw::Zlib::Deflate object (and is the one that ends up eventually destroying it). Think some other modules have a way of explicitly setting the ownership. Will investigate.. cheers Paul


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.