Re: dietlibc broken on i386 since Feb 2018?

Felix von Leitner <[email protected]> Mon, 16 Sep 2019 04:08:41 +0200
Newsgroups gmane.linux.lib.dietlibc
Message-ID <[email protected]>
> gdb --args bin-i386/diet gcc -D__dietlibc__ -pipe -nostdinc -D_REENTRANT -ffunction-sections -fdata-s
sections -Os -fomit-frame-pointer -falign-functions=1 -falign-jumps=1 -falign-loops=1 -mpreferred-stack-boundary=4 -W -Wall -Wextra -Wc
char-subscripts -Wmissing-prototypes -Wmissing-declarations -Wno-switch -Wno-unused -Wredundant-decls -Wshadow -o bin-i386/elftrunc con
ntrib/elftrunc.c -Wl,--gc-sections -Wl,-z,noseparate-code
> GNU gdb (GDB) CentOS (7.0.1-45.el5.centos)
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i386-redhat-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /home/frank/dietlibc/bin-i386/diet...(no debugging symbols found)...done.
> (gdb) run
> Starting program: /home/frank/dietlibc/bin-i386/diet gcc -D__dietlibc__ -pipe -nostdinc -D_REENTRANT -ffunction-sections -fdata-sections -Os -fomit-frame-pointer -falign-functions=1 -falign-jumps=1 -falign-loops=1 -mpreferred-stack-boundary=4 -W -Wall -Wextra -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wno-switch -Wno-unused -Wredundant-decls -Wshadow -o bin-i386/elftrunc contrib/elftrunc.c -Wl,--gc-sections -Wl,-z,noseparate-code

> Program received signal SIGSEGV, Segmentation fault.
> 0x08049cb5 in stackgap (argc=29, argv=0xbfffd4b4, envp=0xbfffd52c, fp=0) at lib/stackgap-common.h:534
> 534	  __guard=*(unsigned long*)rand;
> (gdb) quit
> A debugging session is active.

This looks like the code works as expected.

If you want to run the binaries on an ancient kernel that does not put
the random seed in the auxvec, you need to set the #define you removed
in dietfeatures.h

It is even documented there.

What kernel are you using, if I may ask?

Felix