Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Math::BigInt weirdness

by zude (Scribe)
on May 10, 2004 at 21:52 UTC ( [id://352224]=perlquestion: print w/replies, xml ) Need Help??

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

Hi guys and gals, noticed a strange behaviour while working on some public key crypto routines, which I am able to reproduce as follows:

use Math::BigInt; my $E = new Math::BigInt "0xE01AFC76F0814D"; my $D = new Math::BigInt "0x956752E5F9DC53"; my $m = new Math::BigInt 2; $m->bmodpow($D, $E) while 1;
Now if I let this cook for a while, eventually certain other programs will begin to segfault:
$ man perl groff: troff: segmentation fault
ps doesn't show anything strange, like perl consuming 800MB of memory... nothing is swapping... system is not unduly slow... but if I kill or even just suspend the script, the segfaults stop happening.

I don't even understand the mechanism that could force another process to segfault, much less how to fix it. Ideas?

Thanks

Replies are listed 'Best First'.
Re: Math::BigInt weirdness
by Abigail-II (Bishop) on May 10, 2004 at 21:59 UTC
    That shouldn't happen, but it's hard to say who's to blame. I can't reproduce it. What OS are you using? What version of Perl? Can you trace the segfaulting program and determine why it's segfaulting?

    Abigail

Re: Math::BigInt weirdness
by hv (Prior) on May 11, 2004 at 01:45 UTC

    I had an intermittent problem like that a while back, which turned out to be CPU overheating due to death of fan.

    I think this is unlikely to be due to something somehow randomly overwriting memory - Unix systems simply don't work like that unless you're doing stuff in kernel space.

    Hugo

Re: Math::BigInt weirdness
by Joost (Canon) on May 10, 2004 at 22:01 UTC
      Thanks for replies.

      This is happening on staging server with RH7.3+patches, kernel 2.4.20-4/perl 5.6.1. Don't want to mess with the config too much because then I have to port it to all the production servers.

      Anyway glad it doesn't reproduce, guess I'll dig in some more...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found