Stacktraces reported by Minetest blame the wrong mod
appgurueu opened this issue · comments
Minetest version
5.5.0 and earlier; presumably 5.6-dev as well
Summary
See minetest-mods/wielded_light#21: The stacktrace clearly shows mesecons
is responsible, but the error message blames the wielded_light
mod.
Steps to reproduce
//lua table.insert(minetest.registered_globalsteps, function() _ = nil + nil end)
"From mod X" is saying the get_current_modname
value - wielded_light is the mod that's currently loading. It's not based on stacktrace
It should probably say "error whilst loading mod" rather than "error from mod"
"From mod X" is saying the
get_current_modname
value - wielded_light is the mod that's currently loading. It's not based on stacktraceIt should probably say "error whilst loading mod" rather than "error from mod"
This should be after load time though, unless I misinterpret "in callback environment_Step()"?
On the other hand, the stacktrace clearly points to a chunk that would most likely be loaded at load time (although it could be reloaded at runtime); if this were at load time though, it should correctly detect mesecons as responsible as the mesecons initialization isn't loaded by the wielded light mod.
core.run_callbacks
sets the correct mod origin on a best effort basis:
minetest/builtin/game/register.lua
Lines 421 to 425 in 480d5f2
As you can see if a callback doesn't have a mod origin set the last one will stick around. But without a concrete reproducer there is nothing that can be done about this issue, since it generally works.
core.run_callbacks
sets the correct mod origin on a best effort basis:minetest/builtin/game/register.lua
Lines 421 to 425 in 480d5f2
As you can see if a callback doesn't have a mod origin set the last one will stick around. But without a concrete reproducer there is nothing that can be done about this issue, since it generally works.
That looks like an obvious bug to me. It should clear the "origin" using core.set_last_run_mod"??"
or the like.