Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 May 2011 17:50:11 GMT
From:      "Klaus T. Aehlig" <aehlig@linta.de>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/157274: misc/finutils: gfind segmentation fault: 11 (core dumped)
Message-ID:  <201105301750.p4UHoBs0021697@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/157274; it has been noted by GNATS.

From: "Klaus T. Aehlig" <aehlig@linta.de>
To: Eitan Adler <lists@eitanadler.com>
Cc: bug-followup@freebsd.org, fabian@wenks.ch
Subject: Re: ports/157274: misc/finutils: gfind segmentation fault: 11 (core
 dumped)
Date: Mon, 30 May 2011 18:46:12 +0100

 Hi,
 
 further investigations (thanks to Helmut Grohne who helped me) on my
 7.3-RELEASE virtual machine showed that gfind does the following sequence
 of libc-calls, which seg faults on 7.3-RELEASE, but not on 8.2-STABLE:
 open, fdopendir, readdir.
 
 I could construct the following minimal example, which I belive should
 not cause a segmentation fault, but does on 7.3-RELEASE.
 
 # uname -a
 FreeBSD  7.3-RELEASE FreeBSD 7.3-RELEASE #0: Sun Mar 21 05:25:24 UTC 2010     root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
 # cat testfdopendir.c 
 #include <fcntl.h>
 #include <sys/types.h>
 #include <dirent.h>
 
 int main(int argc, char **argv) {
         DIR *dirp;
         int fd;
 
         fd = open(".",  O_RDONLY);
         dirp = fdopendir(fd);
         (void) readdir(dirp);
 
 }
 
 # cc testfdopendir.c 
 testfdopendir.c: In function 'main':
 testfdopendir.c:10: warning: assignment makes pointer from integer without a cast
 # ./a.out
 Segmentation fault (core dumped)
 # 
 
 Also note the compiler warning, that suggests that including <sys/types.h>
 and <dirent.h> does not seem to suffice---as opposed what the man page
 tells---to get the fdopendir prototype. I believe that is a bug in 
 RELENG_7_3_0.
 
 Eitan: can you please inform the appropriate maintainer about this 
 bug (if it is not fixed already in an errata for 7.3-RELEASE)?
 
 Unfortunately, the obvious patch does not yet solve the problem, so I
 have to investigate further. But I thought, I'd still report back 
 the problem with the libc headers.
 
 Best,
 Klaus
 
 



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