Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Window + fork + Math::Pari = pain

by bsb (Priest)
on Mar 06, 2007 at 23:00 UTC ( [id://603528]=perlquestion: print w/replies, xml ) Need Help??

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

Hello,

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 PariBuild.pm
      sub download_pari { my ($srcfile, $force) = (shift, shift); my $host = 'megrez.math.u-bordeaux.fr'; my $dir = '/pub/pari/unix/'; my($ftp, $ua, $base_url); ...
      There is a windows build at ftp://megrez.math.u-bordeaux.fr/pub/pari/windows/ 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://603528]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-19 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found