https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98677

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I can reproduce it in a container using:

FROM ubuntu:20.04
RUN apt-get update
RUN echo 'tzdata tzdata/Areas select Europe' | debconf-set-selections
RUN echo 'tzdata tzdata/Zones/Europe select London' | debconf-set-selections
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
RUN apt-get -y install build-essential clang-10 valgrind
COPY test.cc /tmp/
RUN clang++-10 -fsanitize=undefined -O1 -g /tmp/test.cc -o /tmp/a.out &&
valgrind /tmp/a.out

But it's not caused by the move (it still happens if I copy the state object
instead of moving it). Initializing the _State_base::_M_match_storage buffer
doesn't help. Nothing I changed in the code helped.

I think it's a ubsan bug in clang 10 and clang 11.

Reply via email to