Nuno Silva wrote: [...] > > I've been doing some tests and I'd say that the problem is something > regarding the NPTL+TLS+__thread features of recent libc6 (2.3.2 and > 2.3.3cvs)... But I'm clueless about the fix :-) > > I'll setup a chroot where I can play around with glibc setups. > OK, just finished the chroot: debian unstable with glibc-2.3.3cvs hand-compiled (../libc/configure --with-tls --with-__thread --enable-add-ons=nptl --prefix=/ --enable-kernel=2.6.0) and removed the debian's libc. Everything runs OK with the new glibc, tested: bash, apt-get, perl, mc, strace, gcc, etc. However linux (UML's executable) doesn't run: puma:/uml# ls -la /proc/mm --w--w--w- 1 root root 0 Jan 6 08:33 /proc/mm puma:/uml# uname -a Linux puma 2.6.0 #2 Mon Jan 5 09:25:45 WET 2004 i686 unknown unknown GNU/Linux puma:/uml# ./linux Checking for the skas3 patch in the host...found Checking for /proc/mm...found [1]+ Stopped ./linux puma:/uml# fg ./linux Segmentation fault puma:/uml# Now with strace: (see attached file) Now with gdb: puma:/uml# gdb ./linux GNU gdb 6.0-debian Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-linux"... (gdb) run Starting program: /uml/linux Detaching after fork from child process 26378. Checking for the skas3 patch in the host...found Checking for /proc/mm...found Detaching after fork from child process 26379. Program received signal SIGSTOP, Stopped (signal). 0x400f18dc in clone () from /lib/libc.so.6 (gdb) bt #0 0x400f18dc in clone () from /lib/libc.so.6 #1 0x4014f000 in ?? () #2 0x00000007 in ?? () #3 0x00001000 in ?? () #4 0xa00a7b7f in start_userspace (cpu=26379) at process.c:113 #5 0xa00a88e2 in start_uml_skas () at process_kern.c:162 #6 0xa00a6bcb in linux_main (argc=0, argv=0xa0000000) at um_arch.c:387 #7 0xa000de0e in main (argc=1, argv=0xbffffa44, envp=0xbffffa4c) at arch/um/main.c:146 (gdb) cont Continuing. Program received signal SIGSTOP, Stopped (signal). 0x400f18dc in clone () from /lib/libc.so.6 (gdb) bt #0 0x400f18dc in clone () from /lib/libc.so.6 #1 0x4014f000 in ?? () #2 0x00000007 in ?? () #3 0x00001000 in ?? () #4 0xa00a7b7f in start_userspace (cpu=26379) at process.c:113 #5 0xa00a88e2 in start_uml_skas () at process_kern.c:162 #6 0xa00a6bcb in linux_main (argc=0, argv=0xa0000000) at um_arch.c:387 #7 0xa000de0e in main (argc=1, argv=0xbffffa44, envp=0xbffffa4c) at arch/um/main.c:146 (gdb) cont Continuing. Program received signal SIGSEGV, Segmentation fault. 0xa001305a in panic (fmt=0xbfffc000 "") at panic.c:67 67 panic.c: No such file or directory. in panic.c (gdb) bt #0 0xa001305a in panic (fmt=0xbfffc000 "") at panic.c:67 #1 0xa00a7bdd in start_userspace (cpu=-1073758208) at process.c:127 #2 0xa00a88e2 in start_uml_skas () at process_kern.c:162 #3 0xa00a6bcb in linux_main (argc=0, argv=0xa0000000) at um_arch.c:387 #4 0xa000de0e in main (argc=1, argv=0xbffffa44, envp=0xbffffa4c) at arch/um/main.c:146 (gdb) cont Continuing. Program terminated with signal SIGSEGV, Segmentation fault. The program no longer exists. (gdb) quit puma:/uml# In my tree, arch/um/kernel/skas/process.c:113 is the pid=clone(..., in void start_userspace(int cpu) { void *stack; unsigned long sp; int pid, status, n; stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if(stack == MAP_FAILED) panic("start_userspace : mmap failed, errno = %d", errno); sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *); pid = clone(userspace_tramp, (void *) sp, CLONE_FILES | CLONE_VM | SIGCHLD, NULL); I hope this makes sense to someone because I'm off to sleep a few hours :-) Regards, Nuno Silva