Ask Your Question

gdb says "program is not being run" upon gazebo

asked 2011-08-16 11:40:32 -0500

130s gravatar image

updated 2011-08-18 10:28:13 -0500

While I'm trying to solve this issue, I'm stuck at gdb that's suggested by a commenter. I'm new to gdb (though I'm used to the debugger feature on Eclipse). I'm referring to this instruction.

Phenom: gdb seems not processing gazebo like following:

DellMachine@ROS-User:~/ros_workspace/pr2_tutorials$ ps -ef|grep gazebo/bin/gazebo
1000      4239  4197 99 16:20 ?        00:02:03 /opt/ros/diamondback/stacks/simulator_gazebo/gazebo/bin/gazebo -u /opt/ros/diamondback/stacks/simulator_gazebo/gazebo_worlds/worlds/ __name:=gazebo __log:=/home/ROS-User/.ros/log/44905b94-c85e-11e0-ae9a-0026b9168399/gazebo-2.log
1000      6626  1885  0 16:22 pts/0    00:00:00 grep --color=auto gazebo/bin/gazebo
DellMachine@ROS-User:~/ros_workspace/pr2_tutorials$ sudo gdb --pid 4239
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
Attaching to process 4239
Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
(gdb) cont
The program is not being run.


Step made: following this page, a file pr2_nav_tutorial.launch that's used for running gazebo is modified as:

  <!-- machine tags for sim, be sure to set environment variable ROBOT to sim -->
  <include file="$(find pr2_machine)/sim.machine" />
  <include file="$(find pr2_navigation_global)/amcl_node.xml" />
  <include file="$(find pr2_navigation_teleop)/teleop.xml" />
  <include file="$(find pr2_navigation_perception)/lasers_and_filters.xml" />
  <!--include file="$(find 2dnav_pr2)/config/map_server.launch" /-->
  <include file="$(find pr2_navigation_perception)/ground_plane.xml" />
  <!-- The navigation stack and associated parameters -->
  <include file="$(find pr2_navigation_global)/move_base.xml" />
  <node name="map_server" pkg="map_server" type="map_server" args="$(find gazebo_worlds)/Media/materials/textures/map_blank.png 0.1" respawn="true" />

  ***<!-- Added for gdb -->***
  <!-- start gazebo with an empty plane -->
  <param name="/use_sim_time" value="true" />
  <node name="gazebo" pkg="gazebo" launch-prefix="$(find gazebo_worlds)/scripts/gdbrun" type="gazebo" args="$(find gazebo_worlds)/worlds/" respawn="false" output="screen"/>


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-08-16 13:50:57 -0500

Eric Perko gravatar image

It looks like Ubuntu doesn't allow you to attach to an arbitrary process. See and .

It looks like the quick workaround would be to just run GDB as root.

edit flag offensive delete link more


@Eric Perko Thanks. Although "sudo gdb" didn't work, "sudo chmod +s /usr/bin/gdb" as suggested by the 2nd link works out (not sure why but it's good enough for now as a workaround).
130s gravatar image 130s  ( 2011-08-18 11:10:41 -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


Asked: 2011-08-16 11:40:32 -0500

Seen: 5,816 times

Last updated: Aug 18 '11