Go to Post The engineer mentors ARE part of the team, equals with the students in every aspect - KenWittlief [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2014, 22:32
electromatter electromatter is offline
Registered User
None #0122
 
Join Date: Dec 2012
Location: Williamsburg
Posts: 2
electromatter is an unknown quantity at this point
Fatal WPILib bug

Hello,

I am getting a heap corruption on my team's robot and I would like to verify that my robot's image is valid. Can someone please compute and post the checksums of your copy of the 2014 image. The problem appeared when I reimaged the cRIO to 2014v52. While running the 2013 image the robot does not crash. When I instantiate a Gyro, WPILib silently corrupts memory. I can demonstrate this by running (https://gist.github.com/electromatter/8995248) in test mode. When I run that program in Test mode and switch to Teleop, the robot crashes within a second. However, when I run the program only in Teleop, the robot does not crash. The jump to 0xEEEEEEEE is not consistent.

related files:
C:\WindRiver\WPILib\cRIO_Images\FRC_2014_v52.zip
C:\WindRiver\WPILib\WPILibC++Source20140101rev3876 .zip
C:\WindRiver\vxworks-6.3\target\lib\WPILib.a

md5 sums:
1077394c36cb21eb698ef16484c4c14c FRC_2014_v52.zip
a769926dbce97e3f9222e6fa79281068 WPILib.a
84869dd148975d43b8fad2670a6a02b8 WPILibC++Source20140101rev3876.zip

sha1 sums:
0989431bad7e34d5fcce2d42e290aa313dafb764 FRC_2014_v52.zip
a7edb741b589fb53f8e49eaaa38cd242de463dfa WPILib.a
bd6de27d6ba8c6814c2ba43f6e0f121bb8876ecc WPILibC++Source20140101rev3876.zip

Information from the debugger:

Exception in Kernel Task FRC_RobotTask:0xd0ce00
at pc=0xEEEEEEEC

Vector 0x200: Machine Check status=0xEEEEEEEE

Faulting module: FRC_RobotTask - 0xd0ce00

Stack trace:
0xEEEEEEEC
LiveWindow::SetEnabled() - LiveWindow.cpp:64
SimpleRobot::StartCompetition() - SimpleRobot.cpp:141
RobotBase::robotTask() - RobotBase.cpp:145
vxTaskEntry() - 0x000b48cc
Reply With Quote
  #2   Spotlight this post!  
Unread 14-02-2014, 07:11
Nate Laverdure's Avatar
Nate Laverdure Nate Laverdure is offline
Registered User
FRC #2363
Team Role: Coach
 
Join Date: Apr 2005
Rookie Year: 1999
Location: Newport News, VA
Posts: 832
Nate Laverdure has a reputation beyond reputeNate Laverdure has a reputation beyond reputeNate Laverdure has a reputation beyond reputeNate Laverdure has a reputation beyond reputeNate Laverdure has a reputation beyond reputeNate Laverdure has a reputation beyond reputeNate Laverdure has a reputation beyond reputeNate Laverdure has a reputation beyond reputeNate Laverdure has a reputation beyond reputeNate Laverdure has a reputation beyond reputeNate Laverdure has a reputation beyond repute
Re: Fatal WPILib bug

I've been watching the OP struggle with this issue for a few days now. Any help you could offer would be greatly appreciated.

Our next step will probably be to redownload and reinstall the v52 image.
Reply With Quote
  #3   Spotlight this post!  
Unread 14-02-2014, 09:26
pcfens pcfens is offline
Registered User
FRC #1137
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2004
Location: Gloucester, VA
Posts: 4
pcfens is an unknown quantity at this point
Re: Fatal WPILib bug

Do you get similar behavior when switching from Test to Autonomous?

I have a few theories, but don't want to get too in depth without knowing a little bit more. Re-imaging the cRIO shouldn't hurt it even if it's not the cause of the error, so I wouldn't hesitate to try that, though all of your checksums match what I got here.

(Also greetings from a NHGS alum)
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2014, 09:56
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Fatal WPILib bug

The corruption or crash could be caused by the user code, by WPILib, or by a corrupted image. As mentioned already, it will not hurt to reimage, though the file system is quite robust.

I suspect that the symptom will remain. I'd suggest debugging the Test code. If DriverStationLCD::GetInstance(); doesn't return a valid object, the next line will crash. I also don't know much about the WPILib C++ implementation, but it could be responsible. Independently put in the LCD and gyro code and see which seems responsible.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 14-02-2014, 11:01
pcfens pcfens is offline
Registered User
FRC #1137
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2004
Location: Gloucester, VA
Posts: 4
pcfens is an unknown quantity at this point
Re: Fatal WPILib bug

Since the crash happens when switching from Test to OperatorControl, and both methods use the DriverStationLCD method, I'm wondering if the bug is somewhere in the ~Gyro stack, which would explain that it happens when switching to other methods that don't contain that object.

If this is the case, it might be mitigated by making your Gyro object a member of the class rather than an object local to a particular method.
Reply With Quote
  #6   Spotlight this post!  
Unread 14-02-2014, 12:25
electromatter electromatter is offline
Registered User
None #0122
 
Join Date: Dec 2012
Location: Williamsburg
Posts: 2
electromatter is an unknown quantity at this point
Re: Fatal WPILib bug

pcfens: I moved the Gyro to the stack to make the test more localized. I have tested code with Gyro as a member, it had the same problem.
Greg: GetInstance should throw std::bad_alloc if allocation fails. Otherwise, GetInstance should return a valid object.
Reply With Quote
  #7   Spotlight this post!  
Unread 14-02-2014, 13:22
pcfens pcfens is offline
Registered User
FRC #1137
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2004
Location: Gloucester, VA
Posts: 4
pcfens is an unknown quantity at this point
Re: Fatal WPILib bug

Do you mind updating the Gist to reflect the test that you're running now with the same issue?
Reply With Quote
  #8   Spotlight this post!  
Unread 14-02-2014, 14:21
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Fatal WPILib bug

The test code that was posted does assume that a valid object pointer is returned. If the LCD class is implemented properly, that isn't a problem. But if it isn't, the test code will dereference and crash.

I can't debug the code, but that is one of the things I'd check.

Greg McKaskle
Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2014, 13:08
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Fatal WPILib bug

This is probably something you've already checked, but can you confirm that your analog module (NI 9201) is plugged into slot 1 on the cRio?

At some point these were switched on ours, and I found that when I tried to instantiate a gyro, it would throw an exception. I didn't dive too deep into the details of what the exception was so I don't know if it matches what you're getting.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:08.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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