Subject: Re: serious I/O / uvm bug
To: None <M.Drochner@fz-juelich.de>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: tech-kern
Date: 01/13/2005 18:17:58
In message <200501132310.AAA0000100803@zel459.zel.kfa-juelich.de>, Matthias Dro
chner writes:
>
>Hi -
>something went wrong, don't have time to look deeper right now.
>Looks urgent because it causes data corruption.
>The appended test program gives
>
>$ ./a.out
>a.out: lseek: Invalid argument
>
>on i386 and
>
>zel637: {100} ./a.out
>a.out: lseek: Invalid argument
>a.out: write: Invalid argument
>
>on alpha (with -current).
>
>This is probably also the reason for kernel build failures on alpha.
>
>best regards
>Matthias
>
>
>#include <fcntl.h>
>#include <unistd.h>
>#include <err.h>
>
>main()
>{
>        int fd, res;
>
>        fd = open("/tmp/mist", O_RDWR|O_CREAT|O_TRUNC, 0644);
>        res = lseek(fd, SEEK_SET, 100);
>        if (res < 0)
>                warn("lseek");
>        res = write(fd, "x", 1);
>        if (res < 0)
>                warn("write");
>}
>

I' don't have any Alphas to test on, but you've reversed the order of 
the second and third arguments to lseek.  When I fix that, it runs 
properly on i386.


		--Prof. Steven M. Bellovin, http://www.cs.columbia.edu/~smb