mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2006
Posts: 19
H
hkr Offline OP
Pikka bird
OP Offline
Pikka bird
H
Joined: Mar 2006
Posts: 19
what does * Error allocating stack memory mean?

Joined: Mar 2007
Posts: 12
S
Pikka bird
Offline
Pikka bird
S
Joined: Mar 2007
Posts: 12
That something went wrong when mirc tried to reserve memory for its/a stack.

Can't really say much more than that without some extra information.

A stack is like a pile of information with 2 main functions, push and pop. Push puts another piece of information on the pile, and pop reads in the information that got pushed on the pile the most recently and removes that piece of information from the pile.

Joined: Mar 2006
Posts: 19
H
hkr Offline OP
Pikka bird
OP Offline
Pikka bird
H
Joined: Mar 2006
Posts: 19
i fixed it. it came from trying to evaluate more than one time a specified string beginning with two slashes and containing a channel with a # prefix. strange because i tried it separately from the script- i typed it in the status window and it worked.. also it would work if i remove one of the slashes or if i leave only the # prefix without any following characters...

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Usually you'll get that error if you're performing recursion and mIRC reaches the stack limit. You might want to check the aliases/identifiers you were using in that line to see if they've got a runaway recursion issue.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
would be interesting to see the exact lines of code that generated this error, i can't see how to produce it with what you described :P

here's simple example of how to generate it, you should be able to see what's happening:

Code:
//var %x = $!eval(%x,2) | noop $eval(%x,2)


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Jul 2006
Posts: 242
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
seems interesting, how does that small snippet generate the error? care to explain?


Newbie
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
//var %x = $!eval(%x,2) | noop $eval(%x,2)
because it keeps evaluating %x
noop $eval(%x,2)
1:evaluates $!eval(%x,2) twice becoming
2:$eval(%x,2)
3:and the 2nd time it will evaluate the contents of %x twice again jumping to 1: again.

As you can see there's no end to it.


$maybe
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
sure, first %x is set with value plaintext $eval(%x,2)

then we try to evaluate %x twice with //noop $eval(%x,2)

1. %x evaluates once to produce its value, the string $eval(%x,2)

2. this result is evaluated again, so mirc attempts to evaluate $eval(%x,2) once which takes us back to step 1

this process happens over and over again, and internally the stack keeps getting added to over and over to nothing is ever removed from it. eventually it throws that error :P

you can see just how far it reaches by using the following:

Code:
alias stackoverflow inc -su %x | return $!eval($stackoverflow,2)


then try //noop $eval($stackoverflow,2)



"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Jun 2013
Posts: 24
Z
Ameglian cow
Offline
Ameglian cow
Z
Joined: Jun 2013
Posts: 24
I came across this 'Error allocating stack memory' being attributed to an insignificant echoing alias I wrote, when removing the .timer from within a different my Example alias so that buried within this was then a .timer-less call to itself... not possible.

Bad:
Code:
alias Example {
...
Example $1-
...
}


Good:
Code:
alias Example {
...
.timerExample 1 1 Example $1-
...
}

Joined: Jan 2015
Posts: 4
H
Self-satisified door
Offline
Self-satisified door
H
Joined: Jan 2015
Posts: 4
I get this error using

Code:
  var %finduser = $findfile($mircdir\Channels\ $+ $chan $+ \,*.ini*,n)


I think its because im looking thru alot of files but it doesn't seem to trigger in other scripts or if i just do it alone in the commandline

Joined: Dec 2002
Posts: 5,482
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,482
Are you using a recursive call that repeatedly calls the same alias? If so, the error message indicates that you have reached the limit of the recursion depth. This is usually a helpful error message because it catches runaway, and often unintended, recursive calls that can eat up memory and affect other applications and Windows as a whole.

Joined: Jan 2015
Posts: 4
H
Self-satisified door
Offline
Self-satisified door
H
Joined: Jan 2015
Posts: 4
I am using

Code:
  if (!%rNick) { $aRepeat }
  if (%rNick == Tester) { $aRepeat }


To loop it if %rnick is not set or the nick is tester now that i think of it i should recode this part so it just replaces rnick again without looping the whole thing

edit: replaced the code now just have to wait and see if it triggers anymore

Last edited by HackHeaven; 31/01/15 02:53 PM.
Joined: Jul 2006
Posts: 4,180
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,180
Seeing that part isn't enough to tell you anything, you would need to show the whole code..
But if those two lines are within the alias "aRepeat", then it's likely your issue, an alias cannot call itself.
Though, after testing this syntax (using a command doesn't behave this way), mIRC seems to ignore the call and simply return $null:

Code:
alias testing {
echo -a called
echo -a call again $testing
echo -a end calling
return test
}
//echo -a > $testing will simply display 'called', 'call again', 'end calling' and finally '> test' because the alias is originally called with //echo -a >.
So actually, that can't be your case here, you must have something else going on.

Last edited by Wims; 31/01/15 03:48 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2015
Posts: 4
H
Self-satisified door
Offline
Self-satisified door
H
Joined: Jan 2015
Posts: 4
The $arepeats are in the other code so if rnick null or tester it calls a new alias that has another call to the alias with them 2 lines itself (cause it cant recall itself)

But i fixed that and didn't get to see if it works since my net been messing up all day but so fr i don't see the error

Code:
alias test {
do $arepeat if rnick is null
}

alias arepeat {
$test
}

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Just keep it below 125 iterations. If your recursion gets any deeper it's going to fail. Aim for below 100.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard