Skip to content
Discussion options

You must be logged in to vote

The problem is in merge(). When two threads are working on the same context, one thread can create a partially completed result that another thread reads. When this happens, the parent chains can become circular.

Yes, it's a bug. We could fix it by single-threading merge(), but that would kill performance. So, it's recommended to just replace the DFA[] and PredictionContextCache caches. Admittedly a hack.

So, here is an update to your code that seems to work.
antlr-report-fixed.zip It changes four things.

  1. Removed clearDFA() calls

Deleted plsqlParser.getInterpreter().clearDFA() and lexer.getInterpreter().clearDFA() after each parse.

Why? The DFA is a shared static state across all parser…

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@kaby76
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@davdres
Comment options

@kaby76
Comment options

Comment options

You must be logged in to vote
1 reply
@davdres
Comment options

Answer selected by davdres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants