
Hello all, I am attempting the following:
class Durp { tf::TransformListener _tfListener; tf::StampedTransform * saveMyTransform; Durp() : saveMyTransform(NULL) { Nodehandle n; someSub = n.sub(bla bla bla &callback); } ~Durp() { if(saveMyTransform!=NULL) delete saveMyTransform } void callback(geo_msgs::StampedPoint incPoint) { tf::StampedTransform tempTransform; // Could someone please shed some light on what I am doing wrong. I would sincerely appreciate, I am ripping my hair out.
Segfault for StampedTransform tempTransform dump:
0x00007fffeba92116 in std::basic_string, std::allocator >::~basic_string() () from /usr/lib/libstdc++.so.6 (gdb) bt #0 0x00007fffeba92116 in std::basic_string, std::allocator >::~basic_string() () from /usr/lib/libstdc++.so.6 #1 0x000000000041d321 in ~StampedTransform (this=0x7fffd4f7b2b0, __in_chrg=) at /opt/ros/electric/stacks/geometry/tf/include/tf/transform_datatypes.h:89 #2 0x00007fffee75421a in tf::Transformer::setTransform (this=, transform=, authority=) at /tmp/buildd/ros-electric-geometry-1.6.1/debian/ros-electric-geometry/opt/ros/electric/stacks/geometry/tf/src/tf.cpp:438 #3 0x00007fffee7670a5 in tf::TransformListener::subscription_callback (this=, msg=) at /tmp/buildd/ros-electric-geometry-1.6.1/debian/ros-electric-geometry/opt/ros/electric/stacks/geometry/tf/src/transform_listener.cpp:326 #4 0x00007fffee76d1ab in boost::function1 > const> const&>::operator() (function_obj_ptr=, a0=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece. ) at /usr/include/boost/function/function_template.hpp:1013 #5 boost::detail::function::void_function_obj_invoker1 > const> const&)>, void, boost::shared_ptr > const> >::invoke(boost::detail::function::function_buffer&, boost::shared_ptr > const>) (function_obj_ptr=, a0=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece. ) at /usr/include/boost/function/function_template.hpp:153 #6 0x00007fffee770890 in boost::function1 > const> >::operator() (this=0x7fffd0000a70, params=) at /usr/include/boost/function/function_template.hpp:1013 #7 ros::SubscriptionCallbackHelperT > const> const&, void>::call (this=0x7fffd0000a70, params=) at /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/include/ros/subscription_callback_helper.h:180
Backtrace of when I pass my dynamically allocated Transform in
0 0x00007fffeba921fd in std::string::assign(std::string const&) () from /usr/lib/libstdc++.so.6 #1 0x00007fffee75581e in std::string::operator= (this=, target_frame=, source_frame=, time=..., transform=...) at /usr/include/c++/4.4/bits/basic_string.h:506 #2 tf::Transformer::lookupTransform (this=, target_frame=, source_frame=, time=..., transform=...) at /tmp/buildd/ros-electric-geometry-1.6.1/debian/ros-electric-geometry/opt/ros/electric/stacks/geometry/tf/src/tf.cpp:483 #3 0x0000000000439494 in RaveServer::displayWaypoint (this=0x7fffffffd9c0, incomingWaypoint=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece. ) at /home/constantin/workspace/rospackages/OpenRAVEROSInterp/src/RaveServer.cpp:230 #4 0x0000000000426783 in boost::_mfi::mf1 > >::operator() (function_obj_ptr=..., a0=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece. ) at /usr/include/boost/bind/mem_fn_template.hpp:162 #5 operator() > >, boost::_bi::list1 >&> > ( function_obj_ptr=..., a0=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece. ) at /usr/include/boost/bind/bind.hpp:306 #6 operator() > > (function_obj_ptr=..., a0=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece. ) at /usr/include/boost/bind/bind_template.hpp:32 #7 boost::detail::function::void_function_obj_invoker1 > >, boost::_bi::list2, boost::arg > >, void, geometry_msgs::PointStamped_ > >::invoke (function_obj_ptr=..., a0=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece. ) at /usr/include/boost/function/function_template.hpp:153 #8 0x000000000042bb92 in boost::function1 > >::operator() (this=0x7fffd0016780, params=) at /usr/include/boost/function/function_template.hpp:1013 #9 ros::SubscriptionCallbackHelperT >, void>::call (this=0x7fffd0016780, params=) at /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/include/ros/subscription_callback_helper.h:180 Originally posted by Constantin S on ROS Answers with karma: 296 on 2011-11-11
Post score: 0
Original comments
Comment by tfoote on 2011-11-14:
The best thing to do is make a small test program which reproduces the problem. Often this will help you to find the problem without even needing external help. And it makes it possible to isolate the problem.
Comment by Constantin S on 2011-11-12:
be helpful? Thank you Ivan.
Comment by Constantin S on 2011-11-12:
Hi Ivan, the code is large and is a module for OpenRAVE. What part of the code would you be interested in? The callback is where the code always segfaults. If I use tempTransform, I segfault in the default constructor. If I comment it out, I segFault in the lookUpTransform. would the code stil
Comment by Ivan Dryanovski on 2011-11-11:
Could you post the full code? It might be more helpful.