Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Apr 2008 20:17:28 +0530
From:      Manik Taneja <mantanej@ironport.com>
To:        <freebsd-emulation@freebsd.org>
Subject:   Purify on FreeBSD 
Message-ID:  <C42577D8.2849%mantanej@ironport.com>

next in thread | raw e-mail | index | archive | help
Hi,

I'm trying to get purify that was built on a linux (RHEL 4) machine to run
on a FreeBSD 6.3 system with linux emulation (fc4) installed on it.

The first issue that I'm running into is the following. If write a simple C
program that uses fork(), build that on a linux system and run that on BSD
it fails with the following error.

curry:~/rational/hacks 09:37 AM $pwd
/home/mantanej/rational/hacks
curry:~/rational/hacks 09:37 AM $./a.out
fork: Invalid argument

However, if use a program that doesn't use fork, but uses system calls such
as malloc (sbrk) , open etc, that just works fine without any complaints. So
looks like this is probably a bug in the fork emulator on linux. See below
for output of truss .

The next thing I tried, was to move the libc and ld files from my linux
machine to the BSD machine and copy them in /usr/compact/linux/lib i.e.

ldd ./a.out 
    libc.so.6 => /lib/tls/libc.so.6 (0x00149000)
    /lib/ld-linux.so.2 (0x0012b000)

In that case I get the following error on BSD

$./a.out 
./a.out: relocation error: /lib/libc.so.6: symbol _dl_out_of_memory, version
GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference

I searched on google and it seems some people have seen this error, but
nobody seems to know how to fix it.

Will greatly appreciate any help in this regard.

Thanks,
Manik


6901: linux_brk(0x0)                 = 134520832 (0x804a000)
 6901: linux_newuname(0xbfbfe76e)         = 0 (0x0)
 6901: linux_access(0x4c2b2564,0x4)         ERR#2 'No such file or
directory'
 6901: linux_open("/etc/ld.so.cache",0x0,01)     = 3 (0x3)
 6901: linux_fstat64(0x3,0xbfbfe050,0x4c2b6fc4)     = 0 (0x0)
 6901: linux_mmap(0xbfbfe034)             = 1277919232 (0x4c2b8000)
 6901: close(3)                     = 0 (0x0)
 6901: linux_open("/lib/libc.so.6",0x0,00)     = 3 (0x3)
 6901: read(3,"\^?ELF\^A\^A\^A\0\0\0\0\0\0\0\0"...,512) = 512 (0x200)
 6901: linux_fstat64(0x3,0xbfbfe0ac,0x4c2b6fc4)     = 0 (0x0)
 6901: linux_mmap(0xbfbfdf04)             = 1277927424 (0x4c2ba000)
 6901: linux_mmap(0xbfbfdf04)             = 1279070208 (0x4c3d1000)
 6901: linux_mmap(0xbfbfdf04)             = 1279086592 (0x4c3d5000)
 6901: close(3)                     = 0 (0x0)
 6901: linux_mmap(0xbfbfe474)             = 1279094784 (0x4c3d7000)
 6901: linux_set_thread_area(0xbfbfe594)     ERR#78 'Function not
implemented'
 6901: linux_modify_ldt(0x1,0xbfbfe594,0x10)     = 0 (0x0)
 6901: linux_mprotect(0x4c3d1000,0x2000,0x1)     = 0 (0x0)
 6901: linux_mprotect(0x4c2b6000,0x1000,0x1)     = 0 (0x0)
 6901: munmap(0x4c2b8000,7270)             = 0 (0x0)
 6901: linux_clone(0x1200011,0x0)         ERR#22 'Invalid argument'
 6901: dup(0x2)                     = 3 (0x3)
 6901: linux_fcntl64(0x3,0x3,0x0)         = 2 (0x2)
 6901: linux_brk(0x0)                 = 134520832 (0x804a000)
 6901: linux_brk(0x806b000)             = 134656000 (0x806b000)
 6901: linux_fstat64(0x3,0xbfbfe41c,0x4c3d2ff4)     = 0 (0x0)
 6901: linux_ioctl(0x3,0x5401,0xbfbfe390)     = 0 (0x0)
 6901: linux_mmap2(0x0,0x1000,0x3,0x22,0xffffffff,0x6) = 1277919232
(0x4c2b8000)
 6901: linux_llseek(0x3,0x0,0x0,0xbfbfe45c,0x1)     = 0 (0x0)
fork: Invalid argument
 6901: write(3,"fork: Invalid argument\n",23)     = 23 (0x17)
 6901: close(3)                     = 0 (0x0)
 6901: munmap(0x4c2b8000,4096)             = 0 (0x0)
 6901: process exit, rval = 65280





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C42577D8.2849%mantanej>