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
Crash after player leaves game (async callback involved) #8452
Comments
I don't see any |
The output is from I'm not sure if I'll be able to make a mod to reliably reproduce this, I haven't even been able to provoke it again (yet) on the live server. |
Alright, I think I can reproduce the problem on my server.
Steps:
In this case the trailing error messages are triggered as a result. The server did not crash this time. |
I've discovered that trying the same thing using a completely new account actually does provoke the crash. Next step I guess is to see if this happens on an unmodified server running Minetest Game ... Edit: and yes basically the same series of messages is printed as in the first post. |
Alright, here's a test code I cooked up: minetest.register_on_joinplayer(function(player)
local pname = player:get_player_name()
minetest.after(0.1, function()
local player = minetest.get_player_by_name(pname)
if not player then
minetest.log("failed to get player")
return
else
minetest.log("got player")
end
local pos = player:get_pos()
if pos then
minetest.log("got position")
else
minetest.log("failed to get position")
end
end)
end) And here is a sample session from
Steps:
You may need to try several times depending on how fast your computer is. I cannot make the server crash in these tests. I guess that's a unique behavior of the live server, which is quite heavily modded. But |
I see this as a high priority bug if it confirmed. It is very weird behaviour, and explains why there are lots of |
Still happening? |
I can't reproduce this anymore with latest development version. |
* compatibilit with minetest 0.4.17 and 5.0.0 for player object bug Crash after player leaves game (async callback involved) * minetest/minetest#8452
Issue type
Minetest version
Summary
Since this caused the server to crash without any Lua exception reported in
debug.txt
, I'd say it's certainly a bug. It looks like Minetest is giving Lua a non-nil player-ref to my code instead of pushing nil!Sequence of events as nearly as I can tell:
nil
.Example code
I'm using code like this in a lot of places to determine if it is safe to run some function:
Apparently this 'safety check' isn't working anymore ...
The text was updated successfully, but these errors were encountered: