Created attachment 1242291 [details]
C translation of Rust's env-funky-keys.rs
Description of problem:
Rust builds are hanging in %check on test rust-pass/env-funky-keys.
I can also hang with a similar program written in C, attached, so let's focus on that. The same binary copied to F25 runs fine.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. gcc env-funky-keys.c
The program execs and then never terminates -- never even reaches main.
The program should exec and then main should return 0.
Stepping 'next' in gdb just bounces between dl-tunables.c:86 and :90.
#0 get_next_env (val=<synthetic pointer>, namelen=<synthetic pointer>,
name=<synthetic pointer>, envp=0x7fffffffee40) at dl-tunables.c:86
#1 __tunables_init (envp=0x7fffffffee40) at dl-tunables.c:317
#2 0x00007ffff7df0d53 in _dl_sysdep_start (
dl_main=dl_main@entry=0x7ffff7dd8b10 <dl_main>) at ../elf/dl-sysdep.c:224
#3 0x00007ffff7ddc0b8 in _dl_start_final (arg=0x7fffffffee20) at rtld.c:303
#4 _dl_start (arg=0x7fffffffee20) at rtld.c:409
#5 0x00007ffff7dd7e58 in _start () from /lib64/ld-linux-x86-64.so.2
#6 0x0000000000000002 in ?? ()
#7 0x00007fffffffefa0 in ?? ()
#8 0x00007fffffffefbb in ?? ()
#9 0x0000000000000000 in ?? ()
(gdb) list 81,98
81 while (envp != NULL && *envp != NULL)
83 char *envline = *envp;
84 int len = 0;
86 while (envline[len] != '\0' && envline[len] != '=')
89 /* Just the name and no value, go to the next one. */
90 if (envline[len] == '\0')
93 *name = envline;
94 *namelen = len;
95 *val = &envline[len + 1];
97 return ++envp;
It looks to me like the continue is missing ++envp.
Looking at this right now. Thanks for the bug Josh.
Oh sorry I forgot to actually update the bug. I've got tests running with a candidate patch that I'll post upstream shortly.
(In reply to Siddhesh Poyarekar from comment #2)
> Oh sorry I forgot to actually update the bug. I've got tests running with a
> candidate patch that I'll post upstream shortly.
Awesome. Assigned to you then :-)
(In reply to Carlos O'Donell from comment #3)
> (In reply to Siddhesh Poyarekar from comment #2)
> > Oh sorry I forgot to actually update the bug. I've got tests running with a
> > candidate patch that I'll post upstream shortly.
> Awesome. Assigned to you then :-)
> Thanks Siddhesh!
- We don't need an upstream bug because this was an regression introduced during development.
- Would be nice to have a test case just to keep testing empty env var processing.
Posted patch upstream:
Patch pushed, so the next rawhide rebase should have this fix.
Confirmed in glibc-2.24.90-29.fc26, thanks!