Subject: kern/35799: Recent Linux binaries won't run with COMPAT_LINUX anymore
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <ndehne@gmail.com>
List: netbsd-bugs
Date: 02/23/2007 08:50:00
>Number:         35799
>Category:       kern
>Synopsis:       Recent Linux binaries won't run with COMPAT_LINUX anymore
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 23 08:50:00 +0000 2007
>Originator:     Nino Dehne
>Release:        4.0_BETA2
>Organization:
>Environment:
NetBSD [...] 4.0_BETA2 NetBSD 4.0_BETA2 (CHARON.MPACPI-2007012502) #0: Sun Feb 18 02:27:14 CET 2007  root@[...]:/tmp/charon/x/s/n/netbsd-4/src/sys/arch/i386/compile/CHARON.MPACPI i386

>Description:
Running recent (static) Linux binaries gives:

$ ./rar_static
FATAL: kernel too old
zsh: segmentation fault  ./rar_static
$ _

# sysctl -w emul.linux.kern.osrelease=2.6.20
emul.linux.kern.osrelease: 2.4.18 -> 2.6.20
# _

$ ./rar_static
set_thread_area failed when setting up thread-local storage
zsh: segmentation fault  ./rar_static
$ _

 10061      1 ktruss   EMUL  "netbsd"
 10061      1 ktruss   CALL  execve(0xbfbfe93f,0xbfbfe864,0xbfbfe86c)
 10061      1 ktruss   NAMI  "./rar_static"
 10061      1 rar_static EMUL  "linux"
 10061      1 rar_static RET   execve -1 errno -2 No such file or directory
 10061      1 rar_static CALL  uname(0xbfbfe616)
 10061      1 rar_static RET   uname 0
 10061      1 rar_static CALL  brk(0)
 10061      1 rar_static RET   brk 135434240/0x8129000
 10061      1 rar_static CALL  brk(0x8129c60)
 10061      1 rar_static RET   brk 135437408/0x8129c60
 10061      1 rar_static CALL  #243 (unimplemented set_thread_area)
 10061      1 rar_static RET   #243 (unimplemented set_thread_area) -1 errno -38 Too many processes
 10061      1 rar_static CALL  open(0x80f74a7,0x902,0)
 10061      1 rar_static NAMI  "/emul/linux/dev/tty"
 10061      1 rar_static NAMI  "/dev/tty"
 10061      1 rar_static RET   open 3
 10061      1 rar_static CALL  writev(3,0xbfbfe040,1)
 10061      1 rar_static GIO   fd 3 wrote 60 bytes
       "set_thread_area failed when setting up thread-local storage
       "
 10061      1 rar_static RET   writev 60/0x3c
 10061      1 rar_static PSIG  SIGSEGV SIG_DFL


The same is happening with e.g. the FLAC 1.1.3 binary.
>How-To-Repeat:
Run a Linux binary that includes or is linked against glibc 2.4.
>Fix:
Please.