x86_64-w64-mingw32 test FAIL t-scanf.c:1477: GNU MP assertion failed: ret == (-1)

Claude Heiland-Allen claude at mathr.co.uk
Thu Mar 30 09:52:33 UTC 2017


Hi,

Using this source:

    https://gmplib.org/download/gmp/gmp-6.1.2.tar.lz

I compiled and then ran the test suite as advised by make install, and
got a failure.  I'm cross-compiling for Windows 64bit from Linux 64bit,
amd64 architecture.  This is what I did:

    ./configure --host=x86_64-w64-mingw32 --prefix=$HOME/win64
    make -j 8
    make install
    make check

I attached tests/misc/test-suite.log with a failure of t-scanf.c:

    t-scanf.c:1477: GNU MP assertion failed: ret == (-1)
    FAIL t-scanf.exe (exit status: 3)

The failing source code is:

  /* EOF for no matching */
  {
    char buf[128];
    ret = gmp_sscanf ("   ", "%s", buf);
    ASSERT_ALWAYS (ret == EOF);
    ret = fromstring_gmp_fscanf ("   ", "%s", buf);
    ASSERT_ALWAYS (ret == EOF);
    if (option_libc_scanf)
      {
        ret = sscanf ("   ", "%s", buf);
        ASSERT_ALWAYS (ret == EOF);
        ret = fun_fscanf ("   ", "%s", buf, NULL);
        ASSERT_ALWAYS (ret == EOF);
      }
  }

Commenting out the asserts and 'if' and inserting debugging printf()
statements gives:

    gmp_sscanf() ret = 0
    fromstring_gmp_fscanf() ret = 0
    sscanf() ret = 0
    fun_fscanf() ret = 0

(And then the test passes, so these are the only failures in that test.)

I'm using this compiler version:

    $ apt-cache policy gcc-mingw-w64-x86-64
    gcc-mingw-w64-x86-64:
      Installed: 6.3.0-10+19.2+b1
      Candidate: 6.3.0-10+19.2+b1
      Version table:
     *** 6.3.0-10+19.2+b1 500
            500 http://ftp.uk.debian.org/debian stretch/main amd64 Packages
            500 http://ftp.uk.debian.org/debian sid/main amd64 Packages
            100 /var/lib/dpkg/status

    $ x86_64-w64-mingw32-gcc --version
    x86_64-w64-mingw32-gcc (GCC) 6.3.0 20170321
    Copyright (C) 2016 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There
is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.


The whole test suite passes when compiling natively with:

    $ apt-cache policy gcc
    gcc:
      Installed: 4:6.3.0-2
      Candidate: 4:6.3.0-2
      Version table:
     *** 4:6.3.0-2 500
            500 http://ftp.uk.debian.org/debian stretch/main amd64 Packages
            500 http://ftp.uk.debian.org/debian sid/main amd64 Packages
            100 /var/lib/dpkg/status

    $ gcc --version
    gcc (Debian 6.3.0-10) 6.3.0 20170321
    Copyright (C) 2016 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There
is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

Thanks,


Claude
-- 
https://mathr.co.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-suite.log
Type: text/x-log
Size: 239 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-bugs/attachments/20170330/f51c1a07/attachment-0001.bin>


More information about the gmp-bugs mailing list