mIRC Homepage
Posted By: hkr Error allocating stack memory - 11/03/07 10:14 AM
what does * Error allocating stack memory mean?
Posted By: Sintel Re: Error allocating stack memory - 11/03/07 12:28 PM
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.
Posted By: hkr Re: Error allocating stack memory - 11/03/07 01:21 PM
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...
Posted By: starbucks_mafia Re: Error allocating stack memory - 11/03/07 03:06 PM
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.
Posted By: jaytea Re: Error allocating stack memory - 11/03/07 03:32 PM
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:

//var %x = $!eval(%x,2) | noop $eval(%x,2)
Posted By: HaleyJ Re: Error allocating stack memory - 11/03/07 08:00 PM
seems interesting, how does that small snippet generate the error? care to explain?
Posted By: Mpdreamz Re: Error allocating stack memory - 11/03/07 08:20 PM
//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
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.
Posted By: jaytea Re: Error allocating stack memory - 11/03/07 08:26 PM
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:

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

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

Posted By: Zabache Re: Error allocating stack memory - 04/12/14 10:47 AM
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.

alias Example {
Example $1-

alias Example {
.timerExample 1 1 Example $1-
Posted By: HackHeaven Re: Error allocating stack memory - 30/01/15 03:15 PM
I get this error using

  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
Posted By: Khaled Re: Error allocating stack memory - 31/01/15 08:52 AM
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.
Posted By: HackHeaven Re: Error allocating stack memory - 31/01/15 02:47 PM
I am using

  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
Posted By: Wims Re: Error allocating stack memory - 31/01/15 03:47 PM
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:

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.
Posted By: HackHeaven Re: Error allocating stack memory - 01/02/15 02:45 AM
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

alias test {
do $arepeat if rnick is null

alias arepeat {
Posted By: Raccoon Re: Error allocating stack memory - 01/02/15 03:12 AM
Just keep it below 125 iterations. If your recursion gets any deeper it's going to fail. Aim for below 100.
© mIRC Discussion Forums