Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test-suite fails when LTO compiler-flag is enabled #933

Open
antonfischl1980 opened this issue Dec 2, 2024 · 0 comments
Open

test-suite fails when LTO compiler-flag is enabled #933

antonfischl1980 opened this issue Dec 2, 2024 · 0 comments

Comments

@antonfischl1980
Copy link

antonfischl1980 commented Dec 2, 2024

Hi,
I'm currently maintaining burp for Gentoo Linux. Our Tinderbox (some kind of automated build box) has run into a problem while running "make test" with burp when using "-flto" flag from gcc.

LTO seeks to optimize the resulting binary as a whole instead of just the object files seperatly.

Compiling and testing burp (from github master) with "-flto" results with a failed test run:

99%: Checks: 233, Failures: 1, Errors: 0
utest/builders/build_asfd_mock.c:77:F:Core:test_phase2_with_slist_changed_files:0: Assertion '!memcmp(expected->buf, wbuf->buf, wbuf->len)' failed
FAIL runner (exit status: 1)

To reproduce it consistently, I use a Dockerfile:

FROM ubuntu:latest
RUN apt-get update && apt-get -y install make pkg-config check g++ librsync-dev libz-dev libssl-dev uthash-dev git autoconf

inside a running container ( docker run --rm -it $(docker build -q .) ) I do:

mkdir -p /test
cd /test
git clone https://github.com/grke/burp.git
cd burp
export COMMON_FLAGS="-O2 -pipe -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
export CFLAGS="${COMMON_FLAGS}"
export CXXFLAGS="${COMMON_FLAGS}"
export FCFLAGS="${COMMON_FLAGS}"
export FFLAGS="${COMMON_FLAGS}"
autoreconf -vif && ./configure && make clean && make && make test-suite.log
cat test-suite.log

Under Gento I tested it with different gcc-versions (11.5.0, 12.4.0, 13.3.1) with the same result.

Sadly, I don't have enough experience in C to find out why this is happening, or what LTO does differently in detail.

Please let me know if you need any more information or if I can be of any more help for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant