mIRC Home    About    Download    Register    News    Help

Print Thread
crash when closing status window in on disconnect #157644 27/08/06 03:38 AM
Joined: Jan 2004
Posts: 162
R
RRX Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
I saw sometimes crashes while connecting to a series networks (using a script) upon mIRC start. They occurred shortly after a connection was refused (ON ERROR).

mIRC first triggers the ON ERROR and after that the ON DISCONNECT.
In the first I resetted the connection queue entries' 'status' flag from busy to queue which made the script not find any connection attempt in progress in the followed up on disconnect event and forced into thinking it was remotely disconnected so it did a reconnection attempt, which removes any existing jobs in the queue, also closing existing status windows, causing the crash.

It's easy reproducable on my machine:
Code:
on *:DISCONNECT:{ window -c "Status Window" }

mIRC 6.20 gives an invalid page fault on 0167:00420d89

Registers:
EAX=00000000 CS=0167 EIP=00420d89 EFLGS=00010246
EBX=00000064 SS=016f ESP=0087ee34 EBP=bff5582a
ECX=00000019 DS=016f ESI=00fe71a0 FS=494f
EDX=00000064 ES=016f EDI=00fe71a0 GS=0000
Bytes in CS:EIP:
f3 ab 8b cb 83 e1 03 f3 aa 8b 44 24 10 85 c0 5f
Stackdump:
00000000 00000000 00fe6078 004595f6 00fe6fac 005c6dec 005c6dec 00000000 00fe6078 00000003 0056908d 00fe6078 005a4bec 00000000 00000001 00458bf8

Re: crash when closing status window in on disconn #157645 27/08/06 05:10 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You can only close the status window for a connection that has been disconnected (irrelevant as to the reason for the disconnection), if there is more than one status window open. mIRC requires a status window to be open, even if there isn't an active connection for that window.

Re: crash when closing status window in on disconn #157646 27/08/06 08:02 AM
Joined: Jan 2004
Posts: 162
R
RRX Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
To my experience, you can close a status window regardless connection $status. And you can catch it as:
Code:
on *:CLOSE:*:{
  if ($target== status window) { return }
; there was one closed here

The last status window cannot be closed, as you say.
I used in the script condition:
Code:
if ($scon(0) > 1) { scid $11 window -c "Status Window" }

($11 being the $cid value)

To see if the crash occurs, you need to have two server windows open, make a connection in one, then disconnect that one, with the given on disconnect event in Remote.

I tested it while going down the mIRC versions list. It kept crashing until (and included v6.10) and didn't crash anymore in v6.03.

Re: crash when closing status window in on disconnect #157647 28/08/06 04:47 PM
Joined: Dec 2002
Posts: 4,753
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,753
Thanks this has been fixed for the next version.

Re: crash when closing status window in on disconn [Re: RRX] #167409 23/12/06 05:24 PM
Joined: Jan 2004
Posts: 162
R
RRX Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
This seems to be fixed but now I have another crash pestering me.

MIRC621 heeft een fout met betrekking tot een ongeldige pagina veroorzaakt in
module MIRC621.EXE op0167:00585ad3.
Registers:
EAX=00fef3a4 CS=0167 EIP=00585ad3 EFLGS=00010246
EBX=0087ea6f SS=016f ESP=0087b518 EBP=0087e688
ECX=00fef3a4 DS=016f ESI=0087d21c FS=527f
EDX=7efefeff ES=016f EDI=0087ea6f GS=0000
Bytes in CS:EIP:
8b 01 03 d0 83 f0 ff 33 c2 8b 11 83 c1 04 a9 00
Stackdump:
0087c540 0051251f 0087ea6f 00fef3a4 0087e688 0087c540 0087d21c 0087c92d 0087c939 00000001 0087e688 00000101 81d7425c 00000000 00000000 00000000

It occurs when my script has a reconnection job in the queue (for example, after a lagcheck timeout), and a disconnection happens before that job is processed.
Since the disconnection (by disconnect command or mirc button) triggers it, I added debug /writes in the on disconnect event and called aliases, so I can see where it stops in the execution path.
But the weird thing is, all the writes are done. Then I added a timer -o 1 0 dbl something (alias dbl does the /write) on the end of the on disconnection event, and that timer never triggers, the debug /write in it is not done.
I even added a /remote off after the timer starts, and the crash still happens.
Since this crash happens after the script execution is finished, I'm out of ideas on how to trackdown the reason.

Note: I wrote an alias to mimic the triggering conditions for the queue addition (using my script) and I tried it with other mirc versions. It occurs downto 6.16 (cant test older since script needs 6.16) so I guess this is another bug existing for quite some time.

Addition:
I tried elimination and commenting out this line avoids the crash:
Code:
if ($scon(0) > 1) { hdel SC_H %hi | scid $11 window -c "Status Window" }

So somehow its again related to closing Status Window but I can't reproduce the crash with
Code:
on *:disconnect:{ scid $cid window -c "Status Window" }

so I'm still unsure.

Last edited by RRX; 23/12/06 07:24 PM.