threads - Strange Error: PmmREFCNT_dec: REFCNT decremented below 0!

Posted on Tue Apr 15 14:25:03 2008 by kende
Strange Error: PmmREFCNT_dec: REFCNT decremented below 0!
Hi Guys, I am using threads-1.69 with threads-shared-1.18 in my Perl program on a Linux machine. I have 3 modules x.pm, y.pm and common.pm. Both x.pm and y.pm uses the threads module therefore 'use threads;' is in common.pm. x.pm works fine but y.pm has give me some strange error message when I am trying to join the joinable threads. I read the "Making your module threadsafe" but It was not totally clear. Please give me some help or hint.

Error:
...
+Limit Reached
- 1 1
PmmREFCNT_dec: REFCNT decremented below 0! during global destruction.
...
Segmentation fault (core dumped)
...


Example code:
for(my $i=0; $i < scalar(@Hosts); $i++) { if(getThreadsNum() >= config::THREAD_NUM) { print("\n\n+Limit Reached \n"); while(getThreadsNum() >= config::THREAD_NUM) { foreach my $threadJoin (threads->list(threads::joinable)) { my @result = $threadJoin->join(); print("Join: $result[0] $result[1] \n"); } } } push @ThreadListValidate, threads->new(\&test, $i); threads->yield(); } ... etc
Gabor
Direct Responses: 7671 | Write a response