mIRC Homepage
Posted By: oak SERIOUS bug with /dll - 13/06/04 05:44 PM
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
Posted By: tidy_trax Re: SERIOUS bug with /dll - 13/06/04 05:51 PM
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.
Posted By: oak Re: SERIOUS bug with /dll - 13/06/04 06:00 PM
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
Posted By: cmad Re: SERIOUS bug with /dll - 14/06/04 07:57 AM
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"
Posted By: oak Re: SERIOUS bug with /dll - 14/06/04 06:12 PM
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
Posted By: oak Re: SERIOUS bug with /dll - 19/06/04 11:18 PM
and so, after days and days debugging i finally dicovered: the bug is in my dll
sorry the incovenience
© mIRC Discussion Forums