[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#736202: undeterministic output when running egrep repeatedly with the same input



Hi Jeff!

On 21/01/14 02:38, Jeff Epler wrote:
> Could it be http://www.freebsd.org/cgi/query-pr.cgi?pr=164445 ?

I think you might be right:

> From: 	Andriy Gapon <avg@FreeBSD.org>

> On FreeBSD the ioctl(2) system call does copyin/copyout of the data argument and
> thus those extra copyin/copuout calls in zfs_ioctl are harmful.

so maybe in rare cases lseek can return success, if some junk value is
smaller than the file's size.  grep takes that to mean it is looking at
a binary file:

> static int
> file_is_binary (char const *buf, size_t bufsize, int fd, struct stat const *st)

>       /* Look for a hole after the current location.  */
>       off_t hole_start = lseek (fd, cur, SEEK_HOLE);

My mount.h was on a ZFS filesystem;  I guess Robert's was too.  After
copying it to a tmpfs mount I don't see the bug any more.

Happily this bug should not affect the buildds.

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org


Reply to: