mIRC Home    About    Download    Register    News    Help

Print Thread
#86748 13/06/04 05:44 PM
Joined: Apr 2004
Posts: 7
O
oak Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Apr 2004
Posts: 7
My mirc version: 6.15
My windows version: 98se (portuguese-brazil)
Today i noticed a crash (Ilegal Operation) with my script, so i started to check dlls ands scripts to find the bug. At the end, that's the conclusion:
- If i load the dll on mirc startup (on start), then unload, and load again, it crashes
- If i load the dll after mirc startup, then unload, and load again, it doesnt crashes
Then i put a 1ms timer on "on start" to load the dll, then unloaded and loaded it again, and it crashed, so i tried with a 5s timer and it didn't crash!
So, after this confuse history, the conclusion is:
* If you load a dll during or just after the mirc startup, then unload and load again, it crashes
BUT, i sent the same code to my friend and he tested and he didn't got a crash (he uses windows XP)
i think it only occurs on windows 9x/me


IRCalf
#86749 13/06/04 05:51 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
I think it's to do with the order that you (un)load dlls.

For example:

Crash (Order unloaded: first dll loaded to last dll loaded):

Code:
on *:exit:{
  var %i = 1
  while $dll(%i) {
    dll -u $dll(%i)
    inc %i
  }
}


No crash (Order unloaded: last dll loaded to first dll loaded):

Code:
on *:exit:{
  var %i = $dll(0)
  while %i {
    dll -u $dll(%i)
    dec %i
  }
}


However, neither of these seem to crash on XP (what i have)

To sum it up, let's say you load "a.dll", then after you've loaded that, you load "b.dll", "a.dll" should not be unloaded before "b.dll", "b.dll" should be unloaded first.


New username: hixxy
#86750 13/06/04 06:00 PM
Joined: Apr 2004
Posts: 7
O
oak Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Apr 2004
Posts: 7
No, its not with the order of load/unload, it happens with any dll, even if loaded alone, the condition to crash is just load at startup, then unload and load again
thanks anyway


IRCalf
#86751 14/06/04 07:57 AM
Joined: Jan 2004
Posts: 79
C
Babel fish
Offline
Babel fish
C
Joined: Jan 2004
Posts: 79
What I can think of right now is that mIRC at startup performs some operations that keep it kinda busy, and so it doesn't load the DLL properly. Then it unloads it, and when it reloads it, it crashes due to the incorrect earlier load. May be something else, but w/o source code I can't really tell why a program would crash.

And are you SURE it's with all DLLs? Maybe just yours or something?


BTW: FYI WinME is in the Win9x "list"


My ally is the compiler, and a powerful ally it is!
#86752 14/06/04 06:12 PM
Joined: Apr 2004
Posts: 7
O
oak Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Apr 2004
Posts: 7
no, isn't with all
i made more tests and found another situation when it crashes: unloading e re-loading the dll too fast
and it doesn't crashes with all dlls, i wrote another dll with basic features and that one didn't crash
im trying to determine why it crashes, but now i think its not a mirc bug

Last edited by oak; 14/06/04 06:13 PM.

IRCalf
#86753 19/06/04 11:18 PM
Joined: Apr 2004
Posts: 7
O
oak Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Apr 2004
Posts: 7
and so, after days and days debugging i finally dicovered: the bug is in my dll
sorry the incovenience


IRCalf

Link Copied to Clipboard