use WWW::Curl::Multi;
my $x = WWW::Curl::Multi->new();
if (fork == 0) {
#Do stuff NOT related to WWW::Curl here..
print STDERR "thread sleeping\n";
sleep 1;
print STDERR "thread exiting\n";
exit;
}
print STDERR "main sleeping\n";
sleep 3;
print STDERR "main exiting\n";
exit 0;
####
main sleeping
thread sleeping
thread exiting
Free to wrong pool 249ea0 not 241ba8 at testcrash.pl line 9.
wine: Unhandled page fault on write access to 0x00000000 at address 0x713c9106 (thread 0031), starting debugger...
####
use threads;
use WWW::Curl::Easy;
my $x = WWW::Curl::Easy->new();
my $t = threads->create(sub{
print STDERR "thread sleeping\n";
#Do stuff NOT related to WWW::Curl
sleep 1;
print STDERR "thread exiting\n";
});
print STDERR "main sleeping\n";
sleep 3;
$t->join();
print STDERR "main exiting\n";
exit 0;
####
[New Thread 0x7ffff1689700 (LWP 12664)]
main sleeping
thread sleeping
thread exiting
[Thread 0x7ffff1689700 (LWP 12664) exited]
main exiting
Program received signal SIGSEGV, Segmentation fault.
0x0000003f3fe39d63 in Curl_splay () from /lib64/libcurl.so.4
####
use threads;
use threads::shared;
...
share($x);