Your message dated Sat, 30 Mar 2013 02:47:34 +0000
with message-id <[email protected]>
and subject line Bug#703406: fixed in cowdancer 0.72
has caused the Debian Bug report #703406,
regarding cowbuilder deletes content of bind-mounted directories
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
703406: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=703406
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cowdancer
Version: 0.71
Tags: patch
Reference issue in Ubuntu [1]
If a bind-mounted directory is still mounted during the clean-up phase
(device busy for example) cowbuilder unconditionally deletes its content.
Excerpt from a log with this bug (complete log attached)
=====
I: umounting /var/lib/jenkins/cu2d
umount: /var/cache/pbuilder/build/cow.15281/var/lib/jenkins/cu2d: device
is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
[...]
-> Cleaning COW directory
forking: rm -rf /var/cache/pbuilder/build//cow.1195
rm: cannot remove
`/var/cache/pbuilder/build//cow.1195/var/cache/pbuilder/ccache': Device
or resource busy
rm: cannot remove
`/var/cache/pbuilder/build//cow.1195/var/lib/jenkins/cu2d/work/experimental/100scopes':
Device or resource busy
rm: cannot remove
`/var/cache/pbuilder/build//cow.1195/var/lib/jenkins/cu2d/launchpad.cache':
Directory not empty
=====
This bug occurs when pbuilder fails to mount a bindmounted directory,
then fails to unmount previously successfully mounted directories. This
condition is not so rare when executing several cowbuilder processes in
parallel using the same bind-mounted directories.
The attached patch has been proposed to Ubuntu and skips cleanup if
anything is mounted under the chroot.
[1] https://bugs.launchpad.net/ubuntu/+source/cowdancer/+bug/1156540
--
Jean-Baptiste
IRC: jibel
diff -Nru cowdancer-0.71/cowbuilder.c cowdancer-0.71ubuntu1/cowbuilder.c
--- cowdancer-0.71/cowbuilder.c 2011-07-29 15:01:39.000000000 +0200
+++ cowdancer-0.71ubuntu1/cowbuilder.c 2013-03-19 09:27:03.000000000 +0100
@@ -46,6 +46,7 @@
#include <sys/wait.h>
#include <string.h>
#include <unistd.h>
+#include <mntent.h>
#include "parameter.h"
#include "ilist.h"
@@ -220,7 +221,61 @@
*/
static int cpbuilder_internal_cleancow(const struct pbuilderconfig* pc)
{
+ /*
+ * A directory bind-mounted into pc->buildplace, will be cleaned out by
+ * rmrf()
+ * To avoid that potential disaster we want to make sure that there is
+ * *nothing* mounted under the chroot before running the cleanup procedure
+ */
+
+ char dest[strlen(pc->buildplace)];
+ int i=0;
+ int j=0;
+ unsigned char ch;
+
printf(" -> Cleaning COW directory\n");
+
+ /* Remove // from pc->buildplace */
+ while(pc->buildplace[i])
+ {
+ ch = pc->buildplace[i];
+ if(i==0)
+ {
+ j++;
+ dest[0] = pc->buildplace[0];
+ }
+ else
+ {
+ if (ch != pc->buildplace[i-1] || ch != '/')
+ {
+ dest[j] = ch;
+ j++;
+ }
+ }
+ i++;
+ }
+ dest[j] = '\0';
+
+ /* Check if buildplace is still mounted */
+ FILE *mtab = NULL;
+ struct mntent * part = NULL;
+ if ((mtab = setmntent("/etc/mtab", "r")) != NULL)
+ {
+ while ((part = getmntent(mtab) ) != NULL)
+ {
+ if ( part->mnt_fsname != NULL )
+ {
+ if (strstr(part->mnt_dir, dest) )
+ {
+ printf("E: Something is still mounted under %s; unmount and
remove %s manually\n", dest, dest);
+ endmntent(mtab);
+ return 1;
+ }
+ }
+ }
+ endmntent(mtab);
+ }
+
if (0!=rmrf(pc->buildplace))
return 1;
return 0;
Binary files /tmp/2njoJ6paZ0/cowdancer-0.71/.cowbuilder.c.swp and
/tmp/C4QmySsSlo/cowdancer-0.71ubuntu1/.cowbuilder.c.swp differ
diff -Nru cowdancer-0.71/debian/changelog cowdancer-0.71ubuntu1/debian/changelog
--- cowdancer-0.71/debian/changelog 2012-08-23 21:51:56.000000000 +0200
+++ cowdancer-0.71ubuntu1/debian/changelog 2013-03-19 09:38:12.000000000
+0100
@@ -1,3 +1,11 @@
+cowdancer (0.71ubuntu1) UNRELEASED; urgency=low
+
+ * A directory bind-mounted into pc->buildplace, will be cleaned out by
+ rmrf() To avoid this disaster, we skip buildplace clean-up if a directory
+ is bind-mounted under the chroot (LP: #1156540)
+
+ -- Jean-Baptiste Lallement <[email protected]> Tue, 19
Mar 2013 09:35:26 +0100
+
cowdancer (0.71) unstable; urgency=low
* copyright file in copyright-format-1.0 as specified in policy version
3.9.3.1
Started by upstream project
"[8mha:AAAArB+LCAAAAAAAAABb85aBtbiIQSajNKU4P08vOT+vOD8nVc+jsiC1KCczL9svvyT1dMUiOWdZ/mImBiZPBrac1Lz0kgwfBubSopwSBiGfrMSyRP2cxLx0/eCSosy8dOuKIgYpNOOcITTIMAYIYGRiYKgoADLUShh09LPyk/STS41SdA0NDIqT8wtSi3VTK4AuyMxNzStJzNE11DMoKEotSCxK1QcA2cXCB7EAAAA=[0mcu2d-100scopes-experimental-1.0prepare"
build number
[8mha:AAAArR+LCAAAAAAAAABdjjsOwjAQBRcjaJEoEXCD2AkdokwDUkTDCUxY5YNZW2sHmetQcxPOwh0ISsdrZqrRe31g4hmWdXfxlmRpyVuDcv9wyKah69EGfMfnOl/NvABxgKlBqkJdwLhjE2BetPquldFUqVPghqpdZFj85fKBvxgMGwmA6HoRAaRq7VmV3eaSZGnqS+vQJxj7B80NKWiTZDJ1jE4zqmz7BZnNiZCzAAAA[0m19
[EnvInject] - Loading node environment variables.
Building on master
[workspace] $ /bin/bash -e /tmp/hudson5834096135151465052.sh
2013-03-18 07:23:59,293 INFO Branching lp:~submarine/ubuntu-scopes/calculator
to unity-scope-calculator
2013-03-18 07:24:46,577 INFO Get changelog info
2013-03-18 07:24:47,711 INFO Get previous version in ppa
2013-03-18 07:25:00,006 INFO A version in the ppa
(0.1daily13.03.15.1ubuntu.unity.experimental.certified-0ubuntu1) is higher than
the proposed version in bzr (0.1-0ubuntu1) (previous tests/builds failing?).
Basing on that one.
2013-03-18 07:25:00,006 INFO Get version available in distro
2013-03-18 07:25:11,203 INFO Check if we need to release a new package
2013-03-18 07:25:11,204 INFO This package was never released to the destination
archive, don't return downloaded source
2013-03-18 07:25:11,204 INFO Update symbol files version if needed
2013-03-18 07:25:11,204 INFO Prepare changelog content
dch warning: Recognised distributions are:
{hardy,lucid,maverick,natty,oneiric,precise,quantal}{,-updates,-security,-proposed,-backports}
and UNRELEASED.
Using your request anyway.
2013-03-18 07:25:13,125 INFO Generate a diff if meaningfull packaging changes
2013-03-18 07:25:13,125 INFO Build source package and upload to the ppa
-> Copying COW directory
forking: rm -rf /var/cache/pbuilder/build//cow.1195
forking: cp -al /var/cache/pbuilder/raring-amd64/base.cow
/var/cache/pbuilder/build//cow.1195
I: removed stale ilistfile /var/cache/pbuilder/build//cow.1195/.ilist
-> Invoking pbuilder
forking: pbuilder execute --bindmounts
/var/lib/jenkins/cu2d/work/experimental/100scopes --bindmounts
/var/lib/jenkins/cu2d --buildplace /var/cache/pbuilder/build//cow.1195
--no-targz --internal-chrootexec chroot /var/cache/pbuilder/build//cow.1195
cow-shell /home/desktop-team/cupstream2distro/chroot-tools/buildsource-chroot
/var/lib/jenkins/cu2d/work/experimental/100scopes/unity-scope-calculator
--gnupg-parentdir /var/lib/jenkins/cu2d --uid 111 --gid 120 --gnupg-keyid
B879A3E9 --distro-version 0
I: Running in no-targz mode
I: copying local configuration
I: mounting /proc filesystem
I: mounting /dev/pts filesystem
I: Mounting /var/cache/pbuilder/ccache
I: Mounting /var/lib/jenkins/cu2d
I: Mounting /var/lib/jenkins/cu2d/work/experimental/100scopes
/usr/lib/pbuilder/pbuilder-modules: line 273: 24886 Alarm clock
mount $MOUNTPARAMS "$mnt" "$BUILDPLACE/$mnt"
I: error recovery: umount successfully mounted mount-points:
/var/cache/pbuilder/build/cow.1195/proc
/var/cache/pbuilder/build/cow.1195/dev/pts /var/cache/pbuilder/ccache
/var/lib/jenkins/cu2d
I: umounting /var/cache/pbuilder/build/cow.1195/proc
I: umounting /var/cache/pbuilder/build/cow.1195/dev/pts
I: umounting /var/cache/pbuilder/ccache
I: umounting /var/lib/jenkins/cu2d
umount: /var/cache/pbuilder/build/cow.15281/var/lib/jenkins/cu2d: device is
busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.1195/var/lib/jenkins/cu2d: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.1197/var/lib/jenkins/cu2d: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.1739/var/lib/jenkins/cu2d: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.59368/var/lib/jenkins/cu2d: not mounted
umount: /var/cache/pbuilder/build/cow.53454/var/lib/jenkins/cu2d: device is
busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.36950/var/lib/jenkins/cu2d: device is
busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.19691/var/lib/jenkins/cu2d: device is
busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
-> Cleaning COW directory
forking: rm -rf /var/cache/pbuilder/build//cow.1195
rm: cannot remove
`/var/cache/pbuilder/build//cow.1195/var/cache/pbuilder/ccache': Device or
resource busy
rm: cannot remove
`/var/cache/pbuilder/build//cow.1195/var/lib/jenkins/cu2d/work/experimental/100scopes':
Device or resource busy
rm: cannot remove
`/var/cache/pbuilder/build//cow.1195/var/lib/jenkins/cu2d/launchpad.cache':
Directory not empty
Traceback (most recent call last):
File "/var/lib/jenkins/cu2d/cupstream2distro/prepare-package", line 166, in
<module>
packagemanager.build_source_package(series, previous_finaledest_version)
File
"/home/desktop-team/cupstream2distro/cupstream2distro/packagemanager.py", line
295, in build_source_package
raise Exception("The above command returned an error.")
Exception: The above command returned an error.
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 70, in
apport_excepthook
binary = os.path.realpath(os.path.join(os.getcwdu(), sys.argv[0]))
OSError: [Errno 2] No such file or directory
Original exception was:
Traceback (most recent call last):
File "/var/lib/jenkins/cu2d/cupstream2distro/prepare-package", line 166, in
<module>
packagemanager.build_source_package(series, previous_finaledest_version)
File
"/home/desktop-team/cupstream2distro/cupstream2distro/packagemanager.py", line
295, in build_source_package
raise Exception("The above command returned an error.")
Exception: The above command returned an error.
Build step 'Execute shell' marked build as failure
Archiving artifacts
Recording test results
Build was marked for publishing on https://jenkins.qa.ubuntu.com/
Notifying upstream projects of job completion
Finished: FAILURE
--- End Message ---
--- Begin Message ---
Source: cowdancer
Source-Version: 0.72
We believe that the bug you reported is fixed in the latest version of
cowdancer, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Junichi Uekawa <[email protected]> (supplier of updated cowdancer package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Sat, 30 Mar 2013 11:05:19 +0900
Source: cowdancer
Binary: cowdancer cowbuilder qemubuilder
Architecture: source amd64
Version: 0.72
Distribution: unstable
Urgency: low
Maintainer: Junichi Uekawa <[email protected]>
Changed-By: Junichi Uekawa <[email protected]>
Description:
cowbuilder - pbuilder running on cowdancer
cowdancer - Copy-on-write directory tree utility.
qemubuilder - pbuilder using QEMU as backend
Closes: 703406
Changes:
cowdancer (0.72) unstable; urgency=low
.
[ Jean-Baptiste Lallement ]
* cowbuilder deletes content of bind-mounted directories (closes: #703406)
- A directory bind-mounted into pc->buildplace, will be cleaned out by
rmrf() To avoid this disaster, we skip buildplace clean-up if a directory
is bind-mounted under the chroot (LP: #1156540)
.
[ Junichi Uekawa ]
* Some refactoring, and removing memory leaks.
* Mark some functions to be static in cowdancer so that they are not
exported.
Checksums-Sha1:
7bb5a8a6d11256fc440cd5b574f0d842a97f98ba 1040 cowdancer_0.72.dsc
c6cde41a036caaddd6ce8922750ede6f65f391e1 89465 cowdancer_0.72.tar.gz
8eb36e9312421e2378222bd69f1c9b2596843af8 35160 cowdancer_0.72_amd64.deb
8e1af7700786f86cced5c6fcbe653e3f33aee6af 33382 cowbuilder_0.72_amd64.deb
d13c20d928d1eba5c238caffe6f11111caac68b7 38106 qemubuilder_0.72_amd64.deb
Checksums-Sha256:
06ebee93929280d7c658c7daf7e1c2a7e01dd6de64e5bfd486f6f3bd170c56c3 1040
cowdancer_0.72.dsc
c74ce5dfe3ac6079ce4698a4f6da92685b14f406fee58049092522975a2c0af2 89465
cowdancer_0.72.tar.gz
e22ffb97d7bc55b1931fe68a777df20410a86bec3bc2fefeb8a5829453f1f06c 35160
cowdancer_0.72_amd64.deb
3a9103aca64f3684a871c8c6cdeb55b8fee0a9e1639846b19e35f6eb8ac922d2 33382
cowbuilder_0.72_amd64.deb
82a0135de38126bfca1de0f3e92652a763235d128ff391c58ac5308a0d3f96d8 38106
qemubuilder_0.72_amd64.deb
Files:
0c91cb082057d5770417b0258921955d 1040 utils optional cowdancer_0.72.dsc
fc1c718e5b6b358db360cdf3c8979f53 89465 utils optional cowdancer_0.72.tar.gz
fc48e5962c074bf5af67fd7fd794cd1c 35160 utils optional cowdancer_0.72_amd64.deb
b395551e491d685c6cc2bde82d9331eb 33382 utils optional cowbuilder_0.72_amd64.deb
e7a832a5be844e779f112cd28dfee40a 38106 utils optional
qemubuilder_0.72_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iD8DBQFRVk+82Dd9TugeVcERAgYQAJ40QLDu6rVtm5y8NwRTJ7NEUhHt4wCfRIJN
pJiu+5MQhRUu95yUm/PPimU=
=/qjv
-----END PGP SIGNATURE-----
--- End Message ---