Re: [Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

2007-05-22 Thread Corinna Vinschen
On May 21 19:15, Christian Franke wrote: * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Don't invalidate devbuf if new position is within buffered range. Thanks, applied. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project

Re: [Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

2007-05-21 Thread Corinna Vinschen
Hi Christian, On May 20 17:02, Christian Franke wrote: fhandler_dev_floppy::lseek() always clears the 60KB pre-read buffer, even on lseek(fd, 0, SEEK_CUR); If a programm (like ddrescue) always calls lseek() before each read(), performance is poor, because the same block is read several

Re: [Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

2007-05-21 Thread Christian Franke
Corinna Vinschen wrote: As for the devbuf part of the patch, it's missing a ChangeLog entry. Can you please send one, possibly in present tense? (Your first ChangeLog was incorrectly written in past tense) 2007-05-21 Christian Franke [EMAIL PROTECTED] * fhandler_floppy.cc

Re: [Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

2007-05-20 Thread Christian Franke
fhandler_dev_floppy::lseek() always clears the 60KB pre-read buffer, even on lseek(fd, 0, SEEK_CUR); If a programm (like ddrescue) always calls lseek() before each read(), performance is poor, because the same block is read several times. With this new version of the patch, the buffer is only

Re: [Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

2007-05-19 Thread Pedro Alves
Christopher Faylor escreveu: On Fri, May 18, 2007 at 09:02:15PM +0200, Christian Franke wrote: Hi, Cygwin 1.5.24-2 segfaults on unaligned lseek() on raw block devices with sector size 512 bytes. Testcases: $ dd skip=1000 bs=2047 if=/dev/scd0 of=/dev/null $ ddrescue -c 1 /dev/scd0 file.iso

Re: [Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

2007-05-19 Thread Christian Franke
Pedro Alves wrote: Christopher Faylor escreveu: On Fri, May 18, 2007 at 09:02:15PM +0200, Christian Franke wrote: Hi, Cygwin 1.5.24-2 segfaults on unaligned lseek() on raw block devices with sector size 512 bytes. Testcases: $ dd skip=1000 bs=2047 if=/dev/scd0 of=/dev/null $ ddrescue -c 1

Re: [Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

2007-05-19 Thread Pedro Alves
Christian Franke escreveu: Pedro Alves wrote: Christopher Faylor escreveu: On Fri, May 18, 2007 at 09:02:15PM +0200, Christian Franke wrote: Hi, Cygwin 1.5.24-2 segfaults on unaligned lseek() on raw block devices with sector size 512 bytes. Testcases: $ dd skip=1000 bs=2047 if=/dev/scd0

Re: [Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

2007-05-19 Thread Christian Franke
Pedro Alves wrote: ... I'm just looking at fhandler_floopy.cc for the first time, but, isn't there the possibility that bytes_left can be a bit too big for alloca? AFAIK not: bytes_left is always less than bytes_per_sector. The _dev_floppy class is only used for Floppy (512), HD (usually

Re: [Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

2007-05-18 Thread Christopher Faylor
On Fri, May 18, 2007 at 09:02:15PM +0200, Christian Franke wrote: Hi, Cygwin 1.5.24-2 segfaults on unaligned lseek() on raw block devices with sector size 512 bytes. Testcases: $ dd skip=1000 bs=2047 if=/dev/scd0 of=/dev/null $ ddrescue -c 1 /dev/scd0 file.iso This is due to a fixed 512 byte

Re: [Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

2007-05-18 Thread Christian Franke
Christopher Faylor wrote: On Fri, May 18, 2007 at 09:02:15PM +0200, Christian Franke wrote: ... It seems like this could be done without the heavyweight use of malloc, like use an automatic array of length 512 + 4 and calculate an aligned address from that. Sorry, no. unaligned

Re: [Patch] Segfault on unaligned lseek() on /dev/sdX (was: [ITP] ddrescue 1.3)

2007-05-18 Thread Christopher Faylor
On Fri, May 18, 2007 at 10:23:41PM +0200, Christian Franke wrote: Christopher Faylor wrote: On Fri, May 18, 2007 at 09:02:15PM +0200, Christian Franke wrote: ... It seems like this could be done without the heavyweight use of malloc, like use an automatic array of length 512 + 4 and