1

I'm building a C++ application with g++ and code coverage using a docker container (see below). Everthing is fine until here.

But when I execute the program in the same container

docker run -it ... image /bin/bash -c 'cd build && unbuffer -p ./test_runner && ./collect_gcov.sh'

I always get an error:

libgcov profiling error: .gcda:Version mismatch - expected 9.4 (release) (A94) got 9.3 (release) (A93)*

The point is I'm using a self build docker container which only includes the g++-9 with version 9.4.0. Same for gcc and gcov.

FROM  ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

COPY assets/* /

RUN mv /sources.list /etc/apt/ && \
    mv /localtime /etc && \
    apt update && apt install -y \
      sudo \
      build-essential \
      gcovr \
      lcov \
      cmake \
      git \
      python3

RUN useradd -d /home/jenkins -u 1000 -ms /bin/bash -g root -G sudo -p jenkins jenkins && \
    echo "jenkins ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/jenkins

USER jenkins
ENV HOME /home/jenkins

ENTRYPOINT ["/entrypoint.sh"]

I checked different compiler version etc. But still no clue why this happens. Does anybody had a similar problem before?

Best regards

Malte

galte
  • 11
  • 2
  • `when I execute the program` how do you execute the program? `I'm using a self build docker` how are you using it? – KamilCuk Apr 20 '22 at 12:09
  • docker run -it ... image /bin/bash -c 'cd build && unbuffer -p ./test_runner && ./collect_gcov.sh ' – galte Apr 20 '22 at 13:52

0 Answers0