bug-texinfo
[Top][All Lists]
Advanced

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

[bug #46481] install-info can "corrupt" dir file if interrupted.


From: Pedrum Mohageri
Subject: [bug #46481] install-info can "corrupt" dir file if interrupted.
Date: Thu, 19 Nov 2015 21:48:10 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?46481>

                 Summary: install-info can "corrupt" dir file if interrupted.
                 Project: texinfo - GNU documentation system
            Submitted by: pd5rm
            Submitted on: Thu 19 Nov 2015 09:48:09 PM GMT
                Category: install-info
                 Release: 6.0
                Priority: 7 - High
                Severity: 3 - Normal
              Item Group: bug
                 Privacy: Public
             Open/Closed: Open
             Assigned to: None
         Discussion Lock: Any
                  Status: None

    _______________________________________________________

Details:

I use Arch and the package manager bailed out on several packages during the
install. I traced this to a failed install-info call to add entries for
package to the 'dir' that info use. 

After strace'ng the code, I observe it will do a open with O_TRUNC flag, and
then write out some data. If the process is killed between the open and write,
it will leave 0 byte dir file which can't written to by subsequent
install-info calls. You should consider replacing this with a 'write to
temp/rename temp to dir' changeover that's atomic.

While this is rare occurrence, I've seen numerous failures like this reported
on Redhat and Arch forums.


Strace results:
open("dir", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fcf1c842000
write(3, "This is the file .../info/dir, w"..., 867) = 867




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46481>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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