On Fri, Aug 19, 2011 at 10:10 AM, Pavel Ivanov <[email protected]> wrote:

> > If that is indeed the case, the current code will cause corruption on an
> > EINTR on such platforms because the EINTR handling does not account for a
> > non-0 write.
>
> No, it won't cause corruption. Because SQLite uses pwrite or its
> alternative with calls to lseek and write. So after interruption it
> will start writing at the same position it wrote previous time
> rewriting part of what it has already written with the same data.
>

The problem comes up if SQLite is configured to not use pwrite() and instead
make separate calls to lseek() followed by write().  The do-loop that
retries after an EINTR was not rerunning the lseek().  I my testing a patch
for for this now.  http://www.sqlite.org/src/info/e59bdf6116


>
>
> Pavel
>
>
> On Fri, Aug 19, 2011 at 8:48 AM, Stephan Beal <[email protected]>
> wrote:
> > On Thu, Aug 18, 2011 at 6:10 PM, Stephan Beal <[email protected]>
> wrote:
> >
> >> On Thu, Aug 18, 2011 at 5:27 PM, David Garfield <
> >> [email protected]> wrote:
> >>
> >>> I HOPE that an interrupt in a large interrupted write will NOT return
> >>
> >> EINTR, because if it does, the partial write is screwed up.
> >>>
> >>
> >> i hope so, too! :-D
> >>
> >
> > It would seem that at least one environment does allow that behaviour.
> From
> > the Linux write(2) man pages:
> >
> > ----
> > CONFORMING TO
> >       SVr4, 4.3BSD, POSIX.1-2001.
> >
> >       Under SVr4 a write may be interrupted and return EINTR at any
> point,
> > not just before any data is written.
> > ----
> >
> > So this just might actually (potentially) affect some sqlite3 users. i
> don't
> > know if Solaris currently uses SysV or posix semantics, but Solaris was
> once
> > known as SVr4 (SysV, v.4)?
> >
> > If that is indeed the case, the current code will cause corruption on an
> > EINTR on such platforms because the EINTR handling does not account for a
> > non-0 write.
> >
> > http://kb.iu.edu/data/agjs.html
> > http://en.wikipedia.org/wiki/System_V
> > The German page has release dates and easier-to-read inheritance details:
> > http://de.wikipedia.org/wiki/System_V
> > http://en.wikipedia.org/wiki/Solaris_(operating_system)
> >
> > --
> > ----- stephan beal
> > http://wanderinghorse.net/home/stephan/
> > _______________________________________________
> > sqlite-users mailing list
> > [email protected]
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to