![]() |
NetworkTable crash in unmodified SimpleRobot template
I'm getting a null pointer exeption in
Code:
NetworkTable::Initialize()Code:
staticProvider = new NetworkTableProvider(*(mode->CreateNode(ipAddress.c_str(), port, threadManager)));Earlier on in the call stack, the crash stems from Code:
SimpleRobot::StartCompetition()Code:
LiveWindow *lw = LiveWindow::GetInstance();Code:
NetworkTable::GetTable("LiveWindow")When will this be fixed in WPILib, and how can I work around it in the meantime? |
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 |
Re: NetworkTable crash in unmodified SimpleRobot template
Quote:
|
Re: NetworkTable crash in unmodified SimpleRobot template
I suggest that you reinstall the WindRiver update before blaming the library itself.
|
Re: NetworkTable crash in unmodified SimpleRobot template
Quote:
|
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.
|
Re: NetworkTable crash in unmodified SimpleRobot template
Code:
staticProvider = new NetworkTableProvider(*(mode->CreateNode(ipAddress.c_str(), port, threadManager)));Anyway, a null pointer exception would seem to indicate that something on that line is an uninitialized pointer. How/where did you declare staticProvider? |
Re: NetworkTable crash in unmodified SimpleRobot template
Quote:
|
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.
|
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 |
Re: NetworkTable crash in unmodified SimpleRobot template
Could ipAddress contain the null string? If so, ipAddress.c_str() would return nullptr.
|
Re: NetworkTable crash in unmodified SimpleRobot template
Quote:
|
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:
Quote:
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));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 |
Re: NetworkTable crash in unmodified SimpleRobot template
Is there documentation that explains how the c++ networktable stuff works?
|
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)
|
| All times are GMT -5. The time now is 12:43. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi