This problem only started after yesterday's fix. Ie, solving one crash in ANTLR has led to another.
Empirical version 0.1.0-10-ge074929
Copyright (C) 2019 Empirical Software Solutions, LLC
>>> 1 +
line 1:2 no viable alternative at input '+'
Error: unable to parse
>>> quit
Segmentation fault: 11
As explained in the bug report today, shared_ptr won't work. The above crash is evidence of that.
For posterity: The exact issue is that ANTLR's error handling relies on exception objects that maintain pointers of state. Only in some cases are those pointers freed.
In C++, throw by default copies the exception object and then invokes its destructor; a catch will receive an exception object whose destructor has previously been evoked!
This problem only started after yesterday's fix. Ie, solving one crash in ANTLR has led to another.
As explained in the bug report today,
shared_ptr
won't work. The above crash is evidence of that.For posterity: The exact issue is that ANTLR's error handling relies on exception objects that maintain pointers of state. Only in some cases are those pointers freed.
In C++,
throw
by default copies the exception object and then invokes its destructor; acatch
will receive an exception object whose destructor has previously been evoked!