Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Linux emulation problem



On Tue, Jun 28, 2011 at 11:17:25PM +0200, Torsten Harenberg wrote:
> Hi Nicolas,
> 
> Am 28.06.2011 um 22:55 schrieb Nicolas Joly:
> 
> > 
> > Looks like something similar a problem i currently see on my machines
> > with forked processes crashing.
> > 
> > njoly@lanfeust [~]> ktrace -di ./fork64
> > fork64: child failed
> > njoly@lanfeust [~]> kdump
> > [...]
> > 15032  15032 fork64   CALL  clone(0x1200011,0,0,0x68e8e0,0)
> > 15032  15032 fork64   RET   clone 8516/0x2144
> > 15032  15032 fork64   CALL  wait4(0xffffffffffffffff,0x7f7ffffff16c,0,0)
> >  8516   8516 fork64   EMUL  "linux"
> >  8516   8516 fork64   RET   fork 0
> >  8516   8516 fork64   PSIG  SIGSEGV SIG_DFL: 
> > code=SEGV_MAPERR,addr=0x90,trap=14)
> >  8516   8516 fork64   NAMI  "fork64.core"
> > 15032  15032 fork64   RET   wait4 8516/0x2144
> > 
> > Can you try the attached forked binary, compiled on CentOS 5.6 x86_64
> > machine from given fork.c source.

Given that the previous mail did not hit the list (846K binary ?), i'm
attaching the source to that one.

> I compiled it myself on one of my CentOS 5.5 machines (haven't upgraded yet) 
> and tried this one plus the binary you had and the output looks :
> 
> [23:11] harenber@charm:~ $ gcc -static -o fork64_CentOS5.5_static fork.c 
> [23:07] harenber@charm:~ $ ./fork64_CentOS5.5 
> [23:07] harenber@charm:~ $ cat /etc/issue
> CentOS release 5.5 (Final)
> Kernel \r on an \m

> mail# ktrace -di ./fork64_CentOS5.5_static                                    
>  
> linux_probe: returning 0
> fork64_CentOS5.5_static: child failed
[...]

> So.. yes, looks like it also appears here.

Unfortunately, i didn't had enough time to start looking into this one
yet.

> BTW: I have 
> 
> mail# pkg_info -a | grep suse
> suse_base-10.0nb5   Linux compatibility package
[...]
> at the moment.

njoly@lanfeust [~]> pkg_info -I suse_base
suse_base-11.3nb4   Linux compatibility package

No problem with 32bit compat ...

njoly@lanfeust [~]> file fork32
fork32: ELF 32-bit LSB executable,Intel 80386,version 1
(SYSV),dynamically linked (uses shared libs),for GNU/Linux 2.6.9,not stripped
njoly@lanfeust [~]> ./fork32
njoly@lanfeust [~]> echo $?
0

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.
#include <sys/wait.h>
#include <err.h>
#include <unistd.h>

int main() {
  int sts;
  pid_t pid;

  if ((pid = fork()) == (pid_t)-1)
    err(1, "fork failed");

  if (pid == 0)
    _exit(0);

  if (wait(&sts) == (pid_t)-1)
    err(1, "wait failed");
  if (!WIFEXITED(sts) || WEXITSTATUS(sts) != 0)
    errx(1, "child failed");

  return 0; }


Home | Main Index | Thread Index | Old Index