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

console hang if user makes a typo while lua is busy #5074

Open
ab9rf opened this issue Dec 2, 2024 · 1 comment · May be fixed by #5075
Open

console hang if user makes a typo while lua is busy #5074

ab9rf opened this issue Dec 2, 2024 · 1 comment · May be fixed by #5075

Comments

@ab9rf
Copy link
Member

ab9rf commented Dec 2, 2024

The console will hang if the user makes a typo in the console while lua is busy

reproduction:
in the launcher, do lua "while(true) do end" (which tosses lua into an infinite loop)
in the console, type any invalid command and hit enter
the console will deadlock

@ab9rf
Copy link
Member Author

ab9rf commented Dec 2, 2024

I believe this is caused by the "invalid command" handler calling into help_helper to display help, which requires acquiring a CoreSuspender. We should use a nonblocking lock acquisition approach here and cause help_helper to downgrade gracefully if it cannot acquire a CoreSuspender instead of deadlocking the console.

ab9rf added a commit to ab9rf/dfhack that referenced this issue Dec 3, 2024
this is an attempted step to improve semantics around core suspenders. this does not actually resolve DFHack#5074 but it is intended as a step toward doing so
@ab9rf ab9rf linked a pull request Dec 3, 2024 that will close this issue
ab9rf added a commit to ab9rf/dfhack that referenced this issue Dec 6, 2024
this is an attempted step to improve semantics around core suspenders. this does not actually resolve DFHack#5074 but it is intended as a step toward doing so
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

Successfully merging a pull request may close this issue.

1 participant