From owner-freebsd-hackers Tue Apr 11 11:26:24 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from kweetal.tue.nl (kweetal.tue.nl [131.155.2.7]) by hub.freebsd.org (Postfix) with ESMTP id 3868537B797 for ; Tue, 11 Apr 2000 11:26:20 -0700 (PDT) (envelope-from marcov@toad.stack.nl) Received: from hermes.tue.nl [131.155.2.46] by kweetal.tue.nl (8.9.3) for id UAA02525 (ESMTP); Tue, 11 Apr 2000 20:26:17 +0200 (MDT) Received: from deathstar (n33.dial.tue.nl [131.155.209.32]) by hermes.tue.nl (Postfix) with ESMTP id 6D3E02E802 for ; Tue, 11 Apr 2000 20:26:12 +0200 (CEST) From: "Marco van de Voort" To: hackers@freebsd.org Date: Tue, 11 Apr 2000 13:30:31 +0100 Subject: ktrace, syscalls and filehandles. X-mailer: Pegasus Mail for Win32 (v3.12b) Message-Id: <20000411182612.6D3E02E802@hermes.tue.nl> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG OS: FreeBSD 4.0 I have a ported pascal compiler that doesn't work yet. I use ktrace (great tool btw) to find the problem, mainly because the differences between the linux and FreeBSD version are only in about 50 syscall calling routines. Now the program terminates with the following sequence, which makes me wonder. - A fstat (handle,buffer) with handle = 0x4 and buffer the right value. returns 0. (success). I checked, and the file does exist. - then a lseek on the same handle (0x4, so not overwritten by a dangling pointer ), returns -1 (I forgot the errno, but ktrace says bad filedescriptor) How can this happen? There is no call to close(or any other syscall) inbetween, and I guess that the actual data for filedescriptor 4 is in some protected space, which I can't have mutilated? (p.s. Keep in mind I can't GDB yet, the plain GDB v4.18 don't seem to work on 4.0. and I need them for an OBJPAS patch. The problems have to do with solib.c ) Marco van de Voort (MarcoV@Stack.nl) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message