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



Quoting Divacky Roman <xdivac02@xxxxxxxxxxxxxxxxx> (Mon, 8 Jan 2007 19:00:14 +0100):

On Mon, Jan 08, 2007 at 08:32:03PM +0300, Boris Samorodov wrote:
On Mon, 8 Jan 2007 17:51:57 +0100 Divacky Roman wrote:

can someone confirm that running for example /bin/ls
in linux compat doesnt work. here it goes like:

witten ~# /compat/linux/bin/ls
/compat/linux/bin/ls: error while loading shared libraries: /usr/lib/librt.so.1: ELF file OS ABI invalid

I don't have -current ATM, but if you won't find an error at your
config, I'll definitely do.

I didnt change anything... it just stopped working :( I am doing
non-fbsd work these days so I really cannot imagine what changed

I can confirm the /comapt/linux/bin/ls part. acroread works for me.

I cannot see what can be wrong. I tried to backout all changes that
alexander commited yesterday but it didnt help. is it regression
local to my machine or is the problem -current wide?

/usr/ports/UPDATING (20060616: AFFECTS users of emulation/linux_base-*)
has some advices how to find and diagnose the culprit. The most
typical case here is changing the standard way of library searching
(i.e. LD_* paths, etc.).

I dont have anything like that set... it looks like a bug in kernel/linux_base
because the trace looks like:

Jan 8 18:57:59 witten kernel: linux(1582): open(/lib/tls/librt.so.1, 0x0, 0x0)
Jan 8 18:57:59 witten kernel: linux(1582): open returns error 2

% errno 2
ENOENT 2 /* No such file or directory */

Right, does not exist.

Jan 8 18:57:59 witten kernel: linux(1582): open(/compat/linux/lib/librt.so.1, 0x0, 0x0)
Jan 8 18:57:59 witten kernel: linux(1582): open returns error 0

This is a link to librt-2.3.6.so.

Jan 8 18:57:59 witten kernel: linux(1582): open(/usr/lib/tls/librt.so.1, 0x0, 0x0)
Jan 8 18:57:59 witten kernel: linux(1582): open returns error 2

Right, does not exist.

Jan 8 18:57:59 witten kernel: linux(1582): open(/usr/lib/librt.so.1, 0x0, 0x0)
Jan 8 18:57:59 witten kernel: linux(1582): open returns error 0

Does not exist in /comapt/linux (linux one) but in / (FreeBSD one).

Jan 8 18:57:59 witten kernel: linux(1582): exit_group(127)

ie. it opens the right library but IGNORES it and the iterates through the rest
and then stops on fbsd library saying that its not compatible...

This may not be a _new_ bug in the kernel. We know that we have
problems when a FreeBSD lib has the same name and version as the linux
one. It may be the case that the introduction of a new linux syscall
changes the behavior of some linux userland code. glibc can do this
based upon the osversion.

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---

Unfortunately the linux ldd doesn't work in a linux chroot and the
FreeBSD one doesn't like mixing ELF brands... and I need something to
eat before I can look further into this.

Bye,
Alexander.

--
"Ah, " said Arthur, "this is obviously some strange usage
of the word safe that I wasn't previously aware of. "
http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: linux 3d applications keep crashing
    ... linux-alsa-lib-1.0.10.3 The Advanced Linux Sound Architecture libraries ... linux-jpeg-6b.34 RPM of the JPEG lib ... 1180 ut2004-bin RET linux_brk 182829056/0xae5c000 ...
    (freebsd-current)
  • Re: [amd64]segmentation faults if linked with ld
    ... I have problems with assembler programms and amd64 architecture on linux. ... The memory that you are jumping to with your ret instruction is not probably not code. ... I don't know the Linux program start up procedure well enough to know for sure what state the stack would be in here, but it could be that the segfault is because of the pop that ret does or it could be the attempted access to the addressed that was pointed to by what was popped off the stack. ... The _exit system call must be made from a Linux program in order to terminated its own execution in a normal way. ...
    (comp.lang.asm.x86)
  • Re: smoke and mirrors - any way to trick an app into thinking Im running linux?
    ... everything "linux", ... 7851 rm RET fstatfs 0 ... 7851 rm RET lstat 0 ... 7851 rm NAMI "cxupgrade" ...
    (freebsd-questions)
  • Has PAM changed in Suse Linux 10 ?
    ... The same code that works on other Linux versions fails, ... pam_authenticatealways returns "Authentication failed". ... const struct pam_message **msgm, ... if (ret!= PAM_SUCCESS) ...
    (comp.os.linux.security)
  • Re: FreeBSD 4.x Opteron Question
    ... the FreeBSD developers told everyone that 5.3 was da ... initially over linux not because there's a bunch of good guys on the ... My tests measure kernel performance; ... > a networking device is a key performance indicator. ...
    (freebsd-questions)