I agree that with threads in use, we cannot do the cleanup with END since it hoses things. Leaving temp directories lying around isn't acceptable either, since you can quickly fill up /tmp that way. I think the windows approach of having the bootstrap process take care of cleaning things up is safer and avoids all of the threading issues. We could eliminate the need for the END block completely.
--Scott P.S. I've got a number of uncommitted fixes that I don't have time to integrate right now. I've attached the patch list so you can take a look. The fixes for the cleanup code are worth looking at if you are working on this stuff now. We're using these patches in our production code and it seems reasonably stable, although we're not using threads. -----Original Message----- From: Steffen Mueller [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 14, 2008 3:00 AM To: Scott Stanton Cc: par@perl.org Subject: Re: :Packer segmentation fault with threads 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 thread. 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: http://rt.cpan.org//Ticket/Display.html?id=35836 d) This problem can not be fixed from threads.pm. It doesn't seem fixable without user intervention from the PAR.pm 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. Cheers, Steffen
diffs
Description: diffs