dropbox / json11

A tiny JSON library for C++11.
MIT License
2.55k stars 616 forks source link

ASAN reports runtime error #138

Open tksuoran opened 5 years ago

tksuoran commented 5 years ago

With set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -fno-omit-frame-pointer -fsanitize=address,undefined") set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address,undefined")

I get the following report:

0x603000115b40: note: object has invalid vptr
 18 00 00 66  00 f1 21 58 55 55 00 00  01 00 00 00 01 00 00 00  b8 f2 21 58 55 55 00 00  be be be be
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
/usr/include/c++/8/bits/shared_ptr_base.h:728:4: runtime error: member call on address 0x603000115b40 which does not point to an object of type '_Sp_counted_base'
0x603000115b40: note: object has invalid vptr
 18 00 00 66  00 f1 21 58 55 55 00 00  02 00 00 00 01 00 00 00  b8 f2 21 58 55 55 00 00  be be be be
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr

This is with git cloned a few moments ago. I can dig deeper a bit later. Have you tested json11 with asan?

artwyman commented 5 years ago

I don't know of anyone running asan on this repo before, no. It's cool to see that kind of rigor being applied. I'd be happy to take a look at any PRs which come out of this investigation, personally. Per the maintenance note in the README, this repo isn't actively maintained by Dropbox anymore, so I'm not going to be able to drive such an investigation.