Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Feb 2003 12:14:18 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Thomas Spreng <spreng@socket.ch>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: linux binary and pwrite() problem...
Message-ID:  <20030215181418.GK15607@dan.emsphone.com>
In-Reply-To: <20030215120007.GA44691@rock.stable.ch>
References:  <20030215120007.GA44691@rock.stable.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Feb 15), Thomas Spreng said:
> Hi,
> 
> I have two fbsd systems, both running 4.7 and linux_base-7.1_2.
> I am trying to run a gameserver linux binary (sof2 v1.02) on one
> of these machines but it just hangs if i start it. The strange
> thing is that exactly the same binary works on the other fbsd box
> with the same linux_base port. 
> The only thing that differs is the build date of the two boxes,
> which is '4.7-RELEASE-p4 #0: Sun Feb  9 00:34:14 CET 2003' for the
> one that doesn't work and '4.7-RELEASE-p2 #13: Sat Dec  7 12:58:57 
> CET 2002' for the working machine.
> 
> I have traced the processes on both machines with 'ktrace' and 
> everying looks fine until the following strange thing:
> 
> On the 'not-working' machine:
> # kdump
> ...<snip>...
>  94449 sof2ded  RET   ftruncate 1001/0x3e9
>  94449 sof2ded  CALL  lseek
>  94449 sof2ded  RET   lseek 1001/0x3e9
>  94449 sof2ded  CALL  #208(0xffffffff,0x3e9,0xffffffff)
>  94449 sof2ded  RET   #208 0
>  94449 sof2ded  CALL  pwrite(0x4,0xbfbfe618,0xbfbfe588,0x8)
>  94449 sof2ded  RET   pwrite 0
>  94449 sof2ded  PSIG  SIGILL caught handler=0x8126678 mask=0x0 code=0x0
>  94449 sof2ded  PSIG  SIGINT SIG_DFL
> 
> While on the working box i got the following:
> # kdump
> ...<snip>...
>   3874 sof2ded  RET   ftruncate 1001/0x3e9
>   3874 sof2ded  CALL  lseek
>   3874 sof2ded  RET   lseek 1001/0x3e9
>   3874 sof2ded  CALL  #208(0xffffffff,0x3e9,0xffffffff)
>   3874 sof2ded  RET   #208 0
>   3874 sof2ded  CALL  write(0x2,0xbfbfd75c,0x24)
>   3874 sof2ded  GIO   fd 2 wrote 36 bytes
>        "SOF2MP V1.02 linux-i386 Sep 23 2002
> 
> I cannot explain why on one box 'pwrite()' is called and on the other
> one 'write()', is this the first box has a newer build date? Or are
> there any other components that might have an effect on running linux
> binaries.

You need to install the devel/linux_kdump port and run that instead of
kdump on Linux traces.  Some syscall numbers map to different functions
(#208 for example is unused in FreeBSD but is setresuid() in Linux).

-- 
	Dan Nelson
	dnelson@allantgroup.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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