Ask Your Question
1

Compiling with dynamic_reconfigure server code leads to deadlock

asked 2014-06-18 10:08:17 -0500

Nikolaus Mayer gravatar image

updated 2014-06-18 10:19:18 -0500

I have a package into which I want to include dynamic_reconfigure code.

EDIT: I am running Fuerte on Ubuntu 12.04

The following .cfg is compiled into PACKAGENAMEParamsConfig.h without a problem.

#! /usr/bin/env python

PACKAGE='PACKAGENAME'
import roslib; roslib.load_manifest(PACKAGE)

from dynamic_reconfigure.parameter_generator import *
gen = ParameterGenerator()

gen.add("dummy", bool_t, 0, "", True)

exit(gen.generate(PACKAGE, "Config", "PACKAGENAMEParams"))

In my source code, after including

#include <dynamic_reconfigure/server.h>
#include "PACKAGENAME/PACKAGENAMEParamsConfig.h"

(and extending the cmake file(s)) I call ros::init and setup a dynamic_reconfigure::Server object:

dynamic_reconfigure::Server<PACKAGENAME::PACKAGENAMEParamsConfig> dynamic_reconfigure_server;

When run, the program locks itself in this last line. GDB reports:

Program received signal SIGINT, Interrupt.                                                        
__lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:132                   
132     ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Datei oder Verzeichnis nicht gefunden.                                                                                               
(gdb) bt                                                                                         
#0  __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:132               
#1  0x00007ffff3a87065 in _L_lock_858 () from /lib/x86_64-linux-gnu/libpthread.so.0               
#2  0x00007ffff3a86eba in __pthread_mutex_lock (mutex=0xe2a7f0) at pthread_mutex_lock.c:61        
#3  0x00007ffff6c8978d in ros::TransportTCP::enableRead() ()                                      
   from /opt/ros/fuerte/lib/libroscpp.so                                                          
#4  0x00007ffff6c8c0e5 in ros::TransportTCP::listen(int, int, boost::function<void (boost::shared_
ptr<ros::TransportTCP> const&)> const&) () from /opt/ros/fuerte/lib/libroscpp.so                  
#5  0x00007ffff6c7cd79 in ros::ConnectionManager::start() ()                                      
   from /opt/ros/fuerte/lib/libroscpp.so                                                          
#6  0x00007ffff6ca33c4 in ros::start() () from /opt/ros/fuerte/lib/libroscpp.so                   
#7  0x00007ffff6c79c48 in ros::NodeHandle::construct(std::string const&, bool) ()                 
   from /opt/ros/fuerte/lib/libroscpp.so                                                          
#8  0x00007ffff6c7adc5 in ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, st
d::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > co
nst&) () from /opt/ros/fuerte/lib/libroscpp.so                                                    
#9  0x00000000005223c3 in main (argc=1, argv=0x7fffffffdff8)                                      
    at /XXXXX/PACKAGENAME/src/main.cpp:448    [<--- 448 is where the ::Server is created]

If the server constructor line is commented out, everything works. However, if my code contains a NodeHandle constructor before that, e.g.

ros::NodeHandle nh_;
dynamic_reconfigure::Server<PACKAGENAME::PACKAGENAMEParamsConfig> dynamic_reconfigure_server;

then the lock happens in the first NodeHandle constructor.

edit retag flag offensive close merge delete

Comments

The same problem annoys me for 3 hours now... Hopefully someone can reply to this. I am using ROS Hydro btw...

EddiEdward gravatar imageEddiEdward ( 2014-06-24 03:52:30 -0500 )edit

Unless you can provide a way for use to reproduce we can't help much.

tfoote gravatar imagetfoote ( 2014-10-30 12:35:18 -0500 )edit

It was a bad idea in first place to build against Boost 1.52 with ROS-Hydro using 1.46

EddiEdward gravatar imageEddiEdward ( 2014-10-30 14:07:53 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-10-30 14:07:17 -0500

EddiEdward gravatar image

Fixed this thing a few months ago. ROS Hydro is built against Boost 1.46, back then we built our projects against Boost 1.52 to be able to use C++11. This caused some trouble with some ROS services (some boost-signals related stuff). Solution: ROS Indigo, new Boost, C++11 -> Working!

edit flag offensive delete link more

Comments

Thanks for the follow up. I've converted your comment to an answer.

tfoote gravatar imagetfoote ( 2014-10-30 14:25:17 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-06-18 10:08:17 -0500

Seen: 117 times

Last updated: Jun 18 '14