Go to Post i will not post here...i will not post here....well...okay, yes I will - David66 [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,113
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
  #12   Spotlight this post!  
Unread 08-01-2013, 14:21
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 StephenNutt View Post
Could ipAddress contain the null string? If so, ipAddress.c_str() would return nullptr.
This may be the issue. It probably stems from misconfiguration of the cRio or laptop. You should double check what team number you formatted it with.
__________________
Proud alum of CORE 2062.
www.core2062.com
Reply With Quote
  #13   Spotlight this post!  
Unread 08-01-2013, 23:59
masoug's Avatar
masoug masoug is offline
Food Consumer
FRC #0114
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Planet Earth
Posts: 78
masoug is an unknown quantity at this point
Exclamation Re: NetworkTable crash in unmodified SimpleRobot template

We were running into the same exact problem with our code but instead of WindRiver we were using makefiles similar to UCPP to compile our code (we don't have problems if we compile with WindRiver).

Quote:
Originally Posted by StephenNutt View Post
Could ipAddress contain the null string? If so, ipAddress.c_str() would return nullptr.
We tried setting the ipAddress variable to our robot's ip address manually, but that didn't fix the problem and since the its a server, the ipAdress seems meaningless.

Quote:
Originally Posted by nightpool View Post
This may be the issue. It probably stems from misconfiguration of the cRio or laptop. You should double check what team number you formatted it with.
We double-check the same thing too, but the error is still there. Did you have a particular configuration in mind?

When we were debugging the same issue, we found that both the mode and threadManager store non-null addresses. But whenever mode->CreateNode() was called, the null pointer error resurfaces. The variable mode is of type NetworkTableMode, so we replaced the code with
Code:
staticProvider = new NetworkTableProvider(NetworkServerMode::Server.CreateNode(ipAddress.c_str(), port, threadManager));
which still results in an error.

We are totally baffled; we just commented the livewindow stuff out as workaround but ultimately we need to figure out why this happens. Any additional suggestions? I remember there being a debugger that runs on the cRIO, but I'm not sure how that works.

Thanks!
-Masoug
__________________

JabbaScript
Reply With Quote
  #14   Spotlight this post!  
Unread 09-01-2013, 01:00
PaulDavis1968's Avatar
PaulDavis1968 PaulDavis1968 is offline
Embedded Software/Systems Engineer
AKA: Master of Complexity
FRC #2053 (TigerTronics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Endicot NY
Posts: 91
PaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nice
Re: NetworkTable crash in unmodified SimpleRobot template

Is there documentation that explains how the c++ networktable stuff works?
Reply With Quote
  #15   Spotlight this post!  
Unread 09-01-2013, 16:08
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

I have been unable to reproduce this problem. Try replacing ipAddress.c_str() with just "". It is actually ignored when in server mode (which it is always when running on the crio)
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 03:32.

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