Hi! On Fri, 2011-08-12 at 13:33:22 +0300, Niko Tyni wrote: > On Wed, Aug 10, 2011 at 02:58:07PM -0500, Jonathan Nieder wrote: > > Niko Tyni wrote: > > > > > Looks like dpkg tries to sync /usr/bin/perl5.12.4.dpkg-new when a hard > > > link has already been renamed to /usr/bin/perl and presumably gotten > > > executed by someone else. > > > Does this help? > > > + * Open extracted files for reading, not writing, in order to fsync() > > them. > > + Otherwise the open can error out when preparing to rename a binary into > > + place that has a hard link already in use. Regression introduced in > > + 1.15.6.1. Closes: #635683 > > Yes, it seems to help. > > I can reproduce the issue reliably with dpkg 1.16.0.3 and > perl-base_5.12.4-4_amd64.deb from current sid by doing > > inotifywait /usr/bin/perl; for i in $(seq 1 200); do perl -e sleep &; done > > and then unpacking the .deb in another shell. > > With a patched dpkg, the error is completely gone.
> However, are sync_file_range() and fsync() effective with an O_RDONLY > file descriptor? From fsync(2): > > EBADF fd is not a valid file descriptor open for writing. > > but https://bugzilla.kernel.org/show_bug.cgi?id=29972 suggests this is > misleading... This is misleading on Linux, but it's not a safe portable assumption to make on POSIX in general as that behaviour is not specified and as such is implementation specific, some Unix systems do actually fail on read-only file descriptors, for example: <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V50_HTML/MAN/MAN2/0033____.HTM> <http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/fsync.htm> The correct portable way to fix this would be to defer the rename of the symlink to avoid the usage of the actual executable which is still deferred, but this is a quick analysis of the situation, I've not actually checked the logs in depth or reviewed the case... regards, guillem -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org