internal table overflow

Hi All,

I’ve been getting reports of an error

Jul 27 05:43:17 backuplist+[664]: *** +[utilities getFormattedDate:theformat:]: Internal table overflow. (error −2707)
Jul 27 05:43:19 kernel[0]: (default pager): [KERNEL]: Switching ON Emergency paging segment
Jul 27 05:43:21 kernel[0]: (default pager): [KERNEL]: System is out of paging space.
etc. etc…

not sure why looking at the function

set thisdayOfMonth to utilities's getFormattedDate_theformat_(NSNow, "dd")
on getFormattedDate_theformat_(thedate, theFormat)
		set theFormat to theFormat as string
		set myFormatter to current application's class "NSDateFormatter"'s alloc()'s init()
		myFormatter's setDateFormat_(theFormat)
		set theString to myFormatter's stringFromDate_(thedate)
		return theString
end getFormattedDate_theformat_

It works for me and most folks but a few have reported Internal table overflow errors here and in other spots.

Any thoughts appreciated, Rob D.

teh

That error means AppleScript has got itself into a state, and you need to quit. It can happen with too much data, or too many concatenations. The damage is probably happening some time before the handler that generates the error message.

Hi Shane,

I know - it seems to happen in different places with no apparent big thing going on and it gets triggered by the “last straw” bit of conversion or routine. But it doesn’t happen to everyone and only often only occasionally for the unlucky ones.

Problem is my script is large and I am confounded as to where to begin looking or how to restructure. Given your thoughts maybe I can get some perspective. I am most of the way through converting to pure OBj-C in the hope some of these obscurities will be gone. I have probably pushed ASOC to the limit with a full fledged app like mine.

Best, Rob

Shane, What did you mean exactly by “concatentions.”? Appending strings?

The handler is actually called repeatedly, inside a NStimer firing every 40 seconds, so I wonder if that is somehow overwhelming things.

Thanks, rob

Not exactly, when appending too long strings or lists you’ll get an stack overflow. A internal table overflow is that your object has too many methods, variables or objects or there is something wrong with your code. Most of the time it is the last one.

Do you use eval or load dynamic script files at runtime elsewhere repeatedly?

It shouldn’t. But it is creating a new formatter every time – why not do that once and store it in a property?