Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 562722 - =dev-libs/gmp-6.0.0a fails test t-scanf on uclibc
Summary: =dev-libs/gmp-6.0.0a fails test t-scanf on uclibc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-10 12:35 UTC by René Rhéaume
Modified: 2015-10-16 19:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
gmp-6.0.0a-uclibc-tests.diff (gmp-6.0.0a-uclibc-tests.diff,467 bytes, patch)
2015-10-10 12:38 UTC, René Rhéaume
Details | Diff
build.log from emerge (build.log,408.72 KB, text/plain)
2015-10-11 14:51 UTC, René Rhéaume
Details
emerge --info output (emerge-info.txt,5.99 KB, text/plain)
2015-10-11 14:52 UTC, René Rhéaume
Details

Note You need to log in before you can comment on or make changes to this bug.
Description René Rhéaume 2015-10-10 12:35:53 UTC
On uclibc systems, a few cases for the t-scanf test are GLIBC-specific. However, the __GLIBC__ token is also defined on uclibc and will make tests failres on that platform.

Reproducible: Always

Steps to Reproduce:
1. FEATURES="test" emerge -1 gmp
2.
3.
Actual Results:  
emake failed (test phase)

Expected Results:  
gmp updated on system
Comment 1 René Rhéaume 2015-10-10 12:38:33 UTC
Created attachment 414248 [details, diff]
gmp-6.0.0a-uclibc-tests.diff

No ebuild patch is needed if you put this source code patch into ${FILESDIR}/6.0.0a
Comment 2 Michael Palimaka (kensington) gentoo-dev 2015-10-11 07:12:42 UTC
Please include emerge --info and the failing build log too.
Comment 3 René Rhéaume 2015-10-11 14:51:36 UTC
Created attachment 414350 [details]
build.log from emerge
Comment 4 René Rhéaume 2015-10-11 14:52:51 UTC
Created attachment 414352 [details]
emerge --info output
Comment 5 Anthony Basile gentoo-dev 2015-10-12 00:06:43 UTC
Rene, I wasn't able to hit this with uclibc-0.9.33.2-r15.  you're using -r4.  i know there have been upstream uclibc commits to fix some scanf stuff.  i'll take a look.

you can upgrade uclibc on your system, just be careful that it uses the same config file.  -r4 is a bit old now and has some bugs that will affect e2fsprogs.
Comment 6 Anthony Basile gentoo-dev 2015-10-12 00:54:38 UTC
Rene, can you try test the following program.  See if it fails any assertions.

#include <stdio.h>
#include <assert.h>

int main()
{
    char  buf[128];
    int   n = -1;
    int   ret, cmp;
    buf[0] = '\0';

    ret = sscanf ("abcdefgh", "%[a-d]ef%n", buf, &n);
    assert (ret == 1);
    cmp = strcmp (buf, "abcd");
    assert (cmp == 0);
    assert (n == 6);

    ret = sscanf ("xyza", "%[^a]a%n", buf, &n);
    assert (ret == 1);
    cmp = strcmp (buf, "xyz");
    assert (cmp == 0);
    assert (n == 4);

    ret = sscanf ("ab]ab]", "%[]ab]%n", buf, &n);
    assert (ret == 1);
    cmp = strcmp (buf, "ab]ab]");
    assert (cmp == 0);
    assert (n == 6);

    ret = sscanf ("xyzb", "%[^]ab]b%n", buf, &n);
    assert (ret == 1);
    cmp = strcmp (buf, "xyz");
    assert (cmp == 0);
    assert (n == 4);
}
Comment 7 René Rhéaume 2015-10-16 11:08:54 UTC
(In reply to Anthony Basile from comment #6)
> Rene, can you try test the following program.  See if it fails any
> assertions.
> 
With uclibc-0.9.33.2-r4, I get this on standard error:
./test-scanf: test-scanf.c: 14: main: Assertion `cmp == 0' failed.

With uclibc-0.9.33.2-r15, this error does not happen.
Comment 8 René Rhéaume 2015-10-16 11:10:35 UTC
Also, on uclibc-0.9.33.2-r15, test suite succeeds without patching.
Comment 9 Anthony Basile gentoo-dev 2015-10-16 19:16:26 UTC
(In reply to René Rhéaume from comment #8)
> Also, on uclibc-0.9.33.2-r15, test suite succeeds without patching.

yep this was fixed and mike backported the patch.