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

api.lua:1242: attempt to index a nil value #35

Open
cheapie opened this issue Feb 1, 2025 · 0 comments
Open

api.lua:1242: attempt to index a nil value #35

cheapie opened this issue Feb 1, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@cheapie
Copy link
Contributor

cheapie commented Feb 1, 2025

api.lua's sign post conversion LBM crashes when encountering a "signs:sign_post" node with certain param2 values. Most likely any param2 value where param2 % 8 >= 4 will do it, but I only tested with 5.

Example output:

ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'signs_lib' in callback LuaLBM::trigger(): ...mt/bin/../games/dreambuilder_game/mods/signs_lib/api.lua:1242: attempt to index a nil value
ERROR[Main]: stack traceback:
ERROR[Main]: 	...mt/bin/../games/dreambuilder_game/mods/signs_lib/api.lua:1242: in function 'func'
ERROR[Main]: 	/home/noah/mt/bin/../builtin/profiler/instrumentation.lua:124: in function 'action'
ERROR[Main]: 	/home/noah/mt/bin/../builtin/game/misc.lua:320: in function </home/noah/mt/bin/../builtin/game/misc.lua:304>

This was initially discovered because it was triggered by a corrupted map, but it is possible (but complex) to trigger it without corruption:

  1. Using another mod, register signs:sign_post as a node, preferably with a paramtype2 value of facedir to make the next step easier.
  2. Place a signs:sign_post node and set its param2 to 5. If paramtype2 is facedir then a screwdriver can probably be used for this.
  3. Reload the mapblock (restarting the server works). The server will crash when the mapblock is loaded.

I suspect other methods of obtaining a signs:sign_post (some old now-removed mod that had it, an old version, or whatever) would have the same effect.

As a side note, does this LBM really need to use run_at_every_load = true? It seems like a textbook example of using false there.

@BuckarooBanzay BuckarooBanzay added the bug Something isn't working label Feb 6, 2025
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

2 participants