-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
io.popen results in yielded Lua thread #331
Comments
I just tried again and was able to unblock by just pressing Enter once. |
#if defined(LUA_USE_POSIX) /* { */
#define l_popen(L,c,m) (fflush(NULL), popen(c,m))
#define l_pclose(L,file) (pclose(file))
in Lua's The solution is to make our own equivalent to |
So, if I understand correctly, you are saying Wouldn't this be a problem with I'm not that familiar with what is going on here, but would setting Regardless, I hope there is an easy fix. Being able to use |
OS: Ubuntu container
BeamMP-Server Version:
v3.4.1
Describe the bug
Previously, I have used
io.popen
for running some other tools. For example, I have used it as a hack to calldate
to get the current time in UNIX ms. It used to work just fine, reporting the current time pretty quickly. However, I have noticed that it now seems to result in the Lua thread yielding, and it no longer responds to events. Even weirder though is if I then enter the interactive Lua mode in the server console, all I need to do is press Enter and the server resumes my Lua again — until hittingio.popen
again. Even weirder is that if I just runio.popen
in the interactive Lua console, it executes perfectly fine, as expected.I noticed this a few weeks ago, perhaps e2d7721 is responsible, but I haven't had the time to build the server myself and see — just want to get this reported before it gets lost. I want to say that
v3.2.2
was probably the last version I can rememberio.popen
working in.To Reproduce
Steps to reproduce the behavior:
io.popen("date")
. (any program should work)Expected behavior
I would expect
io.popen
to not yield my Lua plugin until something is written to the interactive Lua console. I presume this is an issue withstdin
.Logs
I think I did run the server in debug mode when I first noticed this and there was nothing of use, but I'll try getting a fresh container and plugin going and getting a new log.
The text was updated successfully, but these errors were encountered: