Sanitizer bug or undefined behavior in format?
Hi, I think it's about rdbuf() which doesn't appear to be virtual. Is this a bug in the sanitizer or is this call not allowed? alt_sstream.hpp: basic_oaltstringstream(stringbuf_t * buf) : pbase_type(buf, No_Op() ), stream_t(rdbuf()) { } $ g++ a.cpp -fsanitize=undefined && ./a.out /usr/include/boost/format/alt_sstream.hpp:146:60: runtime error: member call on address 0x7fffdb4f36a0 which does not point to an object of type 'basic_oaltstringstream' 0x7fffdb4f36a0: note: object has invalid vptr 00 00 00 00 00 00 00 00 00 00 00 00 18 3a 4f db ff 7f 00 00 b0 4c 37 fa 66 55 00 00 28 5b 0d 80 ^~~~~~~~~~~~~~~~~~~~~~~ invalid vptr a.cpp: #include <iostream> int main() { std::cout << boost::format("%d") % 1 << std::endl; // std::cout << boost::format("%04d-%02d-%02d") % (date->tm_year + 1900) % (date->tm_mon + 1) % date->tm_mday << std::endl; return 0; } -- Olaf
2017-06-19 12:10 GMT+02:00 Olaf van der Spek via Boost < boost@lists.boost.org>:
Hi,
I think it's about rdbuf() which doesn't appear to be virtual. Is this a bug in the sanitizer or is this call not allowed?
This may be related to this bug report: https://svn.boost.org/trac10/ticket/11632 Regards, &rzej;
On Mon, Jun 19, 2017 at 12:36 PM, Andrzej Krzemienski via Boost
2017-06-19 12:10 GMT+02:00 Olaf van der Spek via Boost < boost@lists.boost.org>:
Hi,
I think it's about rdbuf() which doesn't appear to be virtual. Is this a bug in the sanitizer or is this call not allowed?
This may be related to this bug report: https://svn.boost.org/trac10/ticket/11632
Right, thx Is Samuel still active? -- Olaf
participants (2)
-
Andrzej Krzemienski
-
Olaf van der Spek