develooper Front page | perl.par | Postings from May 2008

Re: :Packer segmentation fault with threads

Thread Previous | Thread Next
Steffen Mueller
May 14, 2008 03:00
Re: :Packer segmentation fault with threads
Message ID:
Hi Scott, hi list,

Scott Stanton wrote:
> I'm not familiar with Perl's threading model.  Is it possible the END
> block is being called for each thread?  I can see how that might cause
> segfaults if a memory mapped library is moved from its original location
> while still in use.  Some platforms don't handle that very well.
> If that's the case, is there a way to ensure the library cleanup is only
> performed in the main thread after all other threads are joined?

I spent some considerable time on fixing this issue and so far, failed
to do so.

Here's what I found:
a) It's indeed a case where the END block is potentially run for each
b) There is no way to determine from within the END block whether or not
it's the last running thread.
c) I reported this as a bug in threads to Jerry Hedden. The discussion
is here:
d) This problem can not be fixed from It doesn't seem
fixable without user intervention from the side of things either.

It doesn't seem like there's any way to fix this. Personally, I'd rather
see some stale cache directories even under CLEAN mode than crashes or
funny lock-ups for all programs using threads. But that's just me. What
does everybody else think?

At the very least, we need to document this well.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About