On Sun, 12 Apr 2020, Rob Landley wrote:
2) THEN the problem was that gcc is doing something in cd_main so that the "chdir ." at the start of the shell setup (to set $PWD and friends) is segfaulting, but it's a segfault that went away when I got near it with printf() calls, and even write(1, "", 0); right before it made it go away. Given that this code has run on 32 and 64 bit, big and little endian, glibc musl and bionic, and on a target that's both nommu and cares about alignment?
Are you sure that "gcc is doing something [wrong]"? Do you think it could be a QEMU bug? Can you provide some information about your tool chain?
Because I'm still halfway through teaching toysh about all the ${} constructs. (Also, remind me to stick echo -e '\e[?7h' at the start of my init script to undo the STUPID wordwrap disable escape that qemu's bios outputs, which screws up bash's command line history too!)
How awful. It baffles me every time bash manages to mishandle unprintable output from a command such that it somehow becomes command line input which bash then attempts to execute! I wish I knew how to prevent that.