mIRC Home    About    Download    Register    News    Help

Print Thread
#126922 06/08/05 12:37 PM
Joined: Aug 2005
Posts: 2
A
AdM Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
A
Joined: Aug 2005
Posts: 2
Sry for my bad english...

I find a error in my alias...

If i create an alias which exists in mIRC, and which this alias executes a multiserver's script, it crashes mIRC

Example:

alias ame {
if (!$1) { echo -ag * /ame: insufficient parameters | halt }
scid -at1 ame $1-
}

mIRC crash...

but

alias ame2 {
if (!$1) { echo -ag * /ame: param├Ętre insufissant. | halt }
scid -at1 ame $1-
}


No crash

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
alias ame {
if (!$1) { echo -ag * /ame: insufficient parameters | halt }
scid -at1 !ame $1-
}

Normally when you call the same alias from within that alias, it finds a built-in command of that name or gives an error because you cannot call the same alias recursively. With /scid, this check doesn't work, since the alias is now called from within /scid, and not from the alias itself. Now you keep executing the same custom ame alias instead of the built-in command.

The fix for this case would be using !ame to force the built-in version instead of your custom alias. However, it still classifies as a bug, a bad one since it crashes mIRC...

Joined: Aug 2005
Posts: 2
A
AdM Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
A
Joined: Aug 2005
Posts: 2
Ok, thanks.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
yea, nothing should cause mIRC to crash, therefore script error or not, it's definitely a bug


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Feb 2004
Posts: 206
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
Quote:
yea, nothing should cause mIRC to crash, therefore script error or not, it's definitely a bug


Umm, simplistic! And I thought I was the one that oversimplified things!

Analogy: Cars are not supposed to crash, therefore if I try to drive my car at a tree, it should not crash?

The point here is that the script is doing exactly as it is asked, unfortunately the scripter has asked it to do something that is, in hindsight, rather silly. It is not mIRC's fault that the computer ran out of resources!

The moral of this story is that scripters should be aware that certain combinations of commands are not going to produce acceptable results. Or are we going to blame mirc for endless loops as well? smirk

Perhaps this is the start of another "perfect bugless scripting/programming" language debate?

Cheers,

DK


Darwin_Koala

Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Quote:

The point here is that the script is doing exactly as it is asked, unfortunately the scripter has asked it to do something that is, in hindsight, rather silly. It is not mIRC's fault that the computer ran out of resources!


Incorrect.

Because mIRC is a scripting language, that also makes it a virtual machine of sorts. As such, it _should_ be required to do basic error and sanity checking for the programmer. This does not include stopping infinite loops, but it does include anything that can cause loss of data or complete instability of the virtual machine itself.

You'll notice that even in Java/PHP/Perl (yes, perl/php arent entirely virtual machines), you should be unable to cause the machine/code to entirely crash, even though infinite loops are allowed. You will see that any time a crash is detected in those languages they are reported as bugs.

In the end, mIRC needs to look out for one thing over everything else: the stability of its own execution-- therefore, mIRC should not allow anything run through its virtual machine to crash the entire program.

You might be saying that dlls can crash mIRC, but there is one simple answer to that simple argument: dlls do not run within the virtual machine of mIRC. Rather, they run beside it in parallel. And so, dlls can cause mIRC to crash (even though they shouldn't), it would not be the fault of mIRC.

Scripts however are different. mIRC can and should do everything in its power to keep the program running to make sure no data is lost due to the instability of its own VM


* edit *
This isn't a "perfect bugless scripting/programming" language debate. It's a "perfect integrity of the VM" debate.

Anyhow, you must also realize that a crash caused by "mIRC running out of resources" as you defined it, is also a bug right? It means mIRC is performing incorrect resource handling, causing a crash. mIRC is the one able to control resources, not the programmer, therefore the responsibility lies with the language, not the scripter.

Here's an analogy for you:
Saying that mIRC does not have to manage resources for the scripter is like saying Windows does not have to fclose() your files at the end of execution if the programmer forgot to do so.

Finally, theres really nothing pointing to 'no more resources' being the cause of the problem... If that were the case, something like:

//var %i = 1 | while ($true) { fopen -no %i t | inc %i }

Would cause a crash eventually.

Instead it doesn't because mIRC properly handles file resources. So if you think Khaled does not care about proper coding then you're wrong cool

Last edited by argv0; 08/08/05 07:30 AM.

- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
I thought there was a fixed recursion limit of 500 in mIRC, but apparently it isn't there. Is it removed, malfunctioning or did I dream this up?

/alias t1 t2
/alias t2 t1
/t1
byebye mIRC frown

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
6.15 versions.txt: 32.Fixed recursion gpf bug with /scon and /scid.

The reported bug is known, it was actually fixed and things worked fine in 6.15. The safeguards for other types of recursion, like the aliases calling each other had been implemented earlier than 6.15 and also worked fine. However, in 6.16 the entire stack-checking mechanism is broken (any uncontrolled recursion currently crashes mirc). I'm pretty sure everything will work fine again in the next version.

Last edited by qwerty; 08/08/05 01:41 PM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
qwerty is so much more efficient than i at this kind of stuff


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Feb 2004
Posts: 206
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
Quote:

Because mIRC is a scripting language, that also makes it a virtual machine of sorts. As such, it _should_ be [...]. This does not include stopping infinite loops, [...].

In the end, mIRC needs to look out for one thing over everything else: the stability of its own execution-- therefore, mIRC should not allow anything run through its virtual machine to crash the entire program.

You might be saying that dlls can crash mIRC....

Scripts however are different. mIRC can and should do everything in its power to keep the program running to make sure no data is lost due to the instability of its own VM


[...]

Here's an analogy for you:
Saying that mIRC does not have to manage resources for the scripter is like saying Windows does not have to fclose() your files at the end of execution if the programmer forgot to do so.

Finally, theres really nothing pointing to 'no more resources' being the cause of the problem... If that were the case, something like:

//var %i = 1 | while ($true) { fopen -no %i t | inc %i }

Would cause a crash eventually.

[...] So if you think Khaled does not care about proper coding then you're wrong cool


Just to point out, so that you don't put too many words in my mouth:
I have always believed that Khaled cares about proper program.
I was *not* saying that dlls can crash mIRC. The equivalent analogy, if you want to go down that path, is that dlls can crash windows.
A "virtual machine of sorts" does not a full virtual machine make. There was once upon a time when a programmer/scripter actually had to know how to program! :-)
The fopen example probably doesn't apply (although you may be able to find others), as file handles always are a scarce resource and would probably run out before any other problems were encountered.


The point is, the program was doing what it was asked to do. For some reason, mIRC *crashed* - this is obviously a direct result of the scon/scid not being checked for recursion/default command. Sometimes the scripter has to take some responsibility (or perhaps learn from the mistake - not trying to pick on anyone).

After all, I am sure you could write a program that would inadvertantly point a pointer to the wrong spot? How much virtual-machineness can you put in?

Cheers,

DK


Darwin_Koala

Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Quote:
How much virtual-machineness can you put in?

Enough to keep mIRC from having a script crash mIRC under any circumstance.. that's how much. and that was my point.

Anyhow, as qwerty pointed out, this is in fact a resurrected bug that was once fixed, so it's likely to be fixed once again

And from my experience with Khaled in the past, any reported gpf/crash in the program, no matter how zany the cause, would be accepted as a bug and be fixed asap... and I share the same viewpoint on program crashes as he does.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Aug 2005
Posts: 128
S
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
My opinion is that infinite loops and a function calling other infinitelly is not a bug. This is just an error of coding smile

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Infinite loops and infinite recursion are coding errors, mIRC crashing entirely due to infinite recursion is a bug.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
what Kelder said is the actual point. no one is debating infinite loops being the fault of mIRC.mIRC crashing due to an infinite loop is, though.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard