squid3 FTBFS due to linux-libc-dev and libc6-dev headers mismatch

Bug #1496223 reported by Tiago Stürmer Daitx
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Squid
Unknown
Critical
squid3 (Ubuntu)
Fix Released
High
Unassigned

Bug Description

With the fix at LP: #1496924 applied, squid3 fails due to mismatching headers between linux-libc-dev_4.2.0-10.11 and libc6-dev_2.21-0ubuntu4.

In file included from /usr/include/linux/netfilter.h:7:0,
                 from /usr/include/linux/netfilter_ipv4.h:8,
                 from Intercept.cc:99:
/usr/include/linux/in.h:28:16: error: redeclaration of 'IPPROTO_IP'
   IPPROTO_IP = 0, /* Dummy protocol for TCP */
                ^
In file included from /usr/include/arpa/inet.h:22:0,
                 from ../../include/util.h:42,
                 from ../../include/Array.h:39,
                 from ../../src/comm/forward.h:4,
                 from ../../src/comm/Connection.h:40,
                 from Intercept.cc:34:
/usr/include/netinet/in.h:42:5: note: previous declaration '<anonymous enum> IPPROTO_IP'
     IPPROTO_IP = 0, /* Dummy protocol for TCP. */
     ^
In file included from /usr/include/linux/netfilter.h:7:0,
                 from /usr/include/linux/netfilter_ipv4.h:8,
                 from Intercept.cc:99:
/usr/include/linux/in.h:30:18: error: redeclaration of 'IPPROTO_ICMP'
   IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
                  ^
In file included from /usr/include/arpa/inet.h:22:0,
                 from ../../include/util.h:42,
                 from ../../include/Array.h:39,
                 from ../../src/comm/forward.h:4,
                 from ../../src/comm/Connection.h:40,
                 from Intercept.cc:34:
/usr/include/netinet/in.h:44:5: note: previous declaration '<anonymous enum> IPPROTO_ICMP'
     IPPROTO_ICMP = 1, /* Internet Control Message Protocol. */
     ^
<snip>

Tried to ignore "#include linux/netfilter.h" in src/ip/Intercept.cc:99 to no avail as build fails later on due to missing "SO_ORIGINAL_DST" in Intercept.cc. Removing arpa and netinet header inclusions also lead to eventual build failures due to missing symbols.

So far I have found no way to have squid linking solely to either the kernel or libc without disabling netfilter altogether.

Tags: ftbfs patch
tags: added: ftbfs
description: updated
Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1496223

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Martin Pitt (pitti) wrote :

This doesn't need apport-collect, this is a bug in the header files which is straightforward to reproduce.

Changed in linux (Ubuntu):
importance: Undecided → High
status: Incomplete → Triaged
affects: linux → squid
Revision history for this message
Amos Jeffries (yadi) wrote :

Upstream patch at http://www.squid-cache.org/Versions/v4/changesets/squid-4-14311.patch should apply fairly easily to all Squid versions.

Changed in squid:
importance: Unknown → Critical
Revision history for this message
Amos Jeffries (yadi) wrote :

Also please note that this is not a bug specific to Squid. It is due to the netfilter/in.h having a cross-include collision with the linux-headers-4.2 headers. The kernel maintainers have a patch to try to workaround it, but any software using system headers before netfilter/in.h will FTBS. Squid is just one of those collateral damage applications.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

After applying the patch mentioned in comment #4 the build carries on further, but fails with a new error. This is when building against the new libecap3 library (that's in -proposed), so this might be actually some problem regarding the changes there. But I also tried this patch when building against the old libecap2 and it was still failing in some place (not sure if on the same one though, would have to re-build to fetch the logs). Will try looking into that too. The error log:

Host.cc: In static member function 'static void Adaptation::Ecap::Host::Register()':
Host.cc:130:45: error: invalid new-expression of abstract class type 'Adaptation::Ecap::Host'
         TheHost.reset(new Adaptation::Ecap::Host);
                                             ^
In file included from Host.cc:10:0:
../../../src/adaptation/ecap/Host.h:16:7: note: because the following virtual functions are pure within 'Adaptation::Ecap::Host':
 class Host : public libecap::host::Host
       ^
In file included from ../../../src/adaptation/ecap/Host.h:8:0,
                 from Host.cc:10:
/usr/include/libecap/host/host.h:25:16: note: virtual void libecap::host::Host::noteVersionedService(const char*, const std::tr1::weak_ptr<libecap::adapter::Service>&)
   virtual void noteVersionedService(const char *libEcapVersion, const weak_ptr<adapter::Service> &s) = 0;
                ^
Makefile:439: recipe for target 'libsquid_ecap_la-Host.lo' failed
make[5]: *** [libsquid_ecap_la-Host.lo] Error 1

Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

The squid3_3.3.8-1ubuntu16.debdiff patch requires gcc5 transition of libecap2. I kept the lib soname and added a Conflicts: as per https://wiki.debian.org/TransitionBestPractices

libecap2 and squid3 have been build at
https://launchpad.net/~tdaitx/+archive/ubuntu/testing/+sourcepub/5445490/+listing-archive-extra
https://launchpad.net/~tdaitx/+archive/ubuntu/testing/+sourcepub/5445498/+listing-archive-extra

Revision history for this message
Matthias Klose (doko) wrote :

the libecap patch is wrong. you need to work with package in wily-proposed, which already has the soname bump upstream.

Revision history for this message
Matthias Klose (doko) wrote :

the preferred approach would be to finally merge squid3 after more than three years.

tags: added: patch
Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

I agree that merging the new one is the best approach and rbasak was already working in it, for this reason I was withholding my patches (at the time they required -D_GLIBCXX_USE_CXX11_ABI=0 since I didn't have a libecap2 compiled for gcc5).

I decided to publish my patches for 3.3.8 just in case we don't get it in time and also because yadi said it was better to revert libecap at this time [1] and to avoid duplicated work since sil200 also tried to fix it.

As yadi also commented in [1], Squid 3.3 and 3.4 require libecap 0.20 (libecap2), only squid 3.5 works with libecap 1.0 (libecap3).

[1] https://bugs.launchpad.net/ubuntu/+source/squid3/+bug/1496924/comments/7

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fixes for this bug as well as LP: #1501566 and LP: #1496924" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

libecap3 was been deleted. I have created LP: #1504200 to handle the gcc5 transition. After it gets sponsored it should be ok to apply the squid debdiff.

Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

This patch also fixes LP: #1501566 and LP: #1496924.

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

This bug was fixed in the package squid3 - 3.3.8-1ubuntu16

---------------
squid3 (3.3.8-1ubuntu16) wily; urgency=medium

  [ Tiago Stürmer Daitx ]
  * d/patches/fix-logical-not-parentheses-warning.patch: Fix warning for
    logical-not-parentheses which caused squid to FTBFS. (LP: #1496924)
  * d/patches/netfilter_fix.patch: Backported from Squid Bug #4323.
    (LP: #1496223)
  * d/patches/fix-pod2name-pipe-failure.patch: Add --name parameter to
    pod2man (LP: #1501566)
  * roll back build-dependency to libecap2-dev, this version of squid3 is not
    compatible with libecap3 and libecap3 transition has been rolled back for
    wily.

 -- Steve Langasek <email address hidden> Fri, 09 Oct 2015 00:29:47 +0000

Changed in squid3 (Ubuntu):
status: New → Fix Released
Mathew Hodson (mhodson)
Changed in squid3 (Ubuntu):
importance: Undecided → High
no longer affects: glibc (Ubuntu)
no longer affects: linux (Ubuntu)
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.