[ playerstage-Patches-3175505 ] Player starts alwayson drivers before listening to TCP ports
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.science.robotics.playerstage |
|---|---|
| Message-ID | <[email protected]> |
Patches item #3175505, was opened at 2011-02-08 18:12 Message generated for change (Tracker Item Submitted) made by krijesta You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=433166&aid=3175505&group_id=42445 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Player Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Chris (krijesta) Assigned to: Rich Mattes (jpgr87) Summary: Player starts alwayson drivers before listening to TCP ports Initial Comment: When player is starting up it starts and subscribes to all of the alwayson drivers before it starts listening to its TCP/UDP connections. This is an issue as it can result in a conditional jump depending on an uninitilised value (see valgrind output below) and also causes remote drivers to be used to connect to to other driver running on the player server. Valgrind output - here GraphicsAdapter is a nonthreaded plugin driver and inroPlannerDriver is a threaded plugin driver, both running on the same port in the same server: ==24315== Conditional jump or move depends on uninitialised value(s) ==24315== at 0x59ED982: PlayerTCP::Listening(int) (in /usr/lib/libplayertcp.so.2.1.4) ==24315== by 0x59F0D87: TCPRemoteDriverConnection::Connect() (in /usr/lib/libplayertcp.so.2.1.4) ==24315== by 0x53D7AAC: RemoteDriver::Connect(QueuePointer const&, player_devaddr const&) (in /usr/lib/libplayercore.so.2.1.4) ==24315== by 0x53D88F0: RemoteDriver::Subscribe(QueuePointer&, player_devaddr) (in /usr/lib/libplayercore.so.2.1.4) ==24315== by 0x53CD3AE: Device::Subscribe(QueuePointer&) (in /usr/lib/libplayercore.so.2.1.4) ==24315== by 0x1F1A3136: GraphicsAdapter::Setup() (graphicsadapter.cpp:99) ==24315== by 0x53CB43B: Driver::Subscribe(player_devaddr) (in /usr/lib/libplayercore.so.2.1.4) ==24315== by 0x53CD49E: Device::Subscribe(QueuePointer&) (in /usr/lib/libplayercore.so.2.1.4) ==24315== by 0x1DEB35EF: inro::BaseRequire::Subscribe() (baserequire.cpp:93) ==24315== by 0x20698677: InroPlannerDriver::MainSetup() (inroplanner.cpp:278) ==24315== by 0x53CCBAB: ThreadedDriver::DummyMain(void*) (in /usr/lib/libplayercore.so.2.1.4) ==24315== by 0xAC0A9C9: start_thread (pthread_create.c:300) The unconditional jump is occurring because the Listening() call requires Listen(...) to have been called to set up the data it is comparing to, the remote driver construction is also evident. The attached patch moves the starting of the alwayson driver to below the TCP port setup and I believe should cause no side effects. This has been tested on a modified 2.1.4 branch and compiles under SVN trunk (rev. 9036) and as the section of the code hasn't changed between those revisions I think that it should still be valid. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=433166&aid=3175505&group_id=42445 ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb