From owner-freebsd-emulation@FreeBSD.ORG Fri Apr 11 15:15:50 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 456881065670 for ; Fri, 11 Apr 2008 15:15:50 +0000 (UTC) (envelope-from prvs=mantanej=98040ef11@ironport.com) Received: from smtp2-outbound.ironport.com (smtp2-outbound.ironport.com [63.251.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 1D6538FC1E for ; Fri, 11 Apr 2008 15:15:49 +0000 (UTC) (envelope-from prvs=mantanej=98040ef11@ironport.com) DomainKey-Signature: s=key512; d=ironport.com; c=nofws; q=dns; h=Received:Received:Received:User-Agent:Date:Subject:From: To:Message-ID:Thread-Topic:Thread-Index:Mime-version: Content-type:Content-transfer-encoding:Return-Path: X-OriginalArrivalTime; b=Uzip6BEtnWzm5Y29zqDPw9B8eb7yqnCMaGDiOHnjV+zLMZXY8yFGVfiF msRz7GItO6G6w3VQV1nVYIKHJ0ur4g==; Received: from windu.ironportsystems.com ([10.1.1.160]) by smtp2-outbound.ironport.com with ESMTP; 11 Apr 2008 07:47:46 -0700 Received: from anakin.ironportsystems.com ([10.1.1.166]) by windu.ironportsystems.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 11 Apr 2008 07:47:45 -0700 Received: from [64.103.134.106] ([10.251.60.179]) by anakin.ironportsystems.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 11 Apr 2008 07:47:32 -0700 User-Agent: Microsoft-Entourage/12.1.0.080305 Date: Fri, 11 Apr 2008 20:17:28 +0530 From: Manik Taneja To: Message-ID: Thread-Topic: Purify on FreeBSD Thread-Index: Acib4vZ34c3STD34sEefXARwUQ1BmA== Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-OriginalArrivalTime: 11 Apr 2008 14:47:33.0124 (UTC) FILETIME=[F9855C40:01C89BE2] Subject: 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: Fri, 11 Apr 2008 15:15:50 -0000 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