bug-hurd
[Top][All Lists]
Advanced

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

SA_RESTART


From: Thomas Schwinge
Subject: SA_RESTART
Date: Mon, 13 Jun 2011 21:58:02 +0200
User-agent: Notmuch/0.5-77-g335dd52 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu)

Hallo!

Roland, you're CCed as the original expert; Jérémie you're CCed as the
next expert.  :-)


Text reproduced from
<http://www.bddebian.com:8888/~hurd-web/open_issues/git-core-2/>:

Running ``git checkout -f'' under GDB:

    error: git checkout-index: unable to create file 
gas/testsuite/gas/cris/string-1.s (File exists)
    error: git checkout-index: unable to create file 
gas/testsuite/gas/i386/x86-64-sse-check.d (File exists)
    error: git checkout-index: unable to create file 
gas/testsuite/gas/i386/x86-64-sse4_1.d (File exists)
    error: git checkout-index: unable to create file 
gas/testsuite/gas/ppc/astest.d (File exists)
    error: git checkout-index: unable to create file 
gas/testsuite/gas/tic6x/reloc-bad-4.s (File exists)
    warning: unable to unlink include/cgen: Operation not permitted
    fatal: cannot create directory at 'include/cgen': Operation not permitted

Again:

    error: git checkout-index: unable to create file gas/config/te-vxworks.h 
(File exists)
    error: git checkout-index: unable to create file 
gas/testsuite/gas/cris/string-1.s (File exists)
    error: git checkout-index: unable to create file 
gas/testsuite/gas/d10v/warning-019.s (File exists)
    error: git checkout-index: unable to create file 
gas/testsuite/gas/i860/dual03.s (File exists)
    error: git checkout-index: unable to create file 
ld/testsuite/ld-mmix/sec-7a.s (File exists)
    warning: unable to unlink ld/testsuite/ld-powerpc: Operation not permitted
    fatal: cannot create directory at 'ld/testsuite/ld-powerpc': Operation not 
permitted

And:
<http://www.bddebian.com:8888/~hurd-web/open_issues/git_duplicated_content/>

All these (very likely) have the same root cause: SA_RESTART restarting
too much.

With ``git checkout'', Git uses in progress.c a SIGALRM handler
(`SA_RESTART`; invoked every second via `setitimer(ITIMER_REAL)`) to
display status messages: ``x % already checked out''.

To avoid the status update signals every second, in
[git]/progress.c:start_progress_delay we can just return NULL (manually
in GDB, for example), then both the ``error: git checkout-index'' and the
duplicated content (see URL above) issues go away.

I'm guessing that when returning from a SA_RESTART signal handler, too
much of the ``syscall''s is being restarted.  For example, if a file has
already been created, the restarted creation attempt would fail: *File
exists*.  If data has been written, it might get written again
(duplication issue).  Then, there are cases where `unlink` apparently
returns EINTR, which is not kosher either.  Etc.

Do we have problems with SA_RESTART vs. the atomicity of our
syscall-alikes?


Grüße,
 Thomas

Attachment: pgpZfsh5KQKsa.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]