[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strerror() sets errno to ENOMEM unexpectedly on cross builds with gl
From: |
Tim Rühsen |
Subject: |
Re: strerror() sets errno to ENOMEM unexpectedly on cross builds with glibc 2.28 |
Date: |
Tue, 18 Dec 2018 15:00:54 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
On 12/18/18 1:30 PM, Tim Rühsen wrote:
> Hi,
>
> at GnuTLS we recently see Debian cross builds failing due to the issue
> described in the email subject.
>
> I can't find code in gnulib's strerror.c or strerror-override.c.
>
> But a stand-alone test calling libc's strerror(-3) without gnulib leaves
> errno at 0.
>
> $ cat gl/tests/test-strerror.log
> ../../../gl/tests/test-strerror.c:72: assertion 'errno == 0 || errno ==
> EINVAL' failed
> qemu: uncaught target signal 6 (Aborted) - core dumped
> FAIL test-strerror (exit status: 134)
>
>
> Maybe someone has an idea what is going on ?
After some more testing, I can reproduce with the following
$ arm-linux-gnueabihf-gcc -Wall -Wextra x.c -o x
$ ./x
errno=12, msg=Unknown error -3
$ cat x.c
#include <stdio.h>
#include <string.h>
#include <errno.h>
int main(void)
{
errno=0;
char *msg=strerror(-3);
printf("errno=%d, msg=%s\n",errno,msg);
return 0;
}
I will file a bug on the Debian bugtracker.
Regards, Tim
signature.asc
Description: OpenPGP digital signature