Re: sec_powm.c:293: GNU MP assertion failed: enb >= windowsize

2018-12-30 Thread Jeffrey Walton
On Sat, Dec 29, 2018 at 9:07 PM Jeffrey Walton  wrote:
>
> On Sat, Dec 29, 2018 at 2:17 PM Jeffrey Walton  wrote:
> >
> > I'm trying to build Nettle 3.4.1 on Fedora 29, x64 (fully patched).
> > Self tests are failing at:
> >
> > PASS: rsa-sec-decrypt
> > sec_powm.c:293: GNU MP assertion failed: enb >= windowsize
> > ../run-tests: line 57: 22997 Aborted (core dumped) "$1" $testflags
> > FAIL: rsa-compute-root
> > PASS: dsa
> > PASS: dsa-keygen
> >
> > GMP is 6.1.2, which is the latest version.
>
> This is failing on Aarch64, too.

And I just duplicated with 32-bit code on Solaris. I have not been
able to test ARM A-32. GMP build is broken.

Jeff
___
nettle-bugs mailing list
nettle-bugs@lists.lysator.liu.se
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs


Re: sec_powm.c:293: GNU MP assertion failed: enb >= windowsize

2018-12-30 Thread Jeffrey Walton
On Sun, Dec 30, 2018 at 5:27 PM Niels Möller  wrote:
>
> It might also be a bug in the book-keeping of scratch space, leading to
> some memory overwrite. Try running the test program under valgrind
> and/or asan?

Hey Niels,

What is the test name and how do I run it?

Given I've built the library and the test suite, what are the next
steps? (I'm guessing cd somewhere and and valgrind ).

Jeff
___
nettle-bugs mailing list
nettle-bugs@lists.lysator.liu.se
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs


Re: sec_powm.c:293: GNU MP assertion failed: enb >= windowsize

2018-12-30 Thread Jeffrey Walton
On Sun, Dec 30, 2018 at 5:27 PM Niels Möller  wrote:
>
> Jeffrey Walton  writes:
>
> > I'm trying to build Nettle 3.4.1 on Fedora 29, x64 (fully patched).
> > Self tests are failing at:
> >
> > PASS: rsa-sec-decrypt
> > sec_powm.c:293: GNU MP assertion failed: enb >= windowsize
> > ../run-tests: line 57: 22997 Aborted (core dumped) "$1" $testflags
> > FAIL: rsa-compute-root
> > PASS: dsa
> > PASS: dsa-keygen
>
> This is an ASSERT_ALWAYS in gmp's mpn/generic/sec_powm.c, checking the
> return value from the win_size function. To debug, it would be helpful
> to know

Here are the options I used to build GMP 6.1.2 and Nettle 3.1.4. It
looks fairly easy to duplicate on 64-bit platforms.

   BUILD_BITS: 64-bits
 INSTX_PREFIX: /usr/local
 INSTX_LIBDIR: /usr/local/lib64

  PKGCONFPATH: /usr/local/lib64/pkgconfig
 CPPFLAGS: -I/usr/local/include -DNDEBUG
   CFLAGS: -g2 -O2 -march=native -fPIC
 CXXFLAGS: -g2 -O2 -march=native -fPIC
  LDFLAGS: -L/usr/local/lib64 -Wl,-R,/usr/local/lib64 -Wl,--enable-new-dtags
   LDLIBS: -ldl -lpthread

Then, I run configure. There's nothing special about what I am doing.
I'm just getting into a Release Build state.

> 1. The value of enb and windowsize at the crash.
>
> 2. The definition of POWM_SEC_TABLE (defined in the platform specific
>gmp-mparam.h), and used by the win_size function in this file.
>
> To me, it looks like the assert validates that POWM_SEC_TABLE conforms
> to expectations.
>
> It might also be a bug in the book-keeping of scratch space, leading to
> some memory overwrite. Try running the test program under valgrind
> and/or asan?

Thanks Niels.

I'll try to get to it later tonight or tomorrow.

In the meantime you might provide your test data to GMP. It looks like
it would make a good test case for them.

Jeff
___
nettle-bugs mailing list
nettle-bugs@lists.lysator.liu.se
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs


Re: sec_powm.c:293: GNU MP assertion failed: enb >= windowsize

2018-12-30 Thread Niels Möller
Jeffrey Walton  writes:

> I'm trying to build Nettle 3.4.1 on Fedora 29, x64 (fully patched).
> Self tests are failing at:
>
> PASS: rsa-sec-decrypt
> sec_powm.c:293: GNU MP assertion failed: enb >= windowsize
> ../run-tests: line 57: 22997 Aborted (core dumped) "$1" $testflags
> FAIL: rsa-compute-root
> PASS: dsa
> PASS: dsa-keygen

This is an ASSERT_ALWAYS in gmp's mpn/generic/sec_powm.c, checking the
return value from the win_size function. To debug, it would be helpful
to know

1. The value of enb and windowsize at the crash.

2. The definition of POWM_SEC_TABLE (defined in the platform specific
   gmp-mparam.h), and used by the win_size function in this file.

To me, it looks like the assert validates that POWM_SEC_TABLE confoems
to expectations.

It might also be a bug in the book-keeping of scratch space, leading to
some memory overwrite. Try running the test program under valgrind
and/or asan?

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
___
nettle-bugs mailing list
nettle-bugs@lists.lysator.liu.se
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs


Re: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode

2018-12-30 Thread Niels Möller
Jeffrey Walton  writes:

> rsa-sign-tr.c: In function ‘sec_equal’:
> rsa-sign-tr.c:243:3: error: ‘for’ loop initial declarations are only
> allowed in C99 or C11 mode
>for (size_t i = 0; i < limbs; i++)
>^
> rsa-sign-tr.c:243:3: note: use option -std=c99, -std=gnu99, -std=c11
> or -std=gnu11 to compile your code

This has been fixed in
https://git.lysator.liu.se/nettle/nettle/commit/f5a3a224bf00bef5669366d2ae23c2b2b13b8016

Not sure if there will be a bug-fix release 3.4.2, before we get till
3.5.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
___
nettle-bugs mailing list
nettle-bugs@lists.lysator.liu.se
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs