]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: Use -fwrapv.
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 19 Apr 2017 09:34:10 +0000 (11:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 19 Apr 2017 10:14:34 +0000 (12:14 +0200)
commit73bdb325edfc12a58ff6a7ebec77d56d62dcabe0
tree129f93affe13fd89e385f905b4f1de5f486d4f98
parentb83dc3d2ef5ffa882aed926ee4d6a82bd94024f0
BUG/MAJOR: Use -fwrapv.

Haproxy relies on signed integer wraparound on overflow, however this is
really an undefined behavior, so the C compiler is allowed to do whatever
it wants, and clang does exactly that, and that causes problems when the
timer goes from <= INT_MAX to > INT_MAX, and explains the various hangs
reported on FreeBSD every 49.7 days. To make sure we get the intended
behavior, use -fwrapv for now. A proper fix is to switch everything to
unsigned, and it will happen later, but this is simpler, and more likely to
be backported to the stable branches.
Many thanks to David King, Mark S, Dave Cottlehuber, Slawa Olhovchenkov,
Piotr Pawel Stefaniak, and any other I may have forgotten for reporting that
and investigating.
Makefile