Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Robot code crashing after a while? (http://www.chiefdelphi.com/forums/showthread.php?t=111925)

Toa Circuit 23-01-2013 22:52

Robot code crashing after a while?
 
For some reason, when I run my code, it works for a while, then just randomly stops. I get a thing saying that there isn't any robot code running, but the little light on the DS says otherwise. I can switch modes and enable them with no issues, but still, the robot will not do anything. Aside from the crashes, everything works perfectly (Minus some potentiometer madness on our shooter tilt).

The source can be found here:
http://bitbucket.org/teammetalcow/ultimateascent

RufflesRidge 24-01-2013 08:09

Re: Robot code crashing after a while?
 
Two things to check to figure out what is crashing:

1. Check the Free RAM on the Driver Station Chart tab, if this number is constantly decreasing to 0 while the robot is running your code leaks memory
2. Make sure NetConsole is enabled using he imaging tool, then open NetConsole, boot the cRIO (so you know Netconsole is working) then see if your code is reporting an exception when it crashes
3. If neither of the above is happening your code is likely hitting a semaphore deadlock. Running through the debugger may help locate it.

virtuald 24-01-2013 12:34

Re: Robot code crashing after a while?
 
You might try disabling the watchdog, and see if that fixes it. If it does, then re-enable it and figure out where you're forgetting to feed the watchdog.

Toa Circuit 24-01-2013 14:13

Re: Robot code crashing after a while?
 
Quote:

Originally Posted by RufflesRidge (Post 1221037)
Two things to check to figure out what is crashing:

1. Check the Free RAM on the Driver Station Chart tab, if this number is constantly decreasing to 0 while the robot is running your code leaks memory
2. Make sure NetConsole is enabled using he imaging tool, then open NetConsole, boot the cRIO (so you know Netconsole is working) then see if your code is reporting an exception when it crashes
3. If neither of the above is happening your code is likely hitting a semaphore deadlock. Running through the debugger may help locate it.

1. Ill try this tonight. If it is a memory leak, how would I fix this? (What would even cause this?)
2. It is enabled (The Console Out switch, yes?) and I will check this tonight.
3. I disabled the semaphores we have and am not starting the second task I have, so I dont think I have any semaphores to deadlock with.

Quote:

Originally Posted by virtuald (Post 1221127)
You might try disabling the watchdog, and see if that fixes it. If it does, then re-enable it and figure out where you're forgetting to feed the watchdog.

I'm not getting any watchdog errors or messages or lights or anything, but if Ruffles' suggestions don't work, I will do this.

Toa Circuit 28-01-2013 10:06

Re: Robot code crashing after a while?
 
I changed a few things and the code worked fine... I think I was allocating a resource twice.


All times are GMT -5. The time now is 18:24.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi