Mush 5 crashed during loading script

Posted by Zhenzh on Tue 12 Jun 2018 05:52 PM — 7 posts, 23,921 views.

China #0
My mush 5.06-pre sometimes may get crashed during loading script files with unknown reason.
It does not occur every time. Is there any log for mush itself can be used to isolate the issue?
Australia Forum Administrator #1
Which pre-release do you have? The latest? Some of the earlier ones fixed some crashes.

However there is no log file. Try to narrow the problem down by removing some plugins until the problem goes away and gradually adding them back.
China #2
I used the pre-release committed on Mar 24, 2018
No plugin was used in my environment.

I plan to use the latest pre-release. But I don't find any fix for crash during loading script committed after Mar 24, 2018.
Australia Forum Administrator #3
Well in that case, what is in the script?
China #4
The script is an auto job robot I wrote for the MUD.
What it dose is just load a sqlite3 db for generating gps map.

Quote:

conn=assert(sqlite3.open(GetInfo(67).."JHL/map.db"))

for rooms in conn:nrows("select rowid,name,desc,exits,escroom,zone,escroom,npcs,items,links from rooms") do
map[tostring(rooms["rowid"])] = {
name = rooms["name"],
zone = rooms["zone"]
}
if rooms["desc"] and rooms["desc"] ~= "" then
map[tostring(rooms["rowid"])].desc = rooms["desc"]
end
if rooms["exits"] and string.find(rooms["exits"], ",") then
dynamic_exit_rooms[tostring(rooms["rowid"])] = utils.split(rooms["exits"], ",")
else
if (rooms["desc"] and rooms["desc"] ~= "") or (rooms["exits"] and rooms["exits"] ~= "") then
map[tostring(rooms["rowid"])].exits = rooms["exits"]
end
end
if rooms["escroom"] and rooms["escroom"] ~= "" then
map[tostring(rooms["rowid"])].escroom = rooms["escroom"]
end
if rooms["npcs"] and rooms["npcs"] ~= "" then
map[tostring(rooms["rowid"])].npcs = rooms["npcs"]
end
if rooms["items"] and rooms["items"] ~= "" then
map[tostring(rooms["rowid"])].items = rooms["items"]
end
map[tostring(rooms["rowid"])].links = stringEx.totable(rooms["links"])
end



But I don't think it is the root cause of mush crash as the robot works fine in moste cases. The gps section has been successfully loaded again and again.

It's do hard to isolate the crash issue as I'm not sure whether the crash is caused by some script bug or mush bug.

It may be helpful if there is any way to get crash dump at the point of time failure occur.
Amended on Thu 14 Jun 2018 02:01 PM by Zhenzh
China #5
After investigating crash cases I have had in the past, I think the root case may point to the sqlite3 db loading script I posted above.

I have 3300+ rooms with 10+ fields each room recorded in the db. And some fields may call sub loops also.

The map generation is such a large loop operation so that MUSH may get a computing peak at the point of time when loading script, which may lead to a crash.

I'm not sure wheter the crash is caused by mush of windows itself. Will keep on monitoring the issue.

I'll try shrinking db to double check whether the cause of crash is related to the size of db.
Australia Forum Administrator #6
Possibly you have some sort of recursion issue where you loop and use all the stack? Perhaps put some debugging prints into the script to try to isolate what it is doing at the time (eg. after loading every 500 rooms).