On 27 February 2012 15:16, Bernhard M. Wiedemann <bwiedem...@suse.de> wrote: > I found that running a debian arm5 bash with qemu runs into varying > problems with -R but works without.
So I had a look at this this afternoon, and what seems to be happening is that with -R, the call to target_mmap() in elfload.c:setup_arg_pages() (which creates the stack) is putting the stack immediately after the bash BSS segment in the address space. This means that brk() will never be able to expand, and it looks like something in either bash or libc's locale code isn't correctly handling the failure, so we crash. (The segfault is from a strlen(NULL) from setlocale() I think.) We should probably try to put the stack somewhere more sensible than where it currently ends up... -- PMM