bsb has asked for the wisdom of the Perl Monks concerning the following question:


I've reported a bug in RT with Crypt::Random but since perl is aborting, maybe I should report it somewhere else. RT#25309

What do you think?

update: Math::Pari seems to be the problem:

perl -MMath::Pari -e "fork"
Old title: Window + fork + Crypt::Random = pain

Replies are listed 'Best First'.
Re: Window + fork + Crypt::Random = pain
by ikegami (Patriarch) on Mar 07, 2007 at 01:45 UTC

    fork doesn't really have anything to do with it. It's about threading. Keep in mind that fork creates a new *thread* in Windows, not a new *process*. The problem can be triggered more directly using:

    perl -MMath::Pari -Mthreads -e "threads->create(sub{})->join();"

    It appears that Math::Pari is not thread-safe.

      I'm using the Math::Pari ppm but it's build process seems to only use the unix source
      sub download_pari { my ($srcfile, $force) = (shift, shift); my $host = ''; my $dir = '/pub/pari/unix/'; my($ftp, $ua, $base_url); ...
      There is a windows build at which may avoid the problem although I haven't yet tried to use it.

      Thanks for your reply

        If the module isn't thread safe, a special windows build wouldn't avoid the problem.
      That also segfaults in linux.