MUSHclient crashes

Posted by Tsunami on Wed 09 Aug 2006 08:38 PM — 3 posts, 15,900 views.

USA #0
It took me about an hour to track down this bug, and it's still not that specific. At first I hadn't even associated it with scripting. The problem appears to be that when I create a plugin with a trigger in it which calls a script function which has a period in it...

script="table.function"

if the script which defines this function has an error in it, of any kind which would cause it not to compile, when the plugin is loaded, mushclient crashes without any message. I am still trying to narrow down the error further, and I will post again when I have.

-Tsunami
Australia Forum Administrator #1
You can reproduce it really easily. Simply go into the trigger editor (GUI configuration) and put foo.bar as the name of the trigger script. Then it crashes.

The reason for the crash is in a Lua call to extract an item from a table, I wasn't checking if I was supplying a table in the first place. So in your case if the word "foo" is not a table you get a crash. However if foo is a table, but "bar" is not a function then it correctly reports that it can't find bar.

This is fixed in version 3.78 which has now been released.

USA #2
Aye, that was the issue, but in a plugin, there was only one way I could reproduce it. That was with three files, first xml file using an include to call the second which had a trigger in it and a piece of lua to require() the third which had the table and function in it. In any other configuration I tested, the scripting error would be caught before MC tried to pair up triggers and functions, and so it wouldn't crash. In this case however, the scripting error wasn't caught which was the actual bug I was referring to. Hopefully this was fixed as well. Thanks, Tsunami