[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: test-duplocale crashes
From: |
Pádraig Brady |
Subject: |
Re: test-duplocale crashes |
Date: |
Sun, 16 Oct 2016 23:06:41 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 16/10/16 19:10, Bruno Haible wrote:
> On a glibc system (glibc 2.15, Linux 3.8) I get this test failure
> from a gnulib testdir:
>
> ./../build-aux/test-driver: line 107: 6269 Segmentation fault "$@" >
> $log_file 2>&1
> FAIL: test-duplocale
>
> FAIL test-duplocale (exit status: 139)
>
> (gdb) where
> #0 0x00007ffff7a4aa6f in freelocale () from /lib/x86_64-linux-gnu/libc.so.6
> #1 0x0000000000400d36 in main () at test-duplocale.c:116
>
> The locale to be freed is NULL; this is an invalid argument to freelocale().
> It's better to fix the test in this case:
>
>
> 2016-10-16 Bruno Haible <address@hidden>
>
> Fix a test crash.
> * tests/test-duplocale.c (main): Skip the test if the 'newlocale' call
> fails.
>
> diff --git a/tests/test-duplocale.c b/tests/test-duplocale.c
> index 498e31d..667b3e2 100644
> --- a/tests/test-duplocale.c
> +++ b/tests/test-duplocale.c
> @@ -72,6 +72,11 @@ main ()
>
> /* Use a per-thread locale. */
> perthread = newlocale (LC_ALL_MASK, "es_ES.UTF-8", NULL);
> + if (perthread == NULL)
> + {
> + fprintf (stderr, "Skipping test: Spanish Unicode locale is not
> installed\n");
> + return 77;
> + }
> uselocale (perthread);
+1