Failing 'make check' for non-Cygwin GMP-ECM package

Mark Geisert
Sat Feb 6 09:32:00 GMT 2016

I'm seeing an odd issue after building the GMP-ECM 6.4.4 package from 
Inria.  I downloaded the .tar.gz file and unpacked, ran configure, then 
make and 'make check'.  I get a SIGSEGV from a test using ecm.exe as part 
of 'make check'.

Debugging with gdb, I see something odd and would appreciate any thoughts 
on where I should take this issue.  The faulting source line is 
mpmod.c:343 which reads:
   REDC2(rp, cp, np, nn, invm);
This macro expands to a call to __gmpn_redc_2().  That function is at an 
address above the 4GB line (this is on Win7 64-bit) as seen here:

(gdb) i func ^__gmpn_redc_2$
All functions matching regular expression "^__gmpn_redc_2$":

Non-debugging symbols:
0x00000003fcbee9e8  __gmpn_redc_2

But the instructions generated for that source line look like this:
(gdb) x/7i $rip
=> 0x1004166c0 <__ecm_mpres_get_z+240>: mov    0x10(%rdi),%rax
    0x1004166c4 <__ecm_mpres_get_z+244>: mov    %rbp,%r9
    0x1004166c7 <__ecm_mpres_get_z+247>: mov    %r13,%r8
    0x1004166ca <__ecm_mpres_get_z+250>: mov    %r12,%rcx
    0x1004166cd <__ecm_mpres_get_z+253>: mov    %rax,0x20(%rsp)
    0x1004166d2 <__ecm_mpres_get_z+258>: callq  0xfcbee9e8
    0x1004166d7 <__ecm_mpres_get_z+263>: test   %rax,%rax

Notice how the callq instruction has a truncated address.  I thought maybe 
there's an issue with displaying that instruction (unlikely I know) so I 
stepped by instruction, but no, the truncated address is actually hit:
(gdb) si
0x00000001004166c4      343       REDC2(rp, cp, np, nn, invm);
0x00000001004166c7      343       REDC2(rp, cp, np, nn, invm);
0x00000001004166ca      343       REDC2(rp, cp, np, nn, invm);
0x00000001004166cd      343       REDC2(rp, cp, np, nn, invm);
0x00000001004166d2      343       REDC2(rp, cp, np, nn, invm);
0x00000000fcbee9e8 in ?? ()
Program received signal SIGSEGV, Segmentation fault.
0x00000000fcbee9e8 in ?? ()

I'm current on all Cygwin packages such as binutils.  Does the above look 
like a linker issue or linker misuse (e.g. missing option)?  Could there 
be a mismatch of object file arch between my just-built GMP-ECM and 
Cygwin's libgmp-devel?  Or something else?  If it doesn't seem like a 
Cygwin issue I can take it upstream to Inria.
Thanks much,


Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list