Re: broken linuxulator in -current as of Jan 8 17:51:45 CET

From: Alexander Leidinger <Alexander_at_Leidinger.net>
Date: Tue, 9 Jan 2007 20:46:04 +0100
Quoting Alexander Leidinger <Alexander_at_Leidinger.net> (Mon, 8 Jan 2007 21:08:13 +0100):

> The question is: why does it try to load the FreeBSD one, when open
> does not error out with the linux one. This is not something which
> happens in the kernel, the linux syscalls seem to work just fine.
> 
> Linux kdump:
> ---snip---
>  97935 ls       CALL  linux_open(0xbfbfdd60,0,0)
>  97935 ls       NAMI  "/compat/linux/lib/tls/librt.so.1"
>  97935 ls       NAMI  "/lib/tls/librt.so.1"
>  97935 ls       RET   linux_open JUSTRETURN
>  97935 ls       CALL  linux_open(0xbfbfdd60,0,0)
>  97935 ls       NAMI  "/compat/linux/lib/librt.so.1"
>  97935 ls       NAMI  "/compat/linux"
>  97935 ls       NAMI  "/compat/linux/lib/librt.so.1"
>  97935 ls       RET   linux_open 3
>  97935 ls       CALL  read(0x3,0xbfbfde8c,0x200)
>  97935 ls       GIO   fd 3 read 512 bytes
> [linux ELF binary]
>  97935 ls       RET   read 512/0x200
>  97935 ls       CALL  close(0x3)
>  97935 ls       RET   close 0
>  97935 ls       CALL  linux_open(0xbfbfdd60,0,0)
>  97935 ls       NAMI  "/compat/linux/usr/lib/tls/librt.so.1"
>  97935 ls       NAMI  "/usr/lib/tls/librt.so.1"
>  97935 ls       RET   linux_open JUSTRETURN
>  97935 ls       CALL  linux_open(0xbfbfdd60,0,0)
>  97935 ls       NAMI  "/compat/linux/usr/lib/librt.so.1"
>  97935 ls       NAMI  "/usr/lib/librt.so.1"
>  97935 ls       RET   linux_open 3
>  97935 ls       CALL  read(0x3,0xbfbfde8c,0x200)
>  97935 ls       GIO   fd 3 read 512 bytes
> [FreeBSD ELF binary]
> ---snip---

I did a "ktrace -i chroot /comapt/linux /bin/ls":
---snip---
 73503 chroot   NAMI  "/bin/ls"
 73503 chroot   NAMI  "/compat/linux/lib/ld-linux.so.2"
 73503 chroot   NAMI  "/lib/ld-linux.so.2"
 73503 ls       RET   linux_olduname 0
 73503 ls       CALL  linux_brk(0)
 73503 ls       RET   linux_brk 134602752/0x805e000
 73503 ls       CALL  linux_newuname(0xbfbfe38e)
 73503 ls       RET   linux_newuname 0
 73503 ls       CALL  linux_access(0x28072564,0x4)
 73503 ls       NAMI  "/compat/linux/etc/ld.so.preload"
 73503 ls       NAMI  "/etc/ld.so.preload"
 73503 ls       RET   linux_access JUSTRETURN
 73503 ls       CALL  linux_open(0x28074603,0,0x1)
 73503 ls       NAMI  "/compat/linux/etc/ld.so.cache"
 73503 ls       NAMI  "/etc/ld.so.cache"
 73503 ls       RET   linux_open 3
 73503 ls       CALL  linux_fstat64(0x3,0xbfbfdc70,0x28076fc4)
 73503 ls       RET   linux_fstat64 0
 73503 ls       CALL  linux_mmap(0xbfbfdc54)
 73503 ls       RET   linux_mmap 671580160/0x28078000
 73503 ls       CALL  close(0x3)
 73503 ls       RET   close 0
 73503 ls       CALL  linux_open(0xbfbfdc70,0,0)
 73503 ls       NAMI  "/compat/linux/lib/tls/librt.so.1"
 73503 ls       NAMI  "/lib/tls/librt.so.1"
 73503 ls       RET   linux_open JUSTRETURN
 73503 ls       CALL  linux_open(0xbfbfdc70,0,0)
 73503 ls       NAMI  "/compat/linux/lib/librt.so.1"
 73503 ls       NAMI  "/lib/librt.so.1"
 73503 ls       RET   linux_open 3
 73503 ls       CALL  read(0x3,0xbfbfdd9c,0x200)
 73503 ls       GIO   fd 3 read 512 bytes
[binary data]
 73503 ls       RET   read 512/0x200
 73503 ls       CALL  close(0x3)
 73503 ls       RET   close 0
 73503 ls       CALL  linux_open(0xbfbfdc70,0,0)
 73503 ls       NAMI  "/compat/linux/usr/lib/tls/librt.so.1"
 73503 ls       NAMI  "/usr/lib/tls/librt.so.1"
 73503 ls       RET   linux_open JUSTRETURN
 73503 ls       CALL  linux_open(0xbfbfdc70,0,0)
 73503 ls       NAMI  "/compat/linux/usr/lib/librt.so.1"
 73503 ls       NAMI  "/usr/lib/librt.so.1"
 73503 ls       RET   linux_open JUSTRETURN
 73503 ls       CALL  linux_open(0xbfbfdc70,0,0)
 73503 ls       NAMI
"/compat/linux/lib/obsolete/linuxthreads/tls/librt.so.1"
 73503 ls       NAMI  "/lib/obsolete/linuxthreads/tls/librt.so.1"
 73503 ls       RET   linux_open JUSTRETURN
 73503 ls       CALL  linux_open(0xbfbfdc70,0,0)
 73503 ls       NAMI
"/compat/linux/lib/obsolete/linuxthreads/librt.so.1"
 73503 ls       NAMI  "/lib/obsolete/linuxthreads/librt.so.1"
 73503 ls       RET   linux_open 3
 73503 ls       CALL  read(0x3,0xbfbfdd9c,0x200)
 73503 ls       GIO   fd 3 read 512 bytes
[binary data]
 73503 ls       RET   read 512/0x200
 73503 ls       CALL  linux_fstat64(0x3,0xbfbfdccc,0x28076fc4)
 73503 ls       RET   linux_fstat64 0
 73503 ls       CALL  linux_mmap(0xbfbfdb3c)
 73503 ls       RET   linux_mmap 671596544/0x2807c000
 73503 ls       CALL  linux_mmap(0xbfbfdb3c)
 73503 ls       RET   linux_mmap 671625216/0x28083000
 73503 ls       CALL  linux_mmap(0xbfbfdb3c)
 73503 ls       RET   linux_mmap 671633408/0x28085000
 73503 ls       CALL  close(0x3)
 73503 ls       RET   close 0
 73503 ls       CALL  linux_open(0x2807aa17,0,0x1)
 73503 ls       NAMI  "/compat/linux/lib/libacl.so.1"
 73503 ls       NAMI  "/lib/libacl.so.1"
 73503 ls       RET   linux_open 3
 73503 ls       CALL  read(0x3,0xbfbfdd80,0x200)
 73503 ls       GIO   fd 3 read 512 bytes
[binary data]
 73503 ls       RET   read 512/0x200
 73503 ls       CALL  linux_fstat64(0x3,0xbfbfdcb0,0x28076fc4)
 73503 ls       RET   linux_fstat64 0
 73503 ls       CALL  linux_mmap(0xbfbfdb84)
 73503 ls       RET   linux_mmap 671674368/0x2808f000
 73503 ls       CALL  linux_mmap(0xbfbfdb80)
 73503 ls       RET   linux_mmap 671678464/0x28090000
 73503 ls       CALL  linux_mmap(0xbfbfdb80)
 73503 ls       RET   linux_mmap 671703040/0x28096000
 73503 ls       CALL  close(0x3)
 73503 ls       RET   close 0
 73503 ls       CALL  linux_open(0x2807999d,0,0x1)
 73503 ls       NAMI  "/compat/linux/lib/libselinux.so.1"
 73503 ls       NAMI  "/lib/libselinux.so.1"
 73503 ls       RET   linux_open 3
 73503 ls       CALL  read(0x3,0xbfbfdd64,0x200)
 73503 ls       GIO   fd 3 read 512 bytes
[binary data]
 73503 ls       RET   read 512/0x200
 73503 ls       CALL  linux_fstat64(0x3,0xbfbfdc94,0x28076fc4)
 73503 ls       RET   linux_fstat64 0
 73503 ls       CALL  linux_mmap(0xbfbfdb64)
 73503 ls       RET   linux_mmap 671707136/0x28097000
 73503 ls       CALL  linux_mmap(0xbfbfdb64)
 73503 ls       RET   linux_mmap 671772672/0x280a7000
 73503 ls       CALL  close(0x3)
 73503 ls       RET   close 0
 73503 ls       CALL  linux_open(0xbfbfdc20,0,0x2808f4e0)
 73503 ls       NAMI  "/compat/linux/lib/tls/libc.so.6"
 73503 ls       NAMI  "/lib/tls/libc.so.6"
 73503 ls       RET   linux_open JUSTRETURN
 73503 ls       CALL  linux_open(0xbfbfdc20,0,0x2808f4e0)
 73503 ls       NAMI  "/compat/linux/lib/libc.so.6"
 73503 ls       NAMI  "/lib/libc.so.6"
 73503 ls       RET   linux_open 3
 73503 ls       CALL  read(0x3,0xbfbfdd48,0x200)
 73503 ls       GIO   fd 3 read 512 bytes
[binary data]
 73503 ls       RET   read 512/0x200
 73503 ls       CALL  close(0x3)
 73503 ls       RET   close 0
 73503 ls       CALL  linux_open(0xbfbfdc20,0,0x2808f4e0)
 73503 ls       NAMI  "/compat/linux/usr/lib/tls/libc.so.6"
 73503 ls       NAMI  "/usr/lib/tls/libc.so.6"
 73503 ls       RET   linux_open JUSTRETURN
 73503 ls       CALL  linux_open(0xbfbfdc20,0,0x2808f4e0)
 73503 ls       NAMI  "/compat/linux/usr/lib/libc.so.6"
 73503 ls       NAMI  "/usr/lib/libc.so.6"
 73503 ls       RET   linux_open JUSTRETURN
 73503 ls       CALL  linux_open(0xbfbfdc20,0,0x2808f4e0)
 73503 ls       NAMI  "/compat/linux/lib/obsolete/linuxthreads/tls/libc.so.6"
 73503 ls       NAMI  "/lib/obsolete/linuxthreads/tls/libc.so.6"
 73503 ls       RET   linux_open JUSTRETURN
 73503 ls       CALL  linux_open(0xbfbfdc20,0,0x2808f4e0)
 73503 ls       NAMI  "/compat/linux/lib/obsolete/linuxthreads/libc.so.6"
 73503 ls       NAMI  "/lib/obsolete/linuxthreads/libc.so.6"
 73503 ls       RET   linux_open 3
 73503 ls       CALL  read(0x3,0xbfbfdd48,0x200)
 73503 ls       GIO   fd 3 read 512 bytes
[...]
---snip---

Anyone out there who is willing to play with the order
in /compat/linux/etc/ld.so.conf to see if it helps (don't forget to run
ldconfig in a chroot).

Bye,
Alexander.

-- 
Forrest Gump: "I'm sorry for ruining your party, Lieutenant
Dan. She tasted of cigarettes" 
http://www.Leidinger.net  Alexander _at_ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild _at_ FreeBSD.org  : PGP ID = 72077137
Received on Tue Jan 09 2007 - 18:46:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:04 UTC