Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphTokenStreamFiniteStrings#articulationPointsRecurse can run into stack overflows [LUCENE-10181] #11218

Closed
asfimport opened this issue Oct 15, 2021 · 5 comments · Fixed by #12249

Comments

@asfimport
Copy link

If provided with a very long query string, GraphTokenStreamFiniteStrings#articulationPointsRecurse may run into a StackOverflowError.


Migrated from LUCENE-10181 by Adrien Grand (@jpountz)

@asfimport
Copy link
Author

Adrien Grand (@jpountz) (migrated from JIRA)

I'm not familiar with this code but it looks like it's already tracking the recursion depth for other purposes, so maybe we could fail when the recursion depth goes beyond an arbitrary threshold?

@hassenome
Copy link

Hello,
We are facing this error, as a root cause for a feature used by ElasticSearch. We are wondering if there is an update to this issue?

@mkhludnev
Copy link
Member

@hassenome , can you share versions, stacktrace and invocation arguments?

@naddame
Copy link

naddame commented Jan 23, 2023

Hi @mkhludnev we have the same problem with elasticsearch version 8.3.2

Our application is used for search engine in ecommerce context. We use multi_match query with this params

"minimum_should_match": "2<70%", "type": "cross_fields", "tie_breaker": 0.2

I the same query we also compute multiple aggregations ...

Stacktrace
"@timestamp":"2022-12-26T14:10:58.852Z", "log.level":"ERROR", "message":"fatal error in thread [elasticsearch[digital-factory-es-data-es-data-0][search][T#10]], exiting", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"elasticsearch[digital-factory-es-data-es-data-0][search][T#10]","log.logger":"org.elasticsearch.bootstrap.ElasticsearchUncaughtExceptionHandler","elasticsearch.cluster.uuid":"EV6k1dWKQn-LCNIAnpPHPQ","[elasticsearch.node.id](http://elasticsearch.node.id/)":"Cx-ue506R4i7bbfEnPtS4Q","elasticsearch.node.name":"digital-factory-es-data-es-data-0","elasticsearch.cluster.name":"digital-factory-es-data","error.type":"java.lang.StackOverflowError","error.stack_trace":"java.lang.StackOverflowError\n\tat org.apache.lucene.core@9.2.0/org.apache.lucene.util.graph.GraphTokenStreamFiniteStrings.articulationPointsRecurse(GraphTokenStreamFiniteStrings.java:274)\n\tat org.apache.lucene.core@9.2.0/org.apache.lucene.util.graph.GraphTokenStreamFiniteStrings.articulationPointsRecurse(GraphTokenStreamFiniteStrings.java:274)\n\tat org.apache.lucene.core@9.2.0/org.apache.lucene.util.graph.GraphTokenStreamFiniteStrings.articulationPointsRecurse(GraphTokenStreamFiniteStrings.java:274)\n\tat org.apache.lucene.core@9.2.0/org.apache.lucene.util.graph.GraphTokenStreamFiniteStrings.articulationPointsRecurse(GraphTokenStreamFiniteStrings.java:274)\n\tat

@cfournie
Copy link
Contributor

cfournie commented Apr 27, 2023

Based on @jpountz 's suggestion, in #12249 I've experimented with adding a limit on the recursion depth to prevent throwing a StackOverflowError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants