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

Segfault on removing autocrafter output pseudo-item #1

Open
Emojigit opened this issue Jan 6, 2024 · 1 comment
Open

Segfault on removing autocrafter output pseudo-item #1

Emojigit opened this issue Jan 6, 2024 · 1 comment

Comments

@Emojigit
Copy link
Member

Emojigit commented Jan 6, 2024

When removing the output pseudo-item from an autocrafter, the server sometimes crashes immediately and CPU usage spikes right after the crash. This was reproducible on this server and Your Land. A similar issue also occurs with techage modpack. This is related to luanti-org/luanti#11805.

Currently, a workaround is installed, blocking any inventory actions on the output slot. To clear the recipe, clear the input slots manually.

-- Autocrafter psudo-item
-- For unknwon reason this is identical to flux's, but trust me, I wrote this without his
-- https://discord.com/channels/369122544273588224/369123275877384192/1193075939903553669
local ndef = minetest.registered_nodes["pipeworks:autocrafter"]
local old_allow_metadata_inventory_put = ndef.allow_metadata_inventory_put
local old_allow_metadata_inventory_take = ndef.allow_metadata_inventory_take
local old_allow_metadata_inventory_move = ndef.allow_metadata_inventory_move
minetest.override_item("pipeworks:autocrafter", {
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if listname == "output" then
return 0
end
return old_allow_metadata_inventory_put(pos, listname, index, stack, player)
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
if listname == "output" then
return 0
end
return old_allow_metadata_inventory_take(pos, listname, index, stack, player)
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
if from_list == "output" or to_list == "output" then
return 0
end
return old_allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
end,
})
minetest.log("action", "[crash_workaround] Autocrafter workaround loaded")

@Emojigit
Copy link
Member Author

This might be fixed, gotta investigate soon.

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

No branches or pull requests

1 participant