Sokomine / markers

markers for the Minetest mod "areas"
9 stars 10 forks source link

Unhandled exception #2

Open Zeno- opened 10 years ago

Zeno- commented 10 years ago

minetestserver 0.4.9-257-gf70e055

ERROR: An unhandled exception occurred: ...minetest/worlds/zenoworld/worldmods/markers/init.lua:339: attempt to index field '?' (a nil value) stack traceback: ...minetest/worlds/zenoworld/worldmods/markers/init.lua:339: in function 'get_marker_formspec' ...minetest/worlds/zenoworld/worldmods/markers/init.lua:600: in function 'on_rightclick' /home/zeno/minetest/bin/../builtin/game/item.lua:326: in function </home/zeno/minetest/bin/../builtin/game/item.lua:319> (tail call): ?

davisonio commented 10 years ago

I'm getting this same issue.

LazyJ commented 10 years ago

Similar error on minetest 0.4.10, 2014_08_25 release:

00:37:51: ERROR[main]: ERROR: An unhandled exception occurred: ...t-0.4.10/bin/../mods/markers_2014_01_27/markers/init.lua:342: attempt to index a nil value
00:37:51: ERROR[main]: stack traceback:
00:37:51: ERROR[main]:  ...t-0.4.10/bin/../mods/markers_2014_01_27/markers/init.lua:342: in function 'get_marker_formspec'
00:37:51: ERROR[main]:  ...t-0.4.10/bin/../mods/markers_2014_01_27/markers/init.lua:610: in function 'on_rightclick'
00:37:51: ERROR[main]:  /home/minetest/minetest-0.4.10/bin/../builtin/game/item.lua:326: in function </home/minetest/minetest-0.4.10/bin/../builtin/game/item.lua:319>

The line numbers in the error don't match the original code due to my comments I've added when increasing the markers.MAX_SIZE.

    337       -- check if they fit
    338       for i=1,3 do
    339
    340          if(not( ((n-i) == opposite )
    341              or not(markers.positions[ name ][ n-i ] )
    342              or  ( markers.positions[ name ][ n-i ].x == coords[ 1 ].x
    343                and markers.positions[ name ][ n-i ].z == coords[ 2 ].z )
    344              or  ( markers.positions[ name ][ n-i ].x == coords[ 2 ].x
    345                and markers.positions[ name ][ n-i ].z == coords[ 1 ].z ))) then
    346
    347             return formspec_info.."Error: The last 4 markers\nyou placed do not form\na rectangle.]";
    348          end
    349
    350       end
ghost commented 10 years ago

I have this issue too.

Megaf commented 10 years ago

Same issue here. I believe this happens when a user places more than 4 markers.

21:33:13: ACTION[ServerThread]: daZe digs default:dirt at (-65,15,-229)
21:33:22: ACTION[ServerThread]: CHAT: <Jessch8281> Nevermind
21:33:26: ACTION[ServerThread]: Jessch8281 digs default:apple at (-77,22,-263)
21:33:34: ACTION[ServerThread]: player Jessch8281 crafts markers:mark 4
21:33:35: ACTION[ServerThread]: CHAT: <daZe> i am lollypop :) the famous lollypop
21:33:37: ACTION[ServerThread]: Jessch8281 places node markers:mark at (-64,15,-229)
21:33:37: ACTION[ServerThread]: facedir: 1
21:33:39: ACTION[ServerThread]: Jessch8281 places node markers:mark at (-64,16,-229)
21:33:39: ACTION[ServerThread]: facedir: 1
21:33:41: ACTION[ServerThread]: Jessch8281 places node markers:mark at (-64,17,-229)
21:33:41: ACTION[ServerThread]: facedir: 1
21:33:42: ACTION[ServerThread]: Jessch8281 places node markers:mark at (-64,18,-229)
21:33:42: ACTION[ServerThread]: facedir: 1
21:33:43: ACTION[ServerThread]: Jessch8281 places node markers:mark at (-64,19,-229)
21:33:43: ACTION[ServerThread]: facedir: 1
21:33:45: ACTION[ServerThread]: CHAT: <Jessch8281> Woot
21:33:47: ACTION[ServerThread]: CHAT: <Jessch8281> daZe :P
21:33:51: ACTION[ServerThread]: CHAT: <Jessch8281> Hehe
21:34:04: ERROR[main]: ERROR: An unhandled exception occurred: /home/minetest/Server/bin/../mods/markers/init.lua:339: attempt to index a nil value
21:34:04: ERROR[main]: stack traceback:
21:34:04: ERROR[main]:  /home/minetest/Server/bin/../mods/markers/init.lua:339: in function 'get_marker_formspec'
21:34:04: ERROR[main]:  /home/minetest/Server/bin/../mods/markers/init.lua:600: in function 'on_rightclick'
21:34:04: ERROR[main]:  /home/minetest/Server/bin/../builtin/game/item.lua:326: in function </home/minetest/Server/bin/../builtin/game/item.lua:319>

In thread 7fde45474760:
/home/minetest/Server/src/main.cpp:1955: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 7fde3e54b700:
#0  virtual void* CurlFetchThread::Thread()
DEBUG STACK FOR THREAD 7fde45474760:
#0  int main(int, char**)
(Leftover data: #1  Dedicated server branch)
(Leftover data: #2  virtual void ServerMap::save(ModifiedState))
(Leftover data: #3  void ItemStack::serialize(std::ostream&) const)
Aborted
Fritigern commented 10 years ago

Same error here.

01:00:27: ACTION[ServerThread]: <USERNAME_WITHELD> places node markers:mark at (408,1,-254)
01:00:27: ACTION[ServerThread]: facedir: 3
01:00:30: ACTION[main]: IRC: Disconnected.
01:00:31: ERROR[main]: WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.WARNING: endSave() failed, map might not have saved.WARNING: beginSave() failed, saving might be slow.ERROR: An unhandled exception occurred: ...test/bin/../worlds/Pacata/worldmods/markers/init.lua:340: attempt to index field '?' (a nil value)
01:00:31: ERROR[main]: stack traceback:
01:00:31: ERROR[main]:  ...test/bin/../worlds/Pacata/worldmods/markers/init.lua:340: in function 'get_marker_formspec'
01:00:31: ERROR[main]:  ...test/bin/../worlds/Pacata/worldmods/markers/init.lua:601: in function 'on_rightclick'
01:00:31: ERROR[main]:  /home/balaam/Minetest/bin/../builtin/game/item.lua:326: in function </home/balaam/Minetest/bin/../builtin/game/item.lua:319>
01:00:31: ERROR[main]:  (tail call): ?

I have found that this is caused by placing four markers in a straight line. Right-clicking the last marker then causes an unhandled exception to occur. Until this is fixed, this behaviour effectively turns this mod into a tool for griefers.

Sokomine commented 9 years ago

The issue ought to be fixed now. Please test the latest version!