Subject: | threading problem |
This simple program illustrates there's a problem with a Digest::SHA1
object existing in a threaded program.
use threads;
use Digest::SHA1;
my $md5 = Digest::SHA1->new;
for(1..5) {
threads->create(sub {});
}
print "All threads started\n";
$_->join for threads->list;
print "Done joining\n";
The output with both 5.10.1 and 5.12.0 on OS X is this:
perl(52714,0xa002e4e0) malloc: *** error for object 0x2059d0: pointer
being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
perl(52714,0xa002e4e0) malloc: *** error for object 0x2059d0: pointer
being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
perl(52714,0xa002e4e0) malloc: *** error for object 0x2059d0: pointer
being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
perl(52714,0xa002e4e0) malloc: *** error for object 0x2059d0: pointer
being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
perl(52714,0xa002e4e0) malloc: *** error for object 0x2059d0: pointer
being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
All threads started
Done joining