Fix -fsanitize=vptr badness in <__debug>
authorEric Fiselier <eric@efcs.ca>
Tue, 5 Mar 2019 02:10:31 +0000 (02:10 +0000)
committerEric Fiselier <eric@efcs.ca>
Tue, 5 Mar 2019 02:10:31 +0000 (02:10 +0000)
commit1c014d75b4cdcfab5cef304e5f9c5def96468751
tree5be06a180e101fba1baa66173ee9bd60b254db47
parente69290dc7ff7319acf5904f15ab6630fad07ab58
Fix -fsanitize=vptr badness in <__debug>

Summary:

This patch fixes a lifetime bug when inserting a new container into the debug database. It is
diagnosed by UBSAN when debug mode is enabled. This patch corrects how nodes are constructed
during insertion.

The fix requires unconditionally breaking the debug mode ABI. Users should not expect ABI
stability from debug mode.

Reviewers: ldionne, serge-sans-paille, EricWF

Reviewed By: EricWF

Subscribers: mclow.lists, christof, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D58011

llvm-svn: 355367
libcxx/include/__debug
libcxx/lib/abi/CHANGELOG.TXT
libcxx/lib/abi/x86_64-apple-darwin.v1.abilist
libcxx/lib/abi/x86_64-apple-darwin.v2.abilist
libcxx/lib/abi/x86_64-unknown-linux-gnu.v1.abilist
libcxx/src/debug.cpp
libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
libcxx/utils/libcxx/test/config.py