Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible race condition in TopicInfo #430

Closed
iche033 opened this issue Aug 15, 2023 · 1 comment
Closed

Possible race condition in TopicInfo #430

iche033 opened this issue Aug 15, 2023 · 1 comment
Labels
bug Something isn't working 🎵 harmonic Gazebo Harmonic

Comments

@iche033
Copy link
Contributor

iche033 commented Aug 15, 2023

Environment

  • OS Version: 22.04
  • Source or binary build? source build, harmonic

Description

  • Expected behavior: Gazebo GUI plugins should be able to query topic info
  • Actual behavior: Gazebo GUI plugins crash when querying topic info

Steps to reproduce

  1. Launch Gazebo and repeatedly open and close a gui plugin that uses the ToipcInfo API, .e.g TopicViewer or Image Display

Eventually the gazebo GUI will crash. For me, this happens within 5 tries.

Output

(gdb) bt
#0  0x00007fffe0009690 in  ()
#1  0x00007ffff27666a0 in std::_Destroy<gz::transport::v13::MessagePublisher>(gz::transport::v13::MessagePublisher*) (__pointer=0x7fffe0009580) at /usr/include/c++/11/bits/stl_construct.h:151
#2  std::_Destroy_aux<false>::__destroy<gz::transport::v13::MessagePublisher*>(gz::transport::v13::MessagePublisher*, gz::transport::v13::MessagePublisher*)
    (__last=<optimized out>, __first=0x7fffe0009580) at /usr/include/c++/11/bits/stl_construct.h:163
#3  std::_Destroy<gz::transport::v13::MessagePublisher*>(gz::transport::v13::MessagePublisher*, gz::transport::v13::MessagePublisher*) (__last=<optimized out>, __first=<optimized out>)
    at /usr/include/c++/11/bits/stl_construct.h:196
#4  std::_Destroy<gz::transport::v13::MessagePublisher*, gz::transport::v13::MessagePublisher>(gz::transport::v13::MessagePublisher*, gz::transport::v13::MessagePublisher*, std::allocator<gz::transport::v13::MessagePublisher>&) (__last=<optimized out>, __first=<optimized out>) at /usr/include/c++/11/bits/alloc_traits.h:848
#5  std::vector<gz::transport::v13::MessagePublisher, std::allocator<gz::transport::v13::MessagePublisher> >::_M_realloc_insert<gz::transport::v13::MessagePublisher>(__gnu_cxx::__normal_iterator<gz::transport::v13::MessagePublisher*, std::vector<gz::transport::v13::MessagePublisher, std::allocator<gz::transport::v13::MessagePublisher> > >, gz::transport::v13::MessagePublisher&&)
   
       (this=0x7fffe0009500, __position={<gz::transport::v13::Publisher> = {_vptr.Publisher = 0x100, topic = "", addr = "", pUuid = "", nUuid = "", opts = {_vptr.AdvertiseOptions = 0x0, dataPtr = std::unique_ptr<gz::transport::v13::AdvertiseOptionsPrivate> = {get() = 0x0}}}, ctrl = "", msgTypeName = "", msgOpts = {<gz::transport::v13::AdvertiseOptions> = {_vptr.AdvertiseOptions = 0x0, dataPtr = std::unique_ptr<gz::transport::v13::AdvertiseOptionsPrivate> = {get() = 0x0}}, dataPtr = std::unique_ptr<gz::transport::v13::AdvertiseMessageOptionsPrivate> = {get() = 0x0}}}) at /usr/include/c++/11/bits/vector.tcc:498
#6  0x00007ffff2768298 in std::vector<gz::transport::v13::MessagePublisher, std::allocator<gz::transport::v13::MessagePublisher> >::emplace_back<gz::transport::v13::MessagePublisher>(gz::transport::v13::MessagePublisher&&) (this=0x7fffe0009500) at /usr/include/c++/11/bits/vector.tcc:121
#7  std::vector<gz::transport::v13::MessagePublisher, std::allocator<gz::transport::v13::MessagePublisher> >::push_back(gz::transport::v13::MessagePublisher&&) (__x=..., this=0x7fffe0009500)
    at /usr/include/c++/11/bits/stl_vector.h:1204
#8  gz::transport::v13::TopicStorage<gz::transport::v13::MessagePublisher>::AddPublisher(gz::transport::v13::MessagePublisher const&) (this=this@entry=0x555555a8bb20, _publisher=...)
    at /home/ian/code/gz_h_ws/src/gz-transport/include/gz/transport/TopicStorage.hh:82
#9  0x00007ffff278a42f in gz::transport::v13::Discovery<gz::transport::v13::MessagePublisher>::DispatchDiscoveryMsg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char*, unsigned short)
    (this=this@entry=0x555555a8b9b0, _fromIp="172.17.0.1", _msg=_msg@entry=0x7fffeac53dd2 "\020\n\032$22e468c1-90ef-47dc-9de7-0ff52c8b0b3d \t:\256\001\n*@/injera:ian@/world/ModelTest/light_config\022\026tcp://172.17.0.1:38041\032$22e468c1-90ef-47dc-9de7-0ff52c8b0b3d\"$906fe6cb-ef51-4f1e-9db0-c6c04fd57b75(\002\062\032\022\rgz.ms"..., _len=_len@entry=219)
    at /home/ian/code/gz_h_ws/src/gz-transport/include/gz/transport/Discovery.hh:1078
#10 0x00007ffff278af38 in gz::transport::v13::Discovery<gz::transport::v13::MessagePublisher>::RecvDiscoveryUpdate() (this=0x555555a8b9b0)
    at /home/ian/code/gz_h_ws/src/gz-transport/include/gz/transport/Discovery.hh:900
#11 0x00007ffff278b068 in gz::transport::v13::Discovery<gz::transport::v13::MessagePublisher>::RecvMessages() (this=0x555555a8b9b0)
    at /home/ian/code/gz_h_ws/src/gz-transport/include/gz/transport/Discovery.hh:832
#12 0x00007ffff3af02b3 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#13 0x00007ffff7a83b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#14 0x00007ffff7b15a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
@iche033 iche033 added the bug Something isn't working label Aug 15, 2023
@iche033 iche033 added the 🎵 harmonic Gazebo Harmonic label Aug 15, 2023
@azeey azeey moved this from Inbox to To do in Core development Aug 21, 2023
@caguero
Copy link
Collaborator

caguero commented Aug 24, 2023

@iche033, I was able to reproduce the problem. I think there are two separate issues:

The crash with Image Display looks an issue in Transport. I created a fix in #432 .

The crash with Topic Viewer seems different, as I think there's an additional issue in the TopicViewer plugin. I'll create a separate fix for that. See gazebosim/gz-gui#566.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

No branches or pull requests

2 participants