clamav 0.95(.1) build fails with fakeroot on Intrepid due to race condition

Bug #360122 reported by Imre Gergely
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fakeroot (Debian)
Fix Released
Unknown
fakeroot (Ubuntu)
Fix Released
Undecided
Unassigned
Dapper
Won't Fix
High
Unassigned
Gutsy
Won't Fix
High
Unassigned
Hardy
Fix Released
High
Unassigned
Intrepid
Fix Released
High
Unassigned

Bug Description

Binary package hint: fakeroot

clamav version: 0.95.1
fakeroot version: 1.9.5

clamav 0.95.1 is in Jaunty main. Tried to build the package for Intrepid backporting, uploaded to the ubuntu-clamav PPA, but it failed to build.

Tried to build it locally with intrepid pbuilder (for i386) on an x86_64 intrepid install, but it failed. Specifically there are some stress tests for clamav, and the testing part for clamd just hangs forever (the launchpad build system had to kill the build after two hours).

When building the package with debuild -rsudo, or './configure; make check' in the same environment, or disabling these tests, it's building OK. Only when there's fakeroot involved, it doesn't build, it hangs.

Checked up with clamav guys on FreeNode#clamav, and it seems to be the bug

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499142

which got fixed in Jaunty (on Jaunty the package builds without problems). On Intrepid there's an older version, 1.9.5.

Is there a way to backport fakeroot 1.12.1 from Jaunty to Intrepid (and possibly Hardy) too ? As far as I can tell, launchpad's build system is also using fakeroot 1.9.5 for Intrepid package builds (at least for PPA package building).

See this buildlog, near the end, search for "test_connections":

http://launchpadlibrarian.net/25273212/buildlog_ubuntu-intrepid-i386.clamav_0.95.1%2Bdfsg-0ubuntu1~intrepid1~ppa1_FAILEDTOBUILD.txt.gz

gdb 'thread apply all bt' output for one of the test processes that hangs.

http://pastebin.ubuntu.com/149383/

TEST CASE:
 Download clamav 0.95.1 source package from Jaunty, try building a package with pbuilder for Intrepid (which uses fakeroot 1.9.5). After compiling it moves on to do some stress testing of clamav, clamscan, clamd. At clamd it does all the tests, gives one error and hangs forever. Look for this output:
Running suite(s): clamd
 98%: Checks: 77, Failures: 0, Errors: 1
 check_clamd.c:205:E:clamd stress test:test_connections:0: (after this point) Test timeout expired
***
 *** Failed clamd protocol test!
 ***
After this it just hangs and does not do anything. Look at the process list, there should be a clamd/clamdscan process, run a strace -p <pid>, it should be stuck at semop(...). The build process must be aborted with Ctrl+C.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Already fixed in Jaunty

Changed in fakeroot (Ubuntu):
status: New → Fix Released
Revision history for this message
Scott Kitterman (kitterman) wrote :

This is eventually likely to interfere with security updates on Intrepid, so we need to consider how to deal with it in -security too.

Changed in fakeroot (Ubuntu Intrepid):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Imre Gergely (cemc) wrote :

Patched fakeroot 1.9.5 source package from Intrepid with the one-liner from

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499142

installed the package in an Intrepid pbuilder environment, and succesfully built clamav 0.95.1, which previously failed to build. It didn't hang this time, all the tests completed error-free.

Revision history for this message
Imre Gergely (cemc) wrote :

One-liner tested on Hardy's fakeroot-1.9, it works.

Changed in fakeroot (Ubuntu Hardy):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Scott Kitterman (kitterman) wrote :

wontfix Gutsy due to near eol.

Changed in fakeroot (Ubuntu Gutsy):
importance: Undecided → High
status: New → Won't Fix
Changed in fakeroot (Ubuntu Dapper):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Imre Gergely (cemc) wrote :

fakeroot (1.9.5ubuntu2) intrepid; urgency=low

  * fixed deadlock problem when using threads (LP: #360122)
    - fixed with patch from fakeroot 1.11 (#499142)

 -- Imre Gergely <email address hidden> Mon, 13 Apr 2009 17:05:29 +0300

Revision history for this message
Imre Gergely (cemc) wrote :

TEST CASE:
Download clamav 0.95.1 source package from Jaunty, try building a package with pbuilder for Intrepid (which uses fakeroot 1.9.5). After compiling it moves on to do some stress testing of clamav, clamscan, clamd. At clamd it does all the tests, gives one error and hangs forever. Look for this output:

Running suite(s): clamd
98%: Checks: 77, Failures: 0, Errors: 1
check_clamd.c:205:E:clamd stress test:test_connections:0: (after this point) Test timeout expired

***
*** Failed clamd protocol test!
***

After this it just hangs and does not do anything. Look at the process list, there should be a clamd/clamdscan process, run a strace -p <pid>, it should be stuck at semop(...). The build process must be aborted with Ctrl+C.

Revision history for this message
Imre Gergely (cemc) wrote :

fakeroot (1.9.5ubuntu1.1) intrepid-proposed; urgency=low

  * fixed deadlock problem when using threads (LP: #360122)
    - fixed with patch from fakeroot 1.11 (#499142)

 -- Imre Gergely <email address hidden> Mon, 13 Apr 2009 17:27:33 +0300

Revision history for this message
Imre Gergely (cemc) wrote :

fakeroot (1.9ubuntu1.1) hardy-proposed; urgency=low

  * fixed deadlock problem when using threads (LP: #360122)
    - fixed with patch from fakeroot 1.11 (#499142)

 -- Imre Gergely <email address hidden> Mon, 13 Apr 2009 17:55:23 +0300

description: updated
summary: - clamav 0.95(.1) build fails with fakeroot on Intrepid
+ clamav 0.95(.1) build fails with fakeroot on Intrepid due to race
+ condition
Revision history for this message
Imre Gergely (cemc) wrote :

fakeroot (1.5.6ubuntu2.1) dapper-proposed; urgency=low

  * fixed deadlock problem when using threads (LP: #360122)
    - fixed with patch from fakeroot 1.11 (#499142)

 -- Imre Gergely <email address hidden> Mon, 13 Apr 2009 18:01:56 +0300

Revision history for this message
Scott Kitterman (kitterman) wrote :

Uploaded for Intrepid. Waiting for Ubuntu SRU to accept it for testing.

Changed in fakeroot (Ubuntu Intrepid):
status: Confirmed → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into intrepid-proposed; please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Scott Kitterman (kitterman) wrote :

Hardy uploaded. Waiting for it to get accepted.

Changed in fakeroot (Ubuntu Hardy):
status: Confirmed → Fix Committed
Revision history for this message
Scott Kitterman (kitterman) wrote :

Uploaded for Dapper. Waiting for it to be accepted.

Changed in fakeroot (Ubuntu Dapper):
status: Confirmed → Fix Committed
Revision history for this message
Scott Kitterman (kitterman) wrote :

In order to test this fix I uploaded a version of clamav the runs its test suite to the ubuntu-clamav PPA. As expected, it FTBFS on all archs. I've left it un-retried on lpia for the full log: https://launchpad.net/~ubuntu-clamav/+archive/ppa/+build/949389

The error was:

Running suite(s): clamd
94%: Checks: 77, Failures: 0, Errors: 4
check_clamd.c:398:E:clamd stress test:test_fildes_many:0: (after this point) Test timeout expired
check_clamd.c:205:E:clamd stress test:test_idsession_stress:0: (after this point) Test timeout expired
check_clamd.c:205:E:clamd stress test:test_fildes_unwanted:0: (after this point) Test timeout expired
check_clamd.c:68:E:clamd stress test:test_connections:0: (after this point) Test timeout expired

***
*** Failed clamd protocol test!
***

Session terminated, killing shell...make[1]: *** wait: No child processes. Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: *** wait: No child processes. Stop.
make: *** wait: No child processes. Stop.
make: *** Waiting for unfinished jobs....
make: *** wait: No child processes. Stop.
make[3]: *** [check-TESTS] Terminated
make[2]: *** [check-am] Terminated
 ...killed.
Build killed with signal 15 after 150 minutes of inactivity
******************************************************************************
Build finished at 20090415-1916
FAILED [dpkg-buildpackage died]

Then I added -proposed to the PPA and retried. Now the build succeeds:

https://launchpad.net/~ubuntu-clamav/+archive/ppa/+build/949388

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package fakeroot - 1.9.5ubuntu1.1

---------------
fakeroot (1.9.5ubuntu1.1) intrepid-proposed; urgency=low

  * fixed deadlock problem when using threads (LP: #360122)
    - fixed with patch from fakeroot 1.11 (#499142)

 -- Imre Gergely <email address hidden> Mon, 13 Apr 2009 17:27:33 +0300

Changed in fakeroot (Ubuntu Intrepid):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Resetting v-done tag for dapper/hardy

tags: removed: verification-done
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into hardy-proposed; please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into dapper-proposed; please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Revision history for this message
Imre Gergely (cemc) wrote :

For testing fakeroot from -proposed in Hardy, I followed the same procedure as Scott above. I've uploaded clamav to the PPA with tests enabled, it failed to build on archs. Here's the failed lpia build:

https://launchpad.net/~ubuntu-clamav/+archive/ppa/+build/955819

The relevant snip if the build log disappears:

Running suite(s): clamd
94%: Checks: 77, Failures: 0, Errors: 4
check_clamd.c:398:E:clamd stress test:test_fildes_many:0: (after this point) Test timeout expired
check_clamd.c:205:E:clamd stress test:test_idsession_stress:0: (after this point) Test timeout expired
check_clamd.c:205:E:clamd stress test:test_fildes_unwanted:0: (after this point) Test timeout expired
check_clamd.c:68:E:clamd stress test:test_connections:0: (after this point) Test timeout expired

***
*** Failed clamd protocol test!
***

Session terminated, killing shell...make[1]: *** [check-recursive] Terminated
make: *** [check] Terminated
make[3]: *** [check-TESTS] Terminated
make[2]: *** [check-am] Terminated
 ...killed.
Build killed with signal 15 after 150 minutes of inactivity
******************************************************************************
Build finished at 20090421-1220
FAILED [dpkg-buildpackage died]
Purging chroot-autobuild/build/buildd/clamav-0.95.1+dfsg

After this I added -proposed to the PPA dependecies (with the new fakeroot in it) and did a retry on the i386 build. As expected, it built without problems:

https://launchpad.net/~ubuntu-clamav/+archive/ppa/+build/955818

Revision history for this message
Imre Gergely (cemc) wrote :

I couldn't test it with the above method on Dapper, because on Dapper the stress tests which would block fakeroot don't get run because of old versions. From the build log:

*** Check version too old, clamd tests not run!

So by not running these tests at build time, the build is just fine, there is no error.

For testing's sake I added -proposed and rebuilt the package with the new fakeroot, and it did build, although this doesn't prove anything, just that it didn't break the build.

Here's a build without -proposed (without the new fakeroot):

https://launchpad.net/~ubuntu-clamav/+archive/ppa/+build/955821

And the build with -proposed enabled (with the new fakeroot):

https://launchpad.net/~ubuntu-clamav/+archive/ppa/+build/956212

I still think it would be a good idea to SRU this to Dapper, too. Would there be any problem to SRU this without further testing?

Revision history for this message
Imre Gergely (cemc) wrote :

Updated the 'check' package for Dapper in the PPA, and rebuilt the clamav package. Now it did run all the tests necessary and it didn't fail. Buildlog:

https://launchpad.net/~ubuntu-clamav/+archive/ppa/+build/956763

And the relevant part:

Running suite(s): clamd
100%: Checks: 77, Failures: 0, Errors: 0

This would mean the fakeroot package is OK on Dapper, too.

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks for testing! I consider hardy verified.

If we don't need the fakeroot SRU for dapper, then let's not do it. No need to potentially break builds for that LTS.

I removed the dapper SRU from -proposed again.

tags: added: verification-done
removed: verification-needed
Changed in fakeroot (Ubuntu Dapper):
status: Fix Committed → Won't Fix
Revision history for this message
Imre Gergely (cemc) wrote :

We don't need the new fakeroot in Dapper to build this package (clamav), but it does fail to build when stress tests are run.

Here's a build that failed on Dapper without the new fakeroot (and with added new 'check' package for the tests to run):

https://launchpad.net/~ubuntu-clamav/+archive/ppa/+build/956778

It's not a show stopper for clamav backporting, but you may want to consider the SRU if/when somebody else runs into this problem (if ever) with another package.

Thanks.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package fakeroot - 1.9ubuntu1.1

---------------
fakeroot (1.9ubuntu1.1) hardy-proposed; urgency=low

  * fixed deadlock problem when using threads (LP: #360122)
    - fixed with patch from fakeroot 1.11 (#499142)

 -- Imre Gergely <email address hidden> Mon, 13 Apr 2009 17:55:23 +0300

Changed in fakeroot (Ubuntu Hardy):
status: Fix Committed → Fix Released
Changed in fakeroot (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.