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

StackOverflowError when running inside container #941

Closed
VerKWer opened this issue Feb 29, 2024 · 0 comments
Closed

StackOverflowError when running inside container #941

VerKWer opened this issue Feb 29, 2024 · 0 comments
Milestone

Comments

@VerKWer
Copy link
Contributor

VerKWer commented Feb 29, 2024

Calling LineReaderImpl.redisplay when running in a container started via compose can trigger infinite recursion, eventually throwing a StackOverflowError.

The underlying cause is that under those conditions, LineReaderImpl.size.getRows() is 0. This is a problem because redisplay can eventually call doList, where a certain condition is then always true and the taken branch calls redisplay again.

This does not seem to affect containers started directly via docker run (rather than compose) and the terminal size is set correctly there.

Minimal example to reproduce the issue: https://github.com/VerKWer/jline3-stack-overflow

VerKWer pushed a commit to VerKWer/jline3 that referenced this issue Mar 1, 2024
When running inside a detached Docker container, calling LineReaderImpl.redisplay
resulted in a StackOverflowError. The reason for this is that redisplay eventually
calls doList, which again calls redisplay because the size.getRows() is 0.
@gnodet gnodet added this to the 3.26.0 milestone Mar 8, 2024
@gnodet gnodet closed this as completed in 643b859 Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants