mIRC Home    About    Download    Register    News    Help

Topic Options
#172488 - 11/03/07 10:14 AM Error allocating stack memory
hkr Offline
Pikka bird

Registered: 04/03/06
Posts: 19
what does * Error allocating stack memory mean?

Top
#172491 - 11/03/07 12:28 PM Re: Error allocating stack memory [Re: hkr]
Sintel Offline
Pikka bird

Registered: 10/03/07
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.

Top
#172495 - 11/03/07 01:21 PM Re: Error allocating stack memory [Re: Sintel]
hkr Offline
Pikka bird

Registered: 04/03/06
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...

Top
#172514 - 11/03/07 03:06 PM Re: Error allocating stack memory [Re: hkr]
starbucks_mafia Offline
Hoopy frood

Registered: 09/12/02
Posts: 2962
Loc: Norwich, UK
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.

Top
#172516 - 11/03/07 03:32 PM Re: Error allocating stack memory [Re: hkr]
jaytea Offline
Fjord artisan

Registered: 23/02/06
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

Top
#172537 - 11/03/07 08:00 PM Re: Error allocating stack memory [Re: jaytea]
HaleyJ Offline
Fjord artisan

Registered: 01/07/06
Posts: 242
Loc: London the city i love
seems interesting, how does that small snippet generate the error? care to explain?
_________________________
Newbie

Top
#172542 - 11/03/07 08:20 PM Re: Error allocating stack memory [Re: HaleyJ]
Mpdreamz Offline
Hoopy frood

Registered: 27/04/04
Posts: 759
Loc: Arnhem, The Netherlands
//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

Top
#172543 - 11/03/07 08:26 PM Re: Error allocating stack memory [Re: HaleyJ]
jaytea Offline
Fjord artisan

Registered: 23/02/06
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

Top
#249551 - 04/12/14 10:47 AM Re: Error allocating stack memory [Re: hkr]
Zabache Offline
Ameglian cow

Registered: 20/06/13
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-
...
}

Top
#250773 - 30/01/15 03:15 PM Re: Error allocating stack memory [Re: hkr]
HackHeaven Offline
Self-satisified door

Registered: 30/01/15
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

Top
#250804 - 31/01/15 08:52 AM Re: Error allocating stack memory [Re: HackHeaven]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4297
Loc: London, UK
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.

Top
#250818 - 31/01/15 02:47 PM Re: Error allocating stack memory [Re: Khaled]
HackHeaven Offline
Self-satisified door

Registered: 30/01/15
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


Edited by HackHeaven (31/01/15 02:53 PM)

Top
#250819 - 31/01/15 03:47 PM Re: Error allocating stack memory [Re: HackHeaven]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3438
Loc: France
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.


Edited by Wims (31/01/15 03:48 PM)
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#250843 - 01/02/15 02:45 AM Re: Error allocating stack memory [Re: Wims]
HackHeaven Offline
Self-satisified door

Registered: 30/01/15
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
}

Top
#250845 - 01/02/15 03:12 AM Re: Error allocating stack memory [Re: HackHeaven]
Raccoon Online
Hoopy frood

Registered: 18/02/03
Posts: 2501
Just keep it below 125 iterations. If your recursion gets any deeper it's going to fail. Aim for below 100.
_________________________
doin´┐Ż things a particle can

Top