Opened 19 years ago

Closed 19 years ago

Last modified 14 years ago

#2724 closed defect (fixed)

[BUG] Interrupting an activation phase can lead to file_map.db corruption

Reported by: kballard (Lily Ballard) Owned by: pguyot (Paul Guyot)
Priority: Normal Milestone:
Component: base Version:
Keywords: Cc:
Port:

Description (last modified by jmroot (Joshua Root))

I interrupted DarwinPorts during an activation phase and it left me with a severely-truncated file_map.db file. I'm guessing that DarwinPorts doesn't bother trapping that signal (I simply hit C) and I hit it during the filemap save method. DarwinPorts should either trap the signal to clean up nicely, or saving the file_map.db file should do an atomic save (i.e. save it in the temporary directory, then use an OS-provided atomic swap of the temp file and the original file_map.db file - if no atomic swap method exists for the given OS (I know Cocoa and Carbon provide atomic swap methods, but I don't know about darwin), go ahead and swap the two non-atomically - it's still dangerous, but far less than saving over file_map.db)

Change History (6)

comment:1 Changed 19 years ago by pguyot (Paul Guyot)

Owner: changed from darwinports-bugs@… to pguyot@…

comment:2 Changed 19 years ago by pguyot (Paul Guyot)

Indeed Kevin, we need atomic update of the filemap database since it's a critical component. BTW, POSIX requires rename(2) to be atomic.

comment:3 Changed 19 years ago by pguyot (Paul Guyot)

Resolution: fixed
Status: newclosed

comment:4 Changed 17 years ago by nox@…

Milestone: MacPorts base bugs
Priority: ExpectedNormal
Version: 1.0

comment:5 Changed 15 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:6 Changed 14 years ago by jmroot (Joshua Root)

Description: modified (diff)
Milestone: MacPorts Future
Note: See TracTickets for help on using tickets.