squid3: ftbfs with gcc7: "dynamic exception specifications are deprecated" and other errors

Bug #1712668 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Squid
Unknown
Unknown
squid3 (Debian)
Fix Released
Unknown
squid3 (Ubuntu)
Fix Released
High
Andreas Hasenack

Bug Description

squid 3.5.23 in artful:
(...)
/bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I../.. -I../../include -I../../lib -I../../src -I../../include -isystem /usr/include/mit-krb5 -I../../lib -I/usr/include/libxml2 -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/libxml2 -Wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual -Werror -pipe -D_REENTRANT -m64 -I/usr/include/p11-kit-1 -g -O2 -fdebug-prefix-map=/home/ubuntu/squid3-3.5.23=. -fstack-protector-strong -Wformat -Werror=format-security -c -o ntlmauth.lo ntlmauth.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I../.. -I../../include -I../../lib -I../../src -I../../include -isystem /usr/include/mit-krb5 -I../../lib -I/usr/include/libxml2 -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/libxml2 -Wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual -Werror -pipe -D_REENTRANT -m64 -I/usr/include/p11-kit-1 -g -O2 -fdebug-prefix-map=/home/ubuntu/squid3-3.5.23=. -fstack-protector-strong -Wformat -Werror=format-security -c ntlmauth.cc -fPIC -DPIC -o .libs/ntlmauth.o
In file included from ../../include/util.h:37:0,
                 from ntlmauth.cc:20:
../../include/SquidNew.h:21:51: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated]
 _SQUID_EXTERNNEW_ void *operator new(size_t size) throw (std::bad_alloc)
                                                   ^~~~~
../../include/SquidNew.h:29:54: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated]
 _SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc)
                                                      ^~~~~
cc1plus: all warnings being treated as errors

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

3.5.27 was released with fixes for this. Debian still has 3.5.23

Revision history for this message
Nish Aravamudan (nacc) wrote : Re: [Bug 1712668] [NEW] squid3: ftbfs with gcc7: dynamic exception specifications are deprecated
Revision history for this message
Nish Aravamudan (nacc) wrote : Re: [Bug 1712668] [NEW] squid3: ftbfs with gcc7: dynamic exception specifications are deprecated
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Re: squid3: ftbfs with gcc7: dynamic exception specifications are deprecated

I found several commits upstream about this, still going through them. So far:

commit 286c132b8c067449eefc842c72cdbbcf0a1c54df
Author: Amos Jeffries <email address hidden>
Date: Fri Jun 23 03:31:46 2017 +1200

    Bug 4671 pt3: various GCC 7 compile errors

commit 93454e65b0f71ae6ff981fb74ac0ccc099078cb7
Author: Amos Jeffries <email address hidden>
Date: Thu Jun 22 07:54:39 2017 +1200

    Bug 4671 pt2: GCC 7: raise FTP Gateway CTRL channel buffer to 16KB

yours (https://github.com/squid-cache/squid/commit/39cca4e121215f3f994c1e57f7201ad2a2a2d32a)

Maybe this:
commit 6a41367f4985bf1b3fcd3aa32d1dc9d0108ba350
Author: Lubos Uhliarik <email address hidden>
Date: Mon May 8 23:09:20 2017 +1200

    Bug 4695: squidpurge: GCC 7 build errors

Changed in squid3 (Debian):
status: Unknown → Confirmed
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Re: squid3: ftbfs with gcc7: dynamic exception specifications are deprecated

With those 3 diffs applied, the build progresses further, but now failed at this point:

(...)
purge.cc: In function ‘int log_extended(const char*, int, long int, const SquidMetaList*)’:
purge.cc:258:1: error: ‘%08lx’ directive output truncated writing 16 bytes into a region of size 13 [-Werror=format-truncation=]
 log_extended( const char* fn, int code, long size, const SquidMetaList* meta )
 ^~~~~~~~~~~~

This is probably the fix:
commit 6a41367f4985bf1b3fcd3aa32d1dc9d0108ba350
Author: Lubos Uhliarik <email address hidden>
Date: Mon May 8 23:09:20 2017 +1200

    Bug 4695: squidpurge: GCC 7 build errors

Changed in squid3 (Ubuntu):
importance: Undecided → High
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Ok, with these 4 commits applied, the build works on 64 bits:
https://github.com/squid-cache/squid/commit/85942de8e7b4f8a449d933657fc4a5324a4c5d58
https://github.com/squid-cache/squid/commit/93454e65b0f71ae6ff981fb74ac0ccc099078cb7
https://github.com/squid-cache/squid/commit/286c132b8c067449eefc842c72cdbbcf0a1c54df
https://github.com/squid-cache/squid/commit/6a41367f4985bf1b3fcd3aa32d1dc9d0108ba350

But it fails on 32 bits:
Format.cc: In member function ‘void Format::Format::assemble(MemBuf&, const Pointer&, int) const’:
Format.cc:345:1: error: ‘%0*lld’ directive output may be truncated writing between 1 and 2147483646 bytes into a region of size 1024 [-Werror=format-truncation=]
 Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logSequenceNumber) const
 ^~~~~~

The fix for that seems to be https://github.com/squid-cache/squid/commit/6d19fc4dbb47a9b6993057c8599cd57f29d1475a (thanks @paelzer for finding that one), but it was never applied to the v3.5 branch.

Even the new 3.5.27 upstream release fails to build on i386 with gcc7. I filed this upstream bug about it: <NONE>

Their bugzilla just times out, I can't open a bug. I managed to add a comment to the existing bug about gcc7 failures that is already closed: http://bugs.squid-cache.org/show_bug.cgi?id=4671#c3

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Managed to file http://bugs.squid-cache.org/show_bug.cgi?id=4759

Upstream's response is wontfix.

Revision history for this message
Amos Jeffries (yadi) wrote :

FWIW you managed to submit 6 identical bug reports upstream. The ID of the first was http://bugs.squid-cache.org/show_bug.cgi?id=4759, I've added the explanation there as to why I am not backported the particular patch upstream.

There are probably also some other changes in corner features that got bundled in with other large Squid-4+ features or cosmetic patches that disqualify them in their current forms.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Yeah, sorry about that. I got 6 identical "504 gateway timeout" errors :)

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

And thanks for the quick response.

summary: - squid3: ftbfs with gcc7: dynamic exception specifications are deprecated
+ squid3: ftbfs with gcc7: "dynamic exception specifications are
+ deprecated" and other errors
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package squid3 - 3.5.23-5ubuntu1

---------------
squid3 (3.5.23-5ubuntu1) artful; urgency=medium

  * Merge with Debian unstable (LP: #1712653). Remaining changes:
    - Add additional dep8 tests.
    - Use snakeoil certificates.
    - Add an example refresh pattern for debs.
    - Add disabled by default AppArmor profile.
    - Enable autoreconf. This is no longer required for the security updates,
      but is needed for the seddery of test-suite/Makefile.am in
      d/t/upstream-test-suite.
    - Correct attribution and add explanatory note in d/NEWS.debian.
    - Drop Conflicts/Replaces of squid against squid3. In Ubuntu, the migration
      happened in Xenial, so no upgrade path still requires this code. This
      reduces upgrade ordering difficulty.
    - Adjust seddery for upstream test squid binary location.
    - Revert "Set pidfile for systemd's sysv-generator" from Debian.
    - Drop wrong short-circuiting of various invocations; we always want to
      call the debhelper block.
  * Drop:
    - Add missing Pre-Depends on adduser.
      [Fixed in Debian 3.5.23-2]
  * GCC7 FTBFS fixes (LP: #1712668):
    - d/rules: don't error when hitting the "deprecated" and
      "format-truncation" gcc7 warnings. Upstream 3.5.27 has fixes for these,
      but one in Format.cc that affects 32bit builds was deemed too intrusive
      for the 3.5 stable series and is only in squid 4.x
    - debian/patches/gcc7-squidpurge-4695.patch: GCC 7 build errors.
      Thanks to Lubos Uhliarik <email address hidden>.
    - debian/patches/gcc7-assert-wants-boolean.patch: assert() takes a
      boolean. Thanks to Amos Jeffries <email address hidden>

 -- Andreas Hasenack <email address hidden> Thu, 24 Aug 2017 16:04:35 -0300

Changed in squid3 (Ubuntu):
status: In Progress → Fix Released
Changed in squid3 (Debian):
status: Confirmed → 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.