Go to Post Improve yourself. Try not to tear others down. - Tom Line [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 09-02-2013, 13:40
Bot190's Avatar
Bot190 Bot190 is offline
Registered User
FRC #0166 (ChopShop)
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Merrimack NH
Posts: 105
Bot190 will become famous soon enough
C++ Crash On Load (Task related)

Hello Everyone,
We have been having a particularly difficult problem lately. Our code crashes on load. So far I have been able to narrow it down to creating objects of WPILib classes under seperate tasks. Any objects created under the main robot task work correctly, but if i create an object in a seperate task the code crashes when it tries to start.
I'm working on with windows 7 64 bit, with the latest Wind River update. Any help would be much appreciated.
__________________

Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2013, 15:00
Bot190's Avatar
Bot190 Bot190 is offline
Registered User
FRC #0166 (ChopShop)
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Merrimack NH
Posts: 105
Bot190 will become famous soon enough
Re: C++ Crash On Load (Task related)

With more testing I believe i've narrowed the problem down further. With the first update for this year, our code runs correctly. Our code doesn't work correctly with the 2nd midseason update. I plan to test teh first midseason update soon. Hopefully I can narrow the problem down further in doing so.
__________________

Reply With Quote
  #3   Spotlight this post!  
Unread 09-02-2013, 17:47
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: C++ Crash On Load (Task related)

If you can narrow it down to something that is broken in the library, please post it as soon as you can. That will let us put out an update to fix the issue.

Thanks,
Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #4   Spotlight this post!  
Unread 09-02-2013, 17:53
Bot190's Avatar
Bot190 Bot190 is offline
Registered User
FRC #0166 (ChopShop)
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Merrimack NH
Posts: 105
Bot190 will become famous soon enough
Re: C++ Crash On Load (Task related)

I'm not sure what the problem is exactly, But i'm pretty sure it has to do with the creation of the livewindow objects. They don't appear to play nice with tasks.
__________________

Reply With Quote
  #5   Spotlight this post!  
Unread 12-02-2013, 22:51
anidev's Avatar
anidev anidev is offline
Registered User
AKA: Anirudh
FRC #0612 (Chantilly Robotics)
Team Role: Programmer
 
Join Date: May 2012
Rookie Year: 2010
Location: Fairfax, VA
Posts: 6
anidev is an unknown quantity at this point
Re: C++ Crash On Load (Task related)

We are having a very similar issue as well. After updating to the 2nd mid season update (from the first 01/03 release), we found our code was crashing immediately after loading FRC_UserProgram.out, before the main robot class constructor could print anything, before even WPILib could print out its revision number. We attached it to WindRiver and traced the crash back to LiveWindow as well. It seems that something to do with acquiring a NetworkTable for the live window was returning or using a null pointer. The crash doesn't have a specific error, just that the task was killed, which probably means a segfault.

I tried using the first mid-season update, that seemed to crash as well. Reverting to the initial 2013 release worked. This happened even after reimaging the cRIO, both the 4-slot and the 8-slot.
Reply With Quote
  #6   Spotlight this post!  
Unread 14-02-2013, 09:29
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Can either of you post a program that crashes?

Thanks
Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #7   Spotlight this post!  
Unread 14-02-2013, 16:40
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 350
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: C++ Crash On Load (Task related)

With the second update, we too are seeing a crash in live window-related code. The place we saw it crash was in the WPILib PWM code:

void PWM::StopLiveWindowMode() {
SetSpeed(0);
m_table->RemoveTableListener(this); --> crash here
}

I'm thinking m_table is null at this point.

Please note that according to my recollection, this only occurs when we start the Driver Station/SmartDashboard after we start the robot code. If we start the Driver Station/SmartDashboard first the crash doesn't occur.

Code for the robot that shows the problem is at:

http://code.google.com/p/kauaibotsfi...derChicken2013
Reply With Quote
  #8   Spotlight this post!  
Unread 16-02-2013, 20:18
holly4win holly4win is offline
Registered User
FRC #1967
 
Join Date: Jan 2013
Location: San Jose
Posts: 2
holly4win is an unknown quantity at this point
Re: C++ Crash On Load (Task related)

Team 1967 has had trouble with this fatal kernel task-level exception as well. We traced the error back to the LiveWindow SetEnabled() function. To flush out the problem, we put "printf"s to bracket the problem and looked at NetConsole to see how far the code "got" before it crashed. We also used "if" statements to check if pointers in both SetEnabled and InitializeLiveWindowComponents (which is called by SetEnabled) were null (such as: m_scheduler, m_liveWindowTable, table). Then, we checked to make sure it->first was non null, too. This led us to errors down in the PWM and Solenoid .cpp files. In the function StartLiveWindowMode for both the PWM and the Solenoid classes, we created an "if" statement to check if m_table was not null so that we would know that it wasn't using a null pointer. If it wasn't null, we let it call AddTableListener. In InitTable, we also put in an "if" statement that would print out that subTable was null if it really was null. The program STILL CRASHED. To debug this further, we went into a debug session (with our own JankyActuator task created as an object). It crashed in PWM's StopLiveWindowMode. The exception was that pointer m_table was 0xEEEEEEEE. The pointer m_table was never set to null in the constructor. So, we initialized m_table in both PWM's and Solenoid's constructors. The program still ended up crashing but we got "printf"s on NetConsole that m_table was now null - AHA! This caused us to see that in StartLiveWindowMode we got a failure because m_table was not checked before using it and Solenoid and PWM and other LiveWindow based classes all use this. We haven't completely fixed this problem but the lack of initializing m_table and using pointers without checking them is a big part of the problem.

Our work around of the problem is that we create pointer-based objects instead of objects proper in the class (i.e. use Victor * pV and new this object in RobotInit vs. the problematic way of Victor V(5) which gets instantiated too early and trips this problem more frequently). Also, we noted that m_scheduler is not checked in SetEnable() but is used. And it was unclear how the functionality of Initialized Components happens if a component is added after SetEnabled is called for the first time. This is due to the fact that InitializeLiveWindowComponents() is only called once and only the first time SetEnable() is called in LiveWindow. This means late-comers to LiveWindow will not get the same treatment as objects which are added prior to the first SetEnable() call.

Lastly - when adding the WPILib sources into our project as per the Screensteps documentation, we ran into troubles getting WPILib to compile. This is due to the fact that the .cpp -> .o build rule had a 'shell' command that called out to 'subversion' in order to get the subversion version and put it into a -D define variable. If you don't have subversion, this FAILS and the command fails, but the library winds up being created but it is empty. This caused a lot of delay until we changed the -D shell-out to a fixed value to get it to work.

Thanks,
Holly
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:44.

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