张金政 tianchaijz at
Sun Aug 4 13:09:10 UTC 2019

Thanks for your reply. I'm using the latest GMP 6.1.2, and build it from

Build command:

cc -g -Wl,-rpath,.libs -L.libs -lgmp bug.c -o gmp_bug.out

Ldd output: (0x00007fff4c3d3000) => .libs/ (0x00007f2bb536b000) => /usr/lib/ (0x00007f2bb5183000)
        /lib64/ => /usr/lib64/

You may need run gmp_bug.out several times to reproduce a segfault.

After applying the patch, all works fine.

Thanks again!

Torbjörn Granlund <tg at> 于2019年8月3日周六 上午5:57写道:

> I cannot repro a segfault, but then I might not be using the same GMP
> release as you.  But your test case does indeed show a bug with floating
> point input in bases which are a power of two and have many leading
> zeros.
> Here is a patch:
> Please apply it and report back.
> --
> Torbjörn
> Please encrypt, key id 0xC8601622

More information about the gmp-bugs mailing list