From owner-freebsd-emulation Sat Sep 23 13: 4:43 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from io.dreamscape.com (io.dreamscape.com [206.64.128.6]) by hub.freebsd.org (Postfix) with ESMTP id 28AB337B424 for ; Sat, 23 Sep 2000 13:04:41 -0700 (PDT) Received: from dreamscape.com (sA9-p41.dreamscape.com [207.198.13.233]) by io.dreamscape.com (8.9.3/8.8.4) with ESMTP id QAA25827; Sat, 23 Sep 2000 16:01:36 -0400 (EDT) X-Dreamscape-Track-A: sA9-p41.dreamscape.com [207.198.13.233] X-Dreamscape-Track-B: Sat, 23 Sep 2000 16:01:36 -0400 (EDT) Received: (from krentel@localhost) by dreamscape.com (8.9.3/8.9.3) id QAA37726; Sat, 23 Sep 2000 16:02:49 -0400 (EDT) (envelope-from krentel) Date: Sat, 23 Sep 2000 16:02:49 -0400 (EDT) From: "Mark W. Krentel" Message-Id: <200009232002.QAA37726@dreamscape.com> To: kuriyama@imgsrc.co.jp, marcel@cup.hp.com Subject: Re: Strange phenomen accessing a CDROM contents under linuxerator Cc: freebsd-emulation@FreeBSD.ORG Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > At this time I know that the linux_getdents syscall is broken; it's not > related to versions of Linux libraries. My first hunch is that there > maybe something wrong with the cookies; either the use of the cookies is > wrong, or the lack of cookies may be causing problems. I can confirm that something is wrong with listing a directory's contents on non-UFS partitions in the Linuxulator. I opened PR kern/19407 on this in June, but it appears there were actually two unrelated problems. Bruce Evans fixed one problem in ext2fs. The remaining problem is exactly this readdir/getdents issue. I can exhibit the bug with just a loop of readdir(3). This works on FFS, but on ext2fs and cdrom, readdir prematurely returns NULL. So, I tried calling getdents(2) directly, and that works. I tried various buffer sizes from 200 to 20,000 bytes, and they all worked. I even verified that it wasn't overrunning the buffer. So, Marcel, how confident are you that the bug is in linux_getdents? I can't find anything wrong in what getdents(2) returns. I don't know how filesystem cookies work. Is it possible that misuse of cookies could corrupt something behind the scenes but still have getdents return a correct buffer? Since getdents(2) works and readdir(3) doesn't, you'd suspect the readdir library. But I looked at the source and couldn't find anything. And /compat/linux/lib and Linux's /lib have identical libc-2.1.2.so (both based on RH 6.1), and the programs work inside Linux. So, I'm really perplexed about where to look. Any suggestions? --Mark To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message