Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Apr 2008 14:41:50 +0530
From:      Manik Taneja <mantanej@ironport.com>
To:        Roman Divacky <rdivacky@freebsd.org>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: Purify on FreeBSD
Message-ID:  <C4291DAE.2902%mantanej@ironport.com>
In-Reply-To: <20080412094428.GA88981@freebsd.org>

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

I have installed the linux_base-fc4 on my FreeBSD machine via ports. When
you say that I need to build the linux module with -DDEBUG flag enabled, you
are referring to the Free BSD linux module, correct ?

The problem is the machine is a shared and linux binary compatibility has
been statistically linked into the kernel and there is nothing much I can do
on that front. 

[root@curry /usr/ports/emulators/linux_base-fc4]# kldload linux
kldload: can't load linux: File exists
[
root@curry /usr/ports/emulators/linux_base-fc4]# kldstat
Id Refs Address    Size     Name
 1    1 0xc0400000 502154   kernel

The source of the program that failed is nothing but a simple program that
makes use of the fork system call .

#include <stdio.h>
int main (int argc, char *argv[])
{
    switch (fork()) {
        case -1: 
            printf ("error");
            break;
        case 0:
            printf ("parent");
            break;
        default:
            printf ("child");
            break;
    }
    return 0;
}

Thanks for your help.

Regards,
Manik


On 12/04/08 3:14 PM, "Roman Divacky" <rdivacky@freebsd.org> wrote:

> On Fri, Apr 11, 2008 at 08:17:28PM +0530, Manik Taneja wrote:
>> 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 .
>  
> DONT TRUST TRUSS... it does not work with linuxulator.. we should put some big
> fat warning somewhere.... still.. in this case I guess it identified the
> problem
> correctly
> 
> 
> can you build -DDEBUG linux module and show me what are the parameters passed
> to the clone() ? do you have source of your testing program available?
> 
> thnx
> 
> roman





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