View unanswered posts | View active topics It is currently Fri Dec 19, 2014 2:44 am






Reply to topic  [ 7 posts ] 
Byte Code Interpreter Exception! 
Author Message
Novice

Joined: Fri Oct 24, 2008 8:58 am
Posts: 87
Post Byte Code Interpreter Exception!
I get the following exception when my program is started.

Quote:
RobotC Exception Violation Report
Byte Code Interpreter Exception:
Program Slot: 0, Task ID: readMsgFromPC[1]
Error at PC: BAD_LOC + 0xCC5F
Task PC: BAD_LOC + 0xCC5F
TaskState: 'Exception'
Exception Type: 'Parm out of range [Write][40]'


I think its related somehow to the size of my program, but I'm not getting any kind of compiler warning about size.
I think its somehow size related because if I remove portions of the code that I'm not immediately using then it goes away.

@developers: what should I do about this?


Sun Feb 01, 2009 4:50 pm
Profile
Novice

Joined: Thu Oct 09, 2008 7:58 pm
Posts: 79
Post Re: Byte Code Interpreter Exception!
Better than that, try posting your code...


Mon Feb 02, 2009 6:06 pm
Profile
Novice

Joined: Fri Oct 24, 2008 8:58 am
Posts: 87
Post Re: Byte Code Interpreter Exception!
While I can appreciate the technique of asking novice programmers to "post their code" to fix what is usually very simple logic or syntax errors... I am not a novice programmer and in this case suggesting that I post the code is almost comical.

I specifically mentioned I thought it was a size issue. The source code is 15+ files and 100+ pages of code. Do you really want me to post that in a mile long code block... :)

I was able to temporarily bypass the problem by refactoring the code to be a little more efficient (seems like <12K works fine).

I really need to know from the developers what would cause that runtime error (I can of course email the source tree for troubleshooting)

Is it raw program size? # of functions? # of structures/variables? or just a bug.

Actually, its definitely a bug even if its unavoidable...the COMPILER should error out not some obscure runtime error. If there ARE size restrictions, then the compiler summary needs to inform us of what % we are using. Otherwise we can only assume if it compiles and fits in the NXT it should run.


Mon Feb 02, 2009 8:04 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1362
Post Re: Byte Code Interpreter Exception!
I don't know how to help you with your problem but just for your reference, our code has almost 4000 lines of actual code (excluding comments, 7000 lines if you count comments) in 34 files. This is not even counting Xander's library code. RobotC has a limit of 160 total subroutines. We had exceeded that and had to comment out some unused code in Xander's library to get around it. So I consider we have fairly good size code but we don't see the problem you are seeing. The only suggestion I have is to send email to support@robotc.net.


Tue Apr 19, 2011 6:31 am
Profile
Rookie

Joined: Fri Apr 15, 2011 12:08 am
Posts: 5
Post Re: Byte Code Interpreter Exception!
Umm... how does a FTC team have that much code? I've got nearly a thousand lines in my auto and 500 in teleop and I thought I had a lot. :?


Sun Apr 24, 2011 2:29 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1362
Post Re: Byte Code Interpreter Exception!
We have a generic library containing code for PID control, cooperative multi-tasking, menu system, line following, event notification system, state machines and various sensors. That library has 2000 lines of code by itself. We may not use everything in the competition though depending on the task. This year's competition is a bit complicated. We have 7 autonomous strategies. So it adds up.


Sun Apr 24, 2011 3:07 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: Byte Code Interpreter Exception!
I've seen this error before, it can happen for all sorts of reasons. Issues that have caused errors like this in the past, include:
  • A bad parameter to a function
  • Struct member memory alignment
  • Probably others, too
The compiler would not allow you to create a binary that is too big or has too many functions.

Quote:
While I can appreciate the technique of asking novice programmers to "post their code" to fix what is usually very simple logic or syntax errors... I am not a novice programmer and in this case suggesting that I post the code is almost comical.

As for this comment, well, not everyone knows you're not a novice and your assumption about size may have been wrong. It is not wise to scold those who offer to help for going through the usual QA that probably solves 95% of the problems people have on these forums.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Apr 24, 2011 4:34 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.