Go to Post ...and leave your bumpers at home. - Andy Grady [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 13-01-2014, 20:21
William Kunkel William Kunkel is offline
Programming Lead
AKA: Kunkel
FRC #0422 (Mech Tech Dragons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Richmond, VA
Posts: 94
William Kunkel is an unknown quantity at this point
Calling LiveWindow::GetInstance() during static initialization causes program crash

I've been trying out a new way of organizing my team's code, which involves initializing subsystems during static initialization. Unfortunately, if I initialize a Talon statically in a namespace, the program crashes. Monitoring the output via netconsole gives this:

Quote:
* Loading FRC_UserProgram.out: FRC_UserProgram


[NT] NetworkTable::GetTable()...

[NT] Initializing...

[NT] NetworkTable::CheckInit()...

[NT] NetworkTable::Initialize()...



program

Exception current instruction address: 0x00000000

Machine Status Register: 0x0008b012

Condition Register: 0x24004282

Task: 0xb6ec60 "Main Application Thread"

0xb6ec60 (Main Application Thread): task 0xb6ec60 has had a failure and has been stopped.

0xb6ec60 (Main Application Thread): fatal kernel task-level exception!
That last message before the exception comes right before this function call in the NetworkTables code:

Code:
staticProvider = new NetworkTableProvider(*(staticNode = mode->CreateNode(ipAddress.c_str(), port, threadManager, streamFactory, streamDeleter, typeManager)));
Which is called because a NetworkTable::GetTable() call in LiveWindow::LiveWindow() called by LiveWindow::GetInstance() checks to see if NetworkTable::staticProvider is NULL, and if so, creates it. Moving the initialization to the RobotInit() function fixes the problem, and the messages related to setting NetworkTable::staticProvider are not displayed. So basically, my question is this: Where does NetworkTable::staticProvider get set, and is there a way around this, short of intializing in RobotInit?
Reply With Quote
 


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:04.

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