Hello,
just tried to reproduce this crash.
I got following call stack in gdb with original packages:
(gdb) bt
#0 0x00002b57561a5c86 in strtouq () from /lib/libc.so.6
#1 0x00002b57561a3712 in atoi () from /lib/libc.so.6
#2 0x000000000045f5fe in dgettext ()
#3 0x0000000000405778 in __libc_start_main ()
When rebuilding just noshell:
(gdb) bt
#0 0x00002ad26562fc86 in strtouq () from /lib/libc.so.6
#1 0x00002ad26562d712 in atoi () from /lib/libc.so.6
#2 0x000000000045f67e in main (argc=5, argv=0x7fff456d13f8, envp=0x7fff456d1428) at runas.c:98
When even rebuilding glibc:
Program received signal SIGSEGV, Segmentation fault.
*__GI_____strtol_l_internal (nptr=0x7fff0a04fee6 "1000", endptr=0x0, base=10, group=0, loc=0x0) at ../sysdeps/generic/strtol_l.c:239
239 struct locale_data *current = loc->__locales[LC_NUMERIC];
(gdb) bt
#0 *__GI_____strtol_l_internal (nptr=0x7fff0a04fee6 "1000", endptr=0x0, base=10, group=0, loc=0x0) at ../sysdeps/generic/strtol_l.c:239
#1 0x00002ac5a0cae712 in atoi (nptr=0x7fff0a04fee6 "1000") at ../stdlib/stdlib.h:333
#2 0x000000000045f67e in main (argc=5, argv=0x7fff0a04dd78, envp=0x7fff0a04dda8) at runas.c:98
It might be related to the link command:
gcc -o runas /usr/lib/libc.a -dn stubs.o runas.o
The link command seems to do dynamic linking but /usr/lib/libc.a seems
to be the static library judging from the size.
So either command produces an working executable:
gcc -static -o runas /usr/lib/libc.a -dn stubs.o runas.o
gcc -o runas /usr/lib/libc_nonshared.a -dn stubs.o runas.o
gcc -o runas -dn stubs.o runas.o
At least Squeeze contains a Makefile.linux that got
the "/usr/lib/libc.a" commented out [1] [2].
So this bug can probably be marked as done.
Kind regards,
Bernhard
[1] https://sources.debian.org/src/titantools/4.0.11-4/Makefile.linux/
[2] https://sources.debian.org/src/titantools/4.0.11+notdfsg1-2/Makefile.linux/
PS.: Was fun, but is there no automatic bug closing when the
release, the bug got reported against, is getting unsupported?