mushclient crashed with "bad magic"

Posted by Jcl on Tue 15 Oct 2013 04:17 AM — 7 posts, 28,690 views.

#0
Mushclient Version: 4.84

I often encounter that mushclient crashed with "bad magic".
I do not know the exact reason.
But I found that when one line will going to trigger multiple triggers will often lead to crash.
The triggers to be triggered are created by "wait.regexp" in different plug-ins.

For Example:
Line A triggered plugin A, and it created a tigger using "wait.regexp" to wait for Line C.
Line B triggered plugin B, and it created a tigger using "wait.regexp" to wait for Line C.
When Line C arrive, the mushclient will likely to crash.

Australia Forum Administrator #1
Post these triggers please.

Template:copying
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.


Template:version
Please help us by advising the version of MUSHclient you are using. Use the Help menu -> About MUSHclient.
#2
Plugin A:

<triggers>
	<trigger   enabled="y"   regexp="y"   send_to="10"   sequence="10"	match="^.*test1$" script="func" />
</triggers>

<script>
require "wait"

function func()
	wait.make(function()
		wait.regexp("^.*test3$")
		SendNoEcho("say test1 end")
	end)
end
</script>


Plugin B:

<triggers>
	<trigger   enabled="y"   regexp="y"   send_to="10"   sequence="10"	match="^.*test2$" script="func" />
</triggers>

<script>
require "wait"

function func()
	wait.make(function()
		wait.regexp("^.*test3$")
		SendNoEcho("say test2 end")
	end)
end
</script>



First, add plugin A and plugin B into world.
Then, enter command "say test1" to trigger plugin A and enter command "say test2" to trigger plugin B.
Now, enter command "say test3", the mushclient will show error message "Error executing regular expression: Bad magic" and crash.

MUSHClient version is 4.84.

Australia Forum Administrator #3
I can reproduce the problem. MUSHclient crashes under the test conditions. I'm trying to work out why.

My tentative theory is that two triggers (in two plugins) match the same text (test3) and since the way that the wait module works, it omits the trigger after it matches, somehow having both omitted at the same time is causing the crash.
Australia Forum Administrator #4
That bug will be fixed in version 4.91.

https://github.com/nickgammon/mushclient/commit/0cd1b1f73e86
Australia Forum Administrator #5
Version 4.91 now available:

http://www.gammon.com.au/forum/?id=12170
#6
Thank you for your efforts. It looks no problem.