Antlr4: [C++] Memory leaks in the C++ runtime related to ParserATNSimulator and SingletonPredictionContext

Created on 9 Jan 2017  路  5Comments  路  Source: antlr/antlr4

Valgrind reports some memory leaks in the C++ runtime on revision aa909ddcb16ed74f571f5 related to ParserATNSimulator and SingletonPredictionContext.

Log: https://gist.github.com/Naios/041853b195dce6de43a2bdd66d4004f3

Im using the lexer and parser as following:
```c++
GeneratedLexer lexer(&input);
auto errorListener = createDiagnosticListener(this);
lexer.removeErrorListeners();
lexer.addErrorListener(errorListener.get());

auto tokens = std::make_shared(&lexer);

...

GeneratedParser parser(tokens.get());
parser.removeErrorListeners();
parser.addErrorListener(errorListener.get());
auto compilationUnit = parser.compilationUnit(); // compilationUnit is freed by the antlr4 runtime
LocalScopeVisitor localScopeVisitor(compilationUnit_, astContext);
compilationUnit->accept(&localScopeVisitor);
````

Most helpful comment

Oracle, are you listening? Please fund Mike so he can work 20% on Antlr. It will become so good that you can use it as the Java 10 parser.

All 5 comments

I'll see what I can do there...

@mike-lischke memory leaks in the cpp runtime causes me pain in an interpreter where I re-eval repeatedly, so it adds up quickly. Any progress on this one?

To be honest, I can't say when I come around to look at this. So many things on the agenda. But I keep trying...

Oracle, are you listening? Please fund Mike so he can work 20% on Antlr. It will become so good that you can use it as the Java 10 parser.

@pureformat Have you done any recent checks again? Could be this issue is solved now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

willfaught picture willfaught  路  9Comments

davidfetter picture davidfetter  路  6Comments

rpinchbeck picture rpinchbeck  路  9Comments

tzmfreedom picture tzmfreedom  路  8Comments

prashast picture prashast  路  7Comments