ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
and when I start to run it the sanitizer is giving me the following error:
include/parser/atn/ATNDeserializationOptions.h:13:26: runtime error: member access within address 0x000020434200 which does not point to an object of type 'ATNDeserializationOptions'
0x000020434200: note: object has invalid vptr
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
include/parser/atn/ATNDeserializationOptions.h:13:26: runtime error: member access within address 0x000020434200 which does not point to an object of type 'ATNDeserializationOptions'
0x000020434200: note: object has invalid vptr
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
include/parser/atn/ATNDeserializationOptions.h:13:26: runtime error: member access within address 0x000020434200 which does not point to an object of type 'ATNDeserializationOptions'
0x000020434200: note: object has invalid vptr
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
I believe the problem is caused by the ATNDeserializer default constructor, which calls ATNDeserializationOptions::getDefaultOptions(), and that call returns the uninitialized singleton ATNDeserializationOptions::defaultOptions.
One way to fix this is to use a Meyers singleton: move the static ATNDeserializationOptions defaultOptions; out of the class ATNDeserializationOptions and into the body of ATNDeserializationOptions::getDefaultOptions().
I’m running an app compiled with
and when I start to run it the sanitizer is giving me the following error:I believe the problem is caused by the
ATNDeserializer
default constructor, which callsATNDeserializationOptions::getDefaultOptions()
, and that call returns the uninitialized singletonATNDeserializationOptions::defaultOptions
.One way to fix this is to use a Meyers singleton: move the
static ATNDeserializationOptions defaultOptions;
out of theclass ATNDeserializationOptions
and into the body ofATNDeserializationOptions::getDefaultOptions()
.