From owner-freebsd-emulation@FreeBSD.ORG Mon Apr 14 09:23:35 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6964106566C; Mon, 14 Apr 2008 09:23:35 +0000 (UTC) (envelope-from prvs=mantanej=98368905d@ironport.com) Received: from smtp2-outbound.ironport.com (smtp2-outbound.ironport.com [63.251.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 8575E8FC14; Mon, 14 Apr 2008 09:23:35 +0000 (UTC) (envelope-from prvs=mantanej=98368905d@ironport.com) DomainKey-Signature: s=key512; d=ironport.com; c=nofws; q=dns; h=Received:Received:Received:User-Agent:Date:Subject:From: To:CC:Message-ID:Thread-Topic:Thread-Index:In-Reply-To: Mime-version:Content-type:Content-transfer-encoding: Return-Path:X-OriginalArrivalTime; b=iYX00oLIikEj03+1P2D8CTK2xH2XuUERNONPhh+TmQT1bY4+BvX1Lma5 mq7xuUJuMrqBgrlKe9vMD9MUKQ6Luw==; Received: from windu.ironportsystems.com ([10.1.1.160]) by smtp2-outbound.ironport.com with ESMTP; 14 Apr 2008 02:12:18 -0700 Received: from anakin.ironportsystems.com ([10.1.1.166]) by windu.ironportsystems.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 14 Apr 2008 02:12:16 -0700 Received: from [64.103.134.106] ([10.251.60.35]) by anakin.ironportsystems.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 14 Apr 2008 02:12:03 -0700 User-Agent: Microsoft-Entourage/12.1.0.080305 Date: Mon, 14 Apr 2008 14:41:50 +0530 From: Manik Taneja To: Roman Divacky Message-ID: Thread-Topic: Purify on FreeBSD Thread-Index: AcieD5KFNt10l+G5NEyygdIDEBGzgQ== In-Reply-To: <20080412094428.GA88981@freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-OriginalArrivalTime: 14 Apr 2008 09:12:04.0117 (UTC) FILETIME=[9AEFE450:01C89E0F] Cc: freebsd-emulation@freebsd.org Subject: Re: Purify on FreeBSD X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2008 09:23:35 -0000 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 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" 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