Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Bug reports ➜ crash on connect+editbox

crash on connect+editbox

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Fiendish   USA  (2,555 posts)  Bio   Global Moderator
Date Mon 02 May 2011 04:33 PM (UTC)

Amended on Mon 02 May 2011 04:44 PM (UTC) by Fiendish

Message
The following code in a plugin will cause MUSHclient 4.72 to crash (using Windows 7) when included in a world file that gets loaded automatically at program start (but not when loaded while the world is already up and running):

function OnPluginInstall()
    Connect()
    utils.editbox("hello","hello","hello")
end


Or if you have two different plugins, and the first one to load calls

function OnPluginInstall()
    Connect()
end

and the second one to load calls

function OnPluginInstall()
    utils.editbox("hello","hello","hello")
end

That will crash too. But the reverse load order will not.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Fiendish   USA  (2,555 posts)  Bio   Global Moderator
Date Reply #1 on Mon 02 May 2011 05:44 PM (UTC)

Amended on Mon 02 May 2011 05:45 PM (UTC) by Fiendish

Message
If I change the editbox call to be inside of a

DoAfterSpecial(1, ...


Then I tend to (but not always) get "Could not decompress text from MUD: unknown compression method" errors on startup after dismissing the dialog.


DoAfterSpecial(10, ...

seems to work fine, but the delay is rather long and likely system dependent.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 03 May 2011 09:17 AM (UTC)
Message
Sounds like a race condition. I'll look into it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Sun 08 May 2011 03:03 AM (UTC)
Message
Yes, it's a race condition. Plugins are loaded quite early as part of world startup. Some internal structures have not been allocated at that point because, for one thing, we need to know how many lines the user wants in the output buffer in order to allocate a lookup table to quickly index into the buffer.

Calling connect starts a sequence, which, when the connection is established the world tries to send your login name, which then hits this unallocated buffer. The dialog box effectively pauses the loading sequence, making the problem much more prominent.

I have added an extra test for the existence of that buffer before attempting to display things. That at least stops the crash but is not ideal. Some lines are just thrown away.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 08 May 2011 03:15 AM (UTC)
Message
I think it is fixed reasonably well now. I would be cautious about doing stuff like that in OnPluginInstall, but it seems to handle it better now.


https://github.com/nickgammon/mushclient/commit/9ac3d519d5

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,604 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.