StackOverflowError Exception only in debugger

The RPTools applications are written in Java. If you're interested in contributing to any project here by submitting patches to the source code, this is the forum to ask questions about how to do so. Please put the two-letter tool name abbreviation in your thread Title. To enter this group, go to the Usergroups page of your User Control Panel and join the Java Developer group.

Moderators: dorpond, trevor, Azhrei

Post Reply
SpaceShot
Kobold
Posts: 20
Joined: Mon Jun 16, 2008 8:53 am

StackOverflowError Exception only in debugger

Post by SpaceShot »

I'm very new to Java and Eclipse, but I managed to get MapTool down (and I believe with latest code as of yesterday) and tried to step through some things.

I'm trying to learn how things are organized. Particularly I spent some time stepping through some vision layer code and the macro code (particularly MacroManager.executeMacro()).

However, I am running into a problem. When I a execute a macro, MapTool throws what I think is a Stack Overflow exception (java.lang.StackOverflowError).

What is peculiar about this is our group uses this campaign every week. I also tried lowering some of the memory settings in the MapToolLauncher just to see if I could recreate it outside the debugger, but I couldn't.

Are there options I need to set in Eclipse? I'm just not sure what is going on. I've actually held off on asking this in awhile because I'm not sure getting an answer would mean I could contribute meaningfully anyways. I'm just trying to get a feel for different parts of the system and figure out if there's some way I can help.

BTW, if it helps I've got Eclipse (ganymede) and I happen to be on Windows XP with 4GB of RAM. I'll offer any other information if it will help, including the stack trace. I figured I'd start with this off hand and then see where it goes.

Thanks

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Re: StackOverflowError Exception only in debugger

Post by jay »

There is a 'bug' in java where certain regular expressions which are used in the macro code will cause overflow exceptions with relatively small input. See the bug here. You can add an option to the java command line to increase the stack size to get around the problem. The option is -Xss#M Where # is the number of megabytes you want to allocate.

SpaceShot
Kobold
Posts: 20
Joined: Mon Jun 16, 2008 8:53 am

Re: StackOverflowError Exception only in debugger

Post by SpaceShot »

The amount of information you put into that post is ridiculous. :)

Thanks for all of that.

User avatar
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Re: StackOverflowError Exception only in debugger

Post by trevor »

jay wrote:The option is -Xss#M Where # is the number of megabytes you want to allocate.
If you are running from eclipse, put this into the VM Args section of the Arguments tab in your launch configuration
Dreaming of a 1.3 release

Post Reply

Return to “Java Programming Info”