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

more crashes #81

Closed
fluxionary opened this issue Apr 28, 2023 · 6 comments
Closed

more crashes #81

fluxionary opened this issue Apr 28, 2023 · 6 comments
Labels
Bug Something isn't working
Milestone

Comments

@fluxionary
Copy link
Member

supposedly the two following are when clicking "reply" and "reply all" with no message selected, but i can't replicate the issue:

2023-04-25 21:22:02: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): .../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:53: attempt to index local 'message' (a nil value)
2023-04-25 21:22:02: ERROR[Main]: stack traceback:
2023-04-25 21:22:02: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:53: in function 'replyall'
2023-04-25 21:22:02: ERROR[Main]: 	...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:207: in function 'func'
2023-04-25 21:22:02: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-04-25 21:22:02: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>
2023-04-25 21:45:06: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): .../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:48: attempt to index local 'message' (a nil value)
2023-04-25 21:45:06: ERROR[Main]: stack traceback:
2023-04-25 21:45:06: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:48: in function 'reply'
2023-04-25 21:45:06: ERROR[Main]: 	...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:198: in function 'func'
2023-04-25 21:45:06: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-04-25 21:45:06: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>

the following happens when clicking "read" with no message selected:

...t/bin/../worlds/basic_test/worldmods/mail/ui/message.lua:30: attempt to index local 'message' (a nil value)
stack traceback:
	...t/bin/../worlds/basic_test/worldmods/mail/ui/message.lua:30: in function 'show_message'
	...st/bin/../worlds/basic_test/worldmods/mail/ui/events.lua:169: in function 'func'
	/opt/minetest/bin/../builtin/profiler/instrumentation.lua:108: in function </opt/minetest/bin/../builtin/profiler/instrumentation.lua:101>
	/opt/minetest/bin/../builtin/game/register.lua:448: in function </opt/minetest/bin/../builtin/game/register.lua:434>
@fluxionary fluxionary added the Bug Something isn't working label Apr 28, 2023
@Athozus Athozus added this to the 1.1.4 milestone Apr 29, 2023
@S-S-X
Copy link
Member

S-S-X commented Apr 29, 2023

This doesn't seem good

local message = ""

Also seems this deserves to be linked to #70

@S-S-X
Copy link
Member

S-S-X commented Apr 29, 2023

I think root cause for crash is simply that both loops fail getting message:

mail/storage.lua

Lines 32 to 44 in 47b18f2

function mail.get_message(playername, msg_id)
local entry = mail.get_storage_entry(playername)
for _, msg in ipairs(entry.inbox) do
if msg.id == msg_id then
return msg
end
end
for _, msg in ipairs(entry.outbox) do
if msg.id == msg_id then
return msg
end
end
end

Underlying issue, which seems to be ability to select messages that do not exist, stays even if formspec gets fixed so that normal players wont accidentally trigger these.

@Athozus
Copy link
Member

Athozus commented Apr 29, 2023

@fluxionary what commit are you using ? The latest one or the 1.1.3 release ? I think @S-S-X is right so if you upgrade to last commit it should fix it. For my own I wasn't able to reproduce the crash.

@S-S-X
Copy link
Member

S-S-X commented Apr 29, 2023

I'm not sure what's there in different branches but what I've posted here were all like that in master branch atow.

@Athozus
Copy link
Member

Athozus commented Apr 29, 2023

Yep, I'm talking about 47b18f2 in master.

@fluxionary
Copy link
Member Author

@fluxionary what commit are you using ? The latest one or the 1.1.3 release ? I think @S-S-X is right so if you upgrade to last commit it should fix it. For my own I wasn't able to reproduce the crash.

running the lastest commit, i can't cause any of these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants