mIRC Home    About    Download    Register    News    Help

Print Thread
Error allocating stack memory #172488 11/03/07 10:14 AM
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?

Re: Error allocating stack memory [Re: hkr] #172491 11/03/07 12:28 PM
Joined: Mar 2007
Posts: 12
S
Sintel Offline
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.

Re: Error allocating stack memory [Re: Sintel] #172495 11/03/07 01:21 PM
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...

Re: Error allocating stack memory [Re: hkr] #172514 11/03/07 03:06 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
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.
Re: Error allocating stack memory [Re: hkr] #172516 11/03/07 03:32 PM
Joined: Feb 2006
Posts: 546
J
jaytea Offline
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
Re: Error allocating stack memory [Re: jaytea] #172537 11/03/07 08:00 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline
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
Re: Error allocating stack memory [Re: HaleyJ] #172542 11/03/07 08:20 PM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
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
Re: Error allocating stack memory [Re: HaleyJ] #172543 11/03/07 08:26 PM
Joined: Feb 2006
Posts: 546
J
jaytea Offline
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
Re: Error allocating stack memory [Re: hkr] #249551 04/12/14 10:47 AM
Joined: Jun 2013
Posts: 24
Z
Zabache Offline
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-
...
}

Re: Error allocating stack memory [Re: hkr] #250773 30/01/15 03:15 PM
Joined: Jan 2015
Posts: 4
H
HackHeaven Offline
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

Re: Error allocating stack memory [Re: HackHeaven] #250804 31/01/15 08:52 AM
Joined: Dec 2002
Posts: 4,587
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,587
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.

Re: Error allocating stack memory [Re: Khaled] #250818 31/01/15 02:47 PM
Joined: Jan 2015
Posts: 4
H
HackHeaven Offline
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.
Re: Error allocating stack memory [Re: HackHeaven] #250819 31/01/15 03:47 PM
Joined: Jul 2006
Posts: 3,586
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,586
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.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Error allocating stack memory [Re: Wims] #250843 01/02/15 02:45 AM
Joined: Jan 2015
Posts: 4
H
HackHeaven Offline
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
}

Re: Error allocating stack memory [Re: HackHeaven] #250845 01/02/15 03:12 AM
Joined: Feb 2003
Posts: 2,669
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,669
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!