Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 May 2003 10:04:05 +0200 (CEST)
From:      Bogdan TARU <bgd@icomag.de>
To:        Dag-Erling Smorgrav <des@ofug.org>
Cc:        Dan Nelson <dnelson@allantgroup.com>
Subject:   Re: linux binary blues
Message-ID:  <20030520094427.K78063-100000@fw.office.icom>
In-Reply-To: <xzpaddoa8a2.fsf@flood.ping.uio.no>

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


	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 <bgd@icomag.de> 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
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030520094427.K78063-100000>