mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2007
Posts: 40
S
silimon Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2007
Posts: 40
I've been working on a script for a few weeks now, and it *appears* to be fairly solid, but causes mIRC to crash at times. Sometimes when you open the options window or a new server window, but other times just randomly while the script is open. It's not a stuck-in-loop kinda thing, the entire program crashes and can't recover. I've looked over the script time and time again but I can't find any obvious flaws, at least not yet.

There are irc-based events in the script, but they check the $server identifier before they do anything, so that's definitely not the cause of crashes with new server windows. It's also based on it's own windows an only attempts to manipulate the windows the script opened itself.

I don't expect anyone to look through my entire script for errors, so I'm just curious if anyone knows what mIRC does when the options window is opened, or when new server windows are opened to see if anything might be related to what my script is doing.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Have you tried it on a different computer? Do you have other scripts loaded at the same time? Are you using any DLLs or COM calls? If mIRC crashes when you open the Options window, you may have a corrupted mirc.ini file. Try renaming it (with mIRC closed) and then run mIRC to recreate a new mirc.ini; load your script file only and see if the crashing continues.

-genius_at_work

Joined: Mar 2007
Posts: 40
S
silimon Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2007
Posts: 40
I haven't tried it on a different computer, but I've had a few friends test it. Some apparently have no problems at all, others have issues with the window maximizing(even though the window command is given fixed parameters for the window size) and others have problems like my own. There are no COM calls or additional DLLs in use and it's the only script loaded at the moment.

The thing about the options window crashing is that it happens erratically and only when the script is in use or has been in use. If I don't bother with it then the options window works fine and nothing crashes.

Joined: Mar 2007
Posts: 40
S
silimon Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2007
Posts: 40
This could be a fluke, but maybe not. My script creates and deletes a number of files for both socket transfers and debugging(at least for the moment), and I managed to find exactly where my script crashed. There's one line that could be remotely out of the ordinary...

bcopy &dump 9 &brushstroke 1 -1

The binvar &dump is only 8 bytes long prior to this bcopy. I've used this method of appending to binvars in the past with no trouble at all, but never this much before. Is this a problem, or is this a valid way of handling binvars?

Joined: Aug 2003
Posts: 144
M
Vogon poet
Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Have you try to quote that line off code and check if the script crash ??

Well that line it´s ok, you are using the bcopy correctly.
Do you know the total lengh off &brushstroke ??
Mybe the lengh off the data is big and your memory size is not that big i think that can create a lack off memory and mIRC can crash because off it.

good luck

Joined: Mar 2007
Posts: 40
S
silimon Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2007
Posts: 40
I can't quote it off, it's vital, and there's a number of bcopy appends like that in the script. I'd have to use bset or something to allocate the extra space in the binvars and then copy over to be sure. I'm positive it's not a memory issue, because I've got plenty of ram and virtual memory.

The reason I thought it *might* be an issue is because, even though mirc lets you use bcopy that way, the additional space for the binvar might not be allocated? smirk

Joined: Mar 2007
Posts: 40
S
silimon Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2007
Posts: 40
I figured this one out. Believe it or not, it had to do with rapid opening and closing of a hidden window I was using for a dynamically sized image buffer. I use this technique in several areas within the script, including a sockread, timer and alias.

Only one caused instability, and that was the alias, which was called by a mouse movement event(within a pic window). Now, mouse movement menu events seem to have priority over many things and are called very rapidly. Somehow, some way, the combination of this event and opening/closing the window made mirc unstable. Go figure.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Your script opened and closed a window with every mouse-move event? If so, I can see how that could crash mIRC. Maybe windows will only allocate a certain number of window handles, possibly per time period (or something like that). Maybe to prevent runaway programs.

-genius_at_work

Joined: Mar 2007
Posts: 40
S
silimon Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2007
Posts: 40
I'm sure there's a bit more to it than that. I need to try to emulate what exactly about my script caused that scenario to crash mirc, but I do know it's not unique to my computer.

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Thanks for looking into this. If you find a way of reproducing this somewhat reliably with your script (a minimal version if possible) please do email it to me and I'll check it out. If I can reproduce the crash I should be able to track down the issue.


Link Copied to Clipboard