See what is to be learned from strace about this problem:
Code:
(armv6l:1) /home # strace -fF chroot /home/emd /bin/sh
* * snip the usual memory setup stuff * *
chroot("/home/emd") = 0
chdir("/") = 0
execve("/bin/sh", ["/bin/sh"], [/* 9 vars */]) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x1be} ---
+++ killed by SIGSEGV +++
Segmentation fault
(armv6l:1) /home #
Hmm...
The chroot, chdir and execve system calls all returned 0 (success).
It looks like the Ubuntu-core, /bin/sh stumbled into the mapping error segfault.
In Ubuntu-core /bin/sh is a sym-link to /bin/dash.
About the simplest compiled program in any distribution is:
Code:
int main(void) { return 0; }
Also known in public as: /bin/true.
Code:
(armv6l:1) /home # strace -fF chroot /home/emd /bin/true
* * snip the usual memory setup stuff * *
chroot("/home/emd") = 0
chdir("/") = 0
execve("/bin/true", ["/bin/true"], [/* 9 vars */]) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x1be} ---
+++ killed by SIGSEGV +++
Segmentation fault
(armv6l:1) /home #
Hmm...
That should tell me something, not sure what.
How in the world can: "return 0" cause a seg-fault?
An ABI mis-match?
Will have to investigate that possibility.