Crashed after displaying a message

Posted by Jcl2016 on Fri 22 Dec 2017 03:28 PM — 7 posts, 27,896 views.

#0
Occasionally, MUSHclient will crash after displaying a message like "The connection to xxx is currently being established." or "The connection to xxx is not open. Attempt to reconnect?".
At this time, no matter what button you click, the process will just disappear quietly, without anything left.

The most suspicious plug-in I used is the reconnecter.

But I do need the Reconnecter. Can you find out how dit it cause the main program to crash?

By the way, the MUSHclient version is 5.05.
Australia Forum Administrator #1
Which operating system (version) are you using? (eg. Windows 10).

I can't really fix that unless I can reliably reproduce it. Lots of things are happening when it tries to connect. This is a rare bug report. If you can advise a certain sequence of steps that definitely makes it crash then please let me know.

Also, does it crash without the Reconnecter plugin?

(OMG! - that plugin is written in VB - that makes it quite old).
Amended on Sat 23 Dec 2017 10:14 PM by Nick Gammon
Australia Forum Administrator #2
I've made a new version of the Reconnecter plugin that uses Lua. Possibly something in VBscript is making your connection crash. Try this:

Template:saveplugin=Reconnecter_Lua
To save and install the Reconnecter_Lua plugin do this:
  1. Copy the code below (in the code box) to the Clipboard
  2. Open a text editor (such as Notepad) and paste the plugin code into it
  3. Save to disk on your PC, preferably in your plugins directory, as Reconnecter_Lua.xml
    • The "plugins" directory is usually under the "worlds" directory inside where you installed MUSHclient.
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Reconnecter_Lua.xml (which you just saved in step 3) as a plugin
  7. Click "Close"
  8. Save your world file, so that the plugin loads next time you open it.



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient [
  <!ENTITY interval "10" >
  <!ENTITY quit_command "QUIT" >
  <!ENTITY connect_command "CONNECT" >
  <!ENTITY noconnect_command "NOCONNECT" >
]>

<!--
1. Change the entity above "interval" to be the number of seconds
between retries.

2. Change the entity above "quit_command" to be the command you
type to quit (eg. quit, QUIT, @quit or whatever)

3. Change the entity above "connect_command" to be the command you
type to enable connection checking.

4. Change the entity above "noconnect_command" to be the command you
type to disable connection checking.
   
-->

<muclient>
<plugin
   name="Reconnecter_Lua"
   author="Nick Gammon"
   id="42c2c0b90c00344c55eabdfe"
   language="Lua"
   purpose="Reconnects when disconnected"
   date_written="2017-12-24"
   requires="4.00"
   version="1.0"
   >
<description trim="y">
<![CDATA[
This plugin will automatically reconnect you when you are disconnected, 
at a user-configurable interval (say, every 5 seconds)
]]>

Reconnecter:help - this help screen

&connect_command;  - enable recconnection (eg. after using &noconnect_command;)

&noconnect_command; - disable reconnection (eg. if you are leaving the PC)

</description>

</plugin>


<!--  Timers  -->

<timers>
  <timer 
      name="ConnectCheckTimer" 
      script="OnConnectCheckTimer" 
      second="&interval;" 
      active_closed="y" 
      enabled="y">

  </timer>
</timers>

<!--  Aliases  -->

<aliases>
  <alias
   script="OnQuit"
   match="&quit_command;"
   enabled="y"
  >
  </alias>

  <alias
   script="OnConnect"
   match="&connect_command;"
   enabled="y"
  >
  </alias>
  <alias
   script="OnNoConnect"
   match="&noconnect_command;"
   enabled="y"
  >
  </alias>
</aliases>

<!--  Script  -->


<script>
<![CDATA[

retry = 0
did_quit = false

function OnConnectCheckTimer (sName)
--
--  If currently connecting, leave it to do that ...
--

if world.GetInfo (107) then 
  return 
end -- if

--
--  If currently connected, we don't need to check any more
--
if IsConnected () then
  ColourNote ("yellow", "", "World is connected, disabling disconnection check")
  EnableTimer (sName, false)
  return
end -- if

--
--  If deliberate quit, we don't need to check any more
--
if did_quit then
   ColourNote ("yellow", "", "Deliberate quit, disabling disconnection check")
  EnableTimer (sName, false)
  return
end -- if

--
--  OK, we need to connect now ...
--

retry = retry + 1

ColourNote ("yellow", "", "Connecting to world, attempt # " .. retry)
Connect ()

end -- function OnConnectCheckTimer

function OnPluginDisconnect ()
--
--  If deliberate quit, we don't need to enable the connection check
--
if did_quit then
  return
end -- if did a deliberate quite

--
--  We have been disconnected, we need to try connecting again
--
  ColourNote ("yellow", "", "Connection checker enabled")
  EnableTimer ("ConnectCheckTimer", true)
end -- function OnPluginDisconnect

function OnPluginConnect ()
--
--  Now we are connected, no need to keep trying to connect
--
  retry = 0
  EnableTimer ("ConnectCheckTimer", false)
--
--  No deliberate quit yet
--
  did_quit = false
end -- function OnPluginConnect

function OnPluginInstall ()
  DoAfterNote (1, "Connection checker installed.")
end -- function OnPluginInstall

]]>

function OnQuit (sName, sLine, wildcards)
  did_quit = true
  Send ("&quit_command;")  -- send to world so it does it
  ColourNote ("yellow", "", "Deliberate quit (&quit_command;), reconnect disabled")
end -- function OnQuit

function OnConnect (sName, sLine, wildcards)
  ColourNote ("yellow", "", "Connection checker enabled")
  EnableTimer ("ConnectCheckTimer", true)
  did_quit = false
end -- function OnConnect

function OnNoConnect (sName, sLine, wildcards)
  ColourNote ("yellow", "", "Connection checker disabled")
  EnableTimer ("ConnectCheckTimer", false)
  did_quit = true
end -- function OnNoConnect

</script>


<!--  Plugin help  -->

<aliases>
  <alias
   script="OnHelp"
   match="Reconnecter:help"
   enabled="y"
  >
  </alias>
</aliases>

<script>
<![CDATA[
function OnHelp (sName, sLine, wildcards)
  Note (GetPluginInfo (GetPluginID (), 3))
end -- function OnHelp
]]>
</script> 

</muclient>


Remove your "Reconnecter" plugin and replace it by the above one
#3
Nick Gammon said:

Which operating system (version) are you using? (eg. Windows 10).

I can't really fix that unless I can reliably reproduce it. Lots of things are happening when it tries to connect. This is a rare bug report. If you can advise a certain sequence of steps that definitely makes it crash then please let me know.

Also, does it crash without the Reconnecter plugin?

(OMG! - that plugin is written in VB - that makes it quite old).


The OS is Windows 2003 Server Enterprise Edition.
The plugin works well for most of the time, so I can't provide a definite way to let it happen. What I can explain is that the network might be slowly during that time.

It didn't crash without Reconnecter plugin. But once disconnected for a while, the role would be kicked out.

Nick Gammon said:

(OMG! - that plugin is written in VB - that makes it quite old).

The plugin I used is your Lua version.



<plugin
   name="Reconnecter"
   author="Nick Gammon"
   id="dc8cb4a314674db813c12c90"
   language="Lua"
   purpose="Reconnects when disconnected"
   date_written="2007-12-12 11:30:00"
   requires="3.80"
   version="2.0"
   >


It looks the same as your new version.
Australia Forum Administrator #4
Oh! Ah well, I had forgotten, as you see, that I had already converted it. Although the version you are using has a bug near the end. Change:


  Note (GetPluginInfo (GetPluginID, 3))


to:


  Note (GetPluginInfo (GetPluginID (), 3))


I discovered that when testing my newer one. It only applies if you try to get the plugin help by typing "Reconnecter:Help".

The newer one (on this page) also has slightly better colour. I used ColourNote for the various messages rather than Note.




As for your problem, I'll see if I can reproduce it.
#5
Thanks for your attention and efforts. I will wish it.
Australia Forum Administrator #6
We have found a memory corruption issue that may be responsible. In particular, it is likely to happen when certain messages are being displayed, such as the reconnecting message.

Please try the latest pre-release version of MUSHclient. See the link below for how to obtain it.

http://www.gammon.com.au/forum/?id=13903