Go to Post I'll do my best, but I'm this --><-- close to telling our drivers they're NASCAR styling it this season..."Sorry boys and girls, left turns only!" - Mr. Lim [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 07-01-2013, 01:07
IBeMad IBeMad is offline
Registered User
FRC #3968
 
Join Date: Jan 2013
Location: Washington
Posts: 4
IBeMad is an unknown quantity at this point
NetworkTable crash in unmodified SimpleRobot template

I'm getting a null pointer exeption in
Code:
NetworkTable::Initialize()
on the following line:

Code:
staticProvider = new NetworkTableProvider(*(mode->CreateNode(ipAddress.c_str(), port, threadManager)));
This crash occurs in unmodified SimpleRobotTemplate code. How does something like this even get through QA, or is there even any QA to begin with? Sure seems like there isn't any...

Earlier on in the call stack, the crash stems from
Code:
SimpleRobot::StartCompetition()
when it calls

Code:
LiveWindow *lw = LiveWindow::GetInstance();
which creates a new instance of LiveWindow since it's the first time GetInstance() is called, which results in it calling
Code:
NetworkTable::GetTable("LiveWindow")
.

When will this be fixed in WPILib, and how can I work around it in the meantime?

Last edited by IBeMad : 07-01-2013 at 01:12.
Reply With Quote
  #2   Spotlight this post!  
Unread 07-01-2013, 10:38
mitchellweb1 mitchellweb1 is offline
Registered User
AKA: Mitchell W
FRC #0190
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Acton, MA
Posts: 30
mitchellweb1 is an unknown quantity at this point
Re: NetworkTable crash in unmodified SimpleRobot template

Hi,

Are you sure that this is unmodified. We just ran the template project again and it worked fine. If you are still having issues would it be possible to do a little more debugging and figure out exactly what is null on that line.

--Mitchell
Reply With Quote
  #3   Spotlight this post!  
Unread 07-01-2013, 13:39
IBeMad IBeMad is offline
Registered User
FRC #3968
 
Join Date: Jan 2013
Location: Washington
Posts: 4
IBeMad is an unknown quantity at this point
Re: NetworkTable crash in unmodified SimpleRobot template

Quote:
Originally Posted by mitchellweb1 View Post
Hi,

Are you sure that this is unmodified. We just ran the template project again and it worked fine. If you are still having issues would it be possible to do a little more debugging and figure out exactly what is null on that line.

--Mitchell
Yes, I'm sure that it's umodified. I guess I'll just have to fix the bug in WPILib myself and submit it.
Reply With Quote
  #4   Spotlight this post!  
Unread 07-01-2013, 15:58
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: NetworkTable crash in unmodified SimpleRobot template

I suggest that you reinstall the WindRiver update before blaming the library itself.
Reply With Quote
  #5   Spotlight this post!  
Unread 07-01-2013, 21:47
IBeMad IBeMad is offline
Registered User
FRC #3968
 
Join Date: Jan 2013
Location: Washington
Posts: 4
IBeMad is an unknown quantity at this point
Re: NetworkTable crash in unmodified SimpleRobot template

Quote:
Originally Posted by Alan Anderson View Post
I suggest that you reinstall the WindRiver update before blaming the library itself.
No luck reinstalling everything, however it does work on other computers. Just not mine. Any other ideas?
Reply With Quote
  #6   Spotlight this post!  
Unread 07-01-2013, 22:32
mitchellweb1 mitchellweb1 is offline
Registered User
AKA: Mitchell W
FRC #0190
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Acton, MA
Posts: 30
mitchellweb1 is an unknown quantity at this point
Re: NetworkTable crash in unmodified SimpleRobot template

If you could run the debugger and determine what value on that line is null then I may be able to try to help a little more.
Reply With Quote
  #7   Spotlight this post!  
Unread 08-01-2013, 01:48
Fifthparallel Fifthparallel is offline
Registered User
AKA: Sam Chen
FRC #1410
 
Join Date: Dec 2012
Rookie Year: 2011
Location: Denver, CO
Posts: 65
Fifthparallel is an unknown quantity at this point
Re: NetworkTable crash in unmodified SimpleRobot template

Code:
staticProvider = new NetworkTableProvider(*(mode->CreateNode(ipAddress.c_str(), port, threadManager)));
Out of curiosity, why is there an asterisk in the argument for NetworkTableProvider? (I always get hazy around dereference operators)

Anyway, a null pointer exception would seem to indicate that something on that line is an uninitialized pointer. How/where did you declare staticProvider?
__________________
sudo chmod u+x helloworld.sh
gotta start somewhere.
Reply With Quote
  #8   Spotlight this post!  
Unread 08-01-2013, 09:30
nightpool's Avatar
nightpool nightpool is offline
robotRectifier
AKA: Evan
no team (formerly of CORE 2062)
Team Role: Alumni
 
Join Date: Oct 2011
Rookie Year: 2011
Location: Waukesha, WI
Posts: 81
nightpool is on a distinguished road
Re: NetworkTable crash in unmodified SimpleRobot template

Quote:
Originally Posted by Fifthparallel View Post
Code:
staticProvider = new NetworkTableProvider(*(mode->CreateNode(ipAddress.c_str(), port, threadManager)));
Out of curiosity, why is there an asterisk in the argument for NetworkTableProvider? (I always get hazy around dereference operators)

Anyway, a null pointer exception would seem to indicate that something on that line is an uninitialized pointer. How/where did you declare staticProvider?
Well, not looking at the lib or anything, but it seems pretty clear that CreateNode returns a pointer, but the NetworkTableProvider constructor expects a value.
__________________
Proud alum of CORE 2062.
www.core2062.com

Last edited by nightpool : 08-01-2013 at 09:37.
Reply With Quote
  #9   Spotlight this post!  
Unread 08-01-2013, 10:08
Fifthparallel Fifthparallel is offline
Registered User
AKA: Sam Chen
FRC #1410
 
Join Date: Dec 2012
Rookie Year: 2011
Location: Denver, CO
Posts: 65
Fifthparallel is an unknown quantity at this point
Re: NetworkTable crash in unmodified SimpleRobot template

It looks like it expects an address to a node -- and if createNode returns a pointer, he has an asterisk in there that he doesn't need. I think that's the cause of his null pointer exception -- that asterisk creates an uninitialized pointer.
__________________
sudo chmod u+x helloworld.sh
gotta start somewhere.
Reply With Quote
  #10   Spotlight this post!  
Unread 08-01-2013, 11:39
mitchellweb1 mitchellweb1 is offline
Registered User
AKA: Mitchell W
FRC #0190
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Acton, MA
Posts: 30
mitchellweb1 is an unknown quantity at this point
Re: NetworkTable crash in unmodified SimpleRobot template

createNode will always return a non-null pointer. The NetworkTableProvider constructor takes a reference to the pointer type returned by createNode. This code has run fine on under linux and the crio so it is weird that it is failing here.

staticProvider is declared in NetworkTable.h
Reply With Quote
  #11   Spotlight this post!  
Unread 08-01-2013, 14:03
StephenNutt StephenNutt is offline
Registered User
FRC #0172 (Falgor)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Falmouth, ME
Posts: 37
StephenNutt is an unknown quantity at this point
Re: NetworkTable crash in unmodified SimpleRobot template

Could ipAddress contain the null string? If so, ipAddress.c_str() would return nullptr.
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 12:43.

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