linux binary blues

Bogdan TARU bgd at icomag.de
Tue May 20 01:04:08 PDT 2003



	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 at 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 at ofug.org
>



More information about the freebsd-hackers mailing list