[PATCH] D35159: [libcxxabi][demangler] Use an AST to represent the demangled name
Eric Fiselier via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jul 9 06:14:58 PDT 2017
EricWF added a comment.
This patch causes `test_demangle.pass.cpp` to fail with UBSan.
Standard Error:
--
/home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:113:44: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:47:14: note: nonnull attribute specified here
#0 0x7ff62aae12fb in __cxxabiv1::(anonymous namespace)::stream::operator+=(__cxxabiv1::(anonymous namespace)::string_ref) /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:113:9
#1 0x7ff62aaf9494 in __cxxabiv1::(anonymous namespace)::lambda_type_name::print_left(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:1135:11
#2 0x7ff62aae711a in __cxxabiv1::(anonymous namespace)::node::print(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:233:9
#3 0x7ff62aae711a in __cxxabiv1::(anonymous namespace)::qualified_name::print_left(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:837
#4 0x7ff62aaf0da3 in __cxxabiv1::(anonymous namespace)::node::print(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:233:9
#5 0x7ff62aaf0da3 in __cxxabiv1::(anonymous namespace)::node_array::print_with_seperator(__cxxabiv1::(anonymous namespace)::stream&, __cxxabiv1::(anonymous namespace)::string_ref) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:266
#6 0x7ff62aafa85d in __cxxabiv1::(anonymous namespace)::template_params::print_left(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:901:16
#7 0x7ff62aafaab1 in __cxxabiv1::(anonymous namespace)::node::print(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:233:9
#8 0x7ff62aafaab1 in __cxxabiv1::(anonymous namespace)::name_with_template_args::print_left(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:926
#9 0x7ff62aae70b9 in __cxxabiv1::(anonymous namespace)::node::print(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:233:9
#10 0x7ff62aae70b9 in __cxxabiv1::(anonymous namespace)::qualified_name::print_left(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:834
#11 0x7ff62aafb102 in __cxxabiv1::(anonymous namespace)::node::print(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:233:9
#12 0x7ff62aafb102 in __cxxabiv1::(anonymous namespace)::top_level_function_decl::print_left(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:679
#13 0x7ff62aad779f in __cxxabiv1::(anonymous namespace)::node::print(__cxxabiv1::(anonymous namespace)::stream&) const /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:233:9
#14 0x7ff62aad779f in __cxa_demangle /home/eric/workspace/libcxxabi/src/cxa_demangle.cpp:6313
#15 0x4218a8 in test() /home/eric/workspace/libcxxabi/test/test_demangle.pass.cpp:29682:24
#16 0x422204 in main /home/eric/workspace/libcxxabi/test/test_demangle.pass.cpp:29761:9
#17 0x7ff629f8c82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#18 0x403a78 in _start (/home/eric/workspace/build-libcxxabi/test/Output/test_demangle.pass.cpp.exe+0x403a78)
Other than that I don't see any issues with this change. Thanks for working on this.
https://reviews.llvm.org/D35159
More information about the cfe-commits
mailing list