[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
segfault in gmp p-1 factorer
From: |
Alexander Kruppa |
Subject: |
segfault in gmp p-1 factorer |
Date: |
Mon, 07 May 2001 14:58:36 +0200 |
Hi,
I've written a simple P-1 factorer called gpm1. When I try to factor a
large number on a K6-3 450Mhz, the program segfaults. The segfault
occurs in mpn_sqr_basecase. The program runs fine on a P-II 400 Mhz, and
it runs fine for smaller numbers.
This is a gdb dump:
Program received signal SIGSEGV, Segmentation fault.
0x804ffe3 in __gmpn_sqr_basecase ()
(gdb) disass
Dump of assembler code for function __gmpn_sqr_basecase:
0x804ffc0 <__gmpn_sqr_basecase>: mov 0xc(%esp,1),%ecx
0x804ffc4 <__gmpn_sqr_basecase+4>: mov 0x8(%esp,1),%eax
0x804ffc8 <__gmpn_sqr_basecase+8>: cmp $0x2,%ecx
0x804ffcb <__gmpn_sqr_basecase+11>:
je 0x804ffe0 <__gmpn_sqr_basecase+32>
0x804ffcd <__gmpn_sqr_basecase+13>: mov 0x4(%esp,1),%edx
0x804ffd1 <__gmpn_sqr_basecase+17>:
ja 0x8050018 <__gmpn_sqr_basecase+88>
0x804ffd3 <__gmpn_sqr_basecase+19>: mov (%eax),%eax
0x804ffd5 <__gmpn_sqr_basecase+21>: mov %edx,%ecx
0x804ffd7 <__gmpn_sqr_basecase+23>: mul %eax,%eax
0x804ffd9 <__gmpn_sqr_basecase+25>: mov %eax,(%ecx)
0x804ffdb <__gmpn_sqr_basecase+27>: mov %edx,0x4(%ecx)
0x804ffde <__gmpn_sqr_basecase+30>: ret
0x804ffdf <__gmpn_sqr_basecase+31>: nop
0x804ffe0 <__gmpn_sqr_basecase+32>: push %ebx
0x804ffe1 <__gmpn_sqr_basecase+33>: mov %eax,%ebx
0x804ffe3 <__gmpn_sqr_basecase+35>: mov (%ebx),%eax
0x804ffe5 <__gmpn_sqr_basecase+37>: mov 0x8(%esp,1),%ecx
0x804ffe9 <__gmpn_sqr_basecase+41>: mul %eax,%eax
0x804ffeb <__gmpn_sqr_basecase+43>: mov %eax,(%ecx)
0x804ffed <__gmpn_sqr_basecase+45>: mov 0x4(%ebx),%eax
I'm including the source code of gpm1, the gmp-mparam.h, the
config.cache file
and the primegen library file that I use, as well as
r24540+.c.47142587231 which contains the number to factor.
If you want me to do some tests, or want a statically linked binary,
please email.
Ciao,
Alex.
gpm1.zip
Description: Zip archive
- segfault in gmp p-1 factorer,
Alexander Kruppa <=