From owner-freebsd-hackers@FreeBSD.ORG Tue May 20 01:04:08 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8037B37B432 for ; Tue, 20 May 2003 01:04:08 -0700 (PDT) Received: from mail.icomag.de (ns.icomag.de [195.227.115.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 645DC43FB1 for ; Tue, 20 May 2003 01:04:07 -0700 (PDT) (envelope-from bgd@icomag.de) Received: by mail.icomag.de (Postfix, from userid 1019) id 478E823041; Tue, 20 May 2003 10:04:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.icomag.de (Postfix) with ESMTP id 450A223040; Tue, 20 May 2003 10:04:05 +0200 (CEST) Date: Tue, 20 May 2003 10:04:05 +0200 (CEST) From: Bogdan TARU X-X-Sender: To: Dag-Erling Smorgrav In-Reply-To: Message-ID: <20030520094427.K78063-100000@fw.office.icom> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@FreeBSD.ORG cc: Dan Nelson Subject: Re: linux binary blues X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2003 08:04:08 -0000 Hi Hackers, So, I have installed linux_kdump package, tried to run 'ktrace' on my binary and then analyze the ktrace.out with 'linux_kdump'. This is the point where it ain't working no more on the 4.7 jail system: 73506 engine NAMI "/var/run/engine.pid" 73506 engine RET linux_open 3 73506 engine CALL linux_fcntl64(0x3,0x6,0xbfbfe7b0) 73506 engine RET linux_fcntl64 -1 errno 22 Invalid argument And it works on the 4.8 jail system: 31291 engine NAMI "/var/run/engine.pid" 31291 engine RET linux_open 3 31291 engine CALL linux_fcntl64(0x3,0x6,0xbfbfe820) 31291 engine RET linux_fcntl64 0 31291 engine CALL linux_getpid 31291 engine RET linux_getpid 31291/0x7a3b 31291 engine CALL oftruncate(0x3,0) 31291 engine RET oftruncate 0 31291 engine CALL write(0x3,0x864c304,0x6) 31291 engine GIO fd 3 wrote 6 bytes So, again, any ideas why this linux binary can get a lock on the '/var/run/engine.pid' file under a freebsd 4.8 jail, and cannot on a 4.7 jail? Thank you, bogdan On Thu, 15 May 2003, Dag-Erling Smorgrav wrote: > Bogdan TARU writes: > > As about the third parameter to semget, as > > far as I can read in semget(2) the third parameter (flag) is an integer, > > not a pointer? > > 0xbfsomething is definitely a pointer to a stack variable. You're > probably using kdump instead of linux_kdump; syscall 221 is semget in > FreeBSD but fcntl64 in Linux. The first argument is the fd (notice > that it's 3 which is the result of the preceding open call; open is > syscall 5 in both FreeBSD and Linux, so this one is correct), the > second is the operation (6 == F_SETLK in Linux), and the third is the > argument (for F_SETLK, a pointer to a struct flock). > > I recommend 'pkg_add -r linux_kdump'. > > DES > -- > Dag-Erling Smorgrav - des@ofug.org >