Skip to content

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

@antonfischl1980

Description

@antonfischl1980

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions