# Everything is done on Mac OS X 10.8.4, with llvm/clang/libc++/libc++abi built from source this morning # totclang is an alias for the built clang. $ export LLVM=/Sources/LLVM $ export LIBCXX=$LLVM/libcxx $ export LIBCXXABI=$LLVM/libcxxabi $ totclang -std=c++11 -stdlib=libc++ -I $LIBCXX/include -fsanitize=undefined ubsan.cpp -L $LIBCXX/lib -L $LIBCXXABI/lib -lc++abi $ DYLD_LIBRARY_PATH=$LIBCXX/lib:$LIBCXXABI/lib ./a.out ubsan.cpp:22:5: runtime error: member call on address 0x7fff4fc2eaf0 which does not point to an object of type 'std::runtime_error' 0x7fff4fc2eaf0: note: object is of type 'std::runtime_error' 00 00 00 00 e0 7a b5 10 01 00 00 00 38 39 c0 7b dc 7f 00 00 ac b3 fd 0f 01 00 00 00 5e 20 bd 6f ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'std::runtime_error' <unknown>: runtime error: member call on address 0x7fff4fc2eaf0 which does not point to an object of type 'std::runtime_error' 0x7fff4fc2eaf0: note: object is of type 'std::runtime_error' 00 00 00 00 e0 7a b5 10 01 00 00 00 38 39 c0 7b dc 7f 00 00 ac b3 fd 0f 01 00 00 00 5e 20 bd 6f ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'std::runtime_error' Note: In a non-proportional font, the carets point to the 'e' in "e0 7a" So, what is at address 0x7fff4fc2eaf0? Is it: a) an object of type 'std::runtime_error' b) not an object of type 'std::runtime_error' Or have I completely misinterpreted this? -- Marshall Marshall Clow Idio Software <mailto:mclow.lists at gmail.com> A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki -------------- next part -------------- A non-text attachment was scrubbed... Name: ubsan.cpp Type: application/octet-stream Size: 619 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130730/1a272a30/attachment.obj>
On Tue, Jul 30, 2013 at 2:01 PM, Marshall Clow <mclow.lists at gmail.com> wrote:> # Everything is done on Mac OS X 10.8.4, with llvm/clang/libc++/libc++abi built from source this morning > # totclang is an alias for the built clang. > > $ export LLVM=/Sources/LLVM > $ export LIBCXX=$LLVM/libcxx > $ export LIBCXXABI=$LLVM/libcxxabi > > $ totclang -std=c++11 -stdlib=libc++ -I $LIBCXX/include -fsanitize=undefined ubsan.cpp -L $LIBCXX/lib -L $LIBCXXABI/lib -lc++abi > $ DYLD_LIBRARY_PATH=$LIBCXX/lib:$LIBCXXABI/lib ./a.out > ubsan.cpp:22:5: runtime error: member call on address 0x7fff4fc2eaf0 which does not point to an object of type 'std::runtime_error' > 0x7fff4fc2eaf0: note: object is of type 'std::runtime_error' > 00 00 00 00 e0 7a b5 10 01 00 00 00 38 39 c0 7b dc 7f 00 00 ac b3 fd 0f 01 00 00 00 5e 20 bd 6f > ^~~~~~~~~~~~~~~~~~~~~~~ > vptr for 'std::runtime_error' > <unknown>: runtime error: member call on address 0x7fff4fc2eaf0 which does not point to an object of type 'std::runtime_error' > 0x7fff4fc2eaf0: note: object is of type 'std::runtime_error' > 00 00 00 00 e0 7a b5 10 01 00 00 00 38 39 c0 7b dc 7f 00 00 ac b3 fd 0f 01 00 00 00 5e 20 bd 6f > ^~~~~~~~~~~~~~~~~~~~~~~ > vptr for 'std::runtime_error' > > Note: In a non-proportional font, the carets point to the 'e' in "e0 7a" > > So, what is at address 0x7fff4fc2eaf0? > > Is it: > a) an object of type 'std::runtime_error' > b) not an object of type 'std::runtime_error'Have you considered "c) both"? :) My guess is that there are multiple definitions of std::runtime_error which aren't getting linked together correctly in the process. -Eli