maliput / maliput_infrastructure

Driving simulation repository for workspace .repo indexes, Makefiles, etc.
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Getting a segfault when running malidrive_to_obj #45

Closed liangfok closed 5 years ago

liangfok commented 5 years ago

Steps to reproduce, at least on my Lenovo T460p laptop running Ubuntu 16.04.

$ source bringup 
access control disabled, clients can connect from any host

(dsim_workspace env) liang@liang-ThinkPad-T460p:~/dev/dsim_workspace$ source install/setup.bash 

(dsim_workspace env) liang@liang-ThinkPad-T460p:~/dev/dsim_workspace$ sudo apt-get install gdb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gdbserver libbabeltrace1 libc6-dbg libdw1
Suggested packages:
  gdb-doc
The following NEW packages will be installed:
  gdb gdbserver libbabeltrace1 libc6-dbg libdw1
0 upgraded, 5 newly installed, 0 to remove and 28 not upgraded.
Need to get 8,737 kB of archives.
After this operation, 51.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 libdw1 amd64 0.170-0.4 [203 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic/main amd64 libbabeltrace1 amd64 1.5.5-1 [154 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic/main amd64 gdb amd64 8.1-0ubuntu3 [2,937 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 gdbserver amd64 8.1-0ubuntu3 [282 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 libc6-dbg amd64 2.27-3ubuntu1 [5,161 kB]
Fetched 8,737 kB in 8s (1,038 kB/s)                                                                                                                         
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libdw1:amd64.
(Reading database ... 82552 files and directories currently installed.)
Preparing to unpack .../libdw1_0.170-0.4_amd64.deb ...
Unpacking libdw1:amd64 (0.170-0.4) ...
Selecting previously unselected package libbabeltrace1:amd64.
Preparing to unpack .../libbabeltrace1_1.5.5-1_amd64.deb ...
Unpacking libbabeltrace1:amd64 (1.5.5-1) ...
Selecting previously unselected package gdb.
Preparing to unpack .../gdb_8.1-0ubuntu3_amd64.deb ...
Unpacking gdb (8.1-0ubuntu3) ...
Selecting previously unselected package gdbserver.
Preparing to unpack .../gdbserver_8.1-0ubuntu3_amd64.deb ...
Unpacking gdbserver (8.1-0ubuntu3) ...
Selecting previously unselected package libc6-dbg:amd64.
Preparing to unpack .../libc6-dbg_2.27-3ubuntu1_amd64.deb ...
Unpacking libc6-dbg:amd64 (2.27-3ubuntu1) ...
Setting up libc6-dbg:amd64 (2.27-3ubuntu1) ...
Setting up libdw1:amd64 (0.170-0.4) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up gdbserver (8.1-0ubuntu3) ...
Setting up libbabeltrace1:amd64 (1.5.5-1) ...
Setting up gdb (8.1-0ubuntu3) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

(dsim_workspace env) liang@liang-ThinkPad-T460p:~/dev/dsim_workspace$ gdb --args ./install/malidrive/bin/malidrive/applications/malidrive_to_obj ./src/malidrive/resources/Figure8.xodr  .
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./install/malidrive/bin/malidrive/applications/malidrive_to_obj...done.
(gdb) run
Starting program: /home/liang/dev/dsim_workspace/install/malidrive/bin/malidrive/applications/malidrive_to_obj ./src/malidrive/resources/Figure8.xodr .
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
12_0_1's length is 0.0459466 and is smaller than linear_tolerance: 0.05
12_2_1's length is 0.0459862 and is smaller than linear_tolerance: 0.05
13_0_1's length is 0.0459466 and is smaller than linear_tolerance: 0.05
13_2_1's length is 0.0459861 and is smaller than linear_tolerance: 0.05
14_0_-1's length is 0.0459466 and is smaller than linear_tolerance: 0.05
14_2_-1's length is 0.0459861 and is smaller than linear_tolerance: 0.05
15_0_1's length is 0.0459466 and is smaller than linear_tolerance: 0.05
15_2_1's length is 0.0460257 and is smaller than linear_tolerance: 0.05
17_0_-1's length is 0.0459862 and is smaller than linear_tolerance: 0.05
17_2_-1's length is 0.0459861 and is smaller than linear_tolerance: 0.05
19_0_1's length is 0.0459862 and is smaller than linear_tolerance: 0.05
19_2_1's length is 0.0460257 and is smaller than linear_tolerance: 0.05
20_0_-1's length is 0.0459862 and is smaller than linear_tolerance: 0.05
20_2_-1's length is 0.0460257 and is smaller than linear_tolerance: 0.05
21_0_1's length is 0.0459861 and is smaller than linear_tolerance: 0.05
21_2_1's length is 0.0460257 and is smaller than linear_tolerance: 0.05

Program received signal SIGSEGV, Segmentation fault.
std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> const, drake::maliput::api::rules::DirectionUsageRule::State>, false> > >::_M_deallocate_nodes (this=<optimized out>, 
    __n=0x300000030) at /usr/include/c++/7/bits/hashtable_policy.h:2097
2097          _M_deallocate_node(__tmp);
(gdb) bt
#0  std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> const, drake::maliput::api::rules::DirectionUsageRule::State>, false> > >::_M_deallocate_nodes (this=<optimized out>, 
    __n=0x300000030) at /usr/include/c++/7/bits/hashtable_policy.h:2097
#1  std::_Hashtable<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State>, std::pair<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> const, drake::maliput::api::rules::DirectionUsageRule::State>, std::allocator<std::pair<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> const, drake::maliput::api::rules::DirectionUsageRule::State> >, std::__detail::_Select1st, std::equal_to<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> >, std::hash<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::clear (this=0x555555becaf0)
    at /usr/include/c++/7/bits/hashtable.h:2032
#2  std::_Hashtable<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State>, std::pair<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> const, drake::maliput::api::rules::DirectionUsageRule::State>, std::allocator<std::pair<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> const, drake::maliput::api::rules::DirectionUsageRule::State> >, std::__detail::_Select1st, std::equal_to<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> >, std::hash<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::~_Hashtable (this=0x555555becaf0, 
    __in_chrg=<optimized out>) at /usr/include/c++/7/bits/hashtable.h:1358
#3  std::unordered_map<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State>, drake::maliput::api::rules::DirectionUsageRule::State, std::hash<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> >, std::equal_to<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> >, std::allocator<std::pair<drake::maliput::api::TypeSpecificIdentifier<drake::maliput::api::rules::DirectionUsageRule::State> const, drake::maliput::api::rules::DirectionUsageRule::State> > >::~unordered_map (
    this=0x555555becaf0, __in_chrg=<optimized out>) at /usr/include/c++/7/bits/unordered_map.h:101
#4  drake::maliput::api::rules::DirectionUsageRule::~DirectionUsageRule (this=0x555555becaa0, __in_chrg=<optimized out>)
    at /opt/drake/include/drake/automotive/maliput/api/rules/direction_usage_rule.h:30
#5  std::_Destroy<drake::maliput::api::rules::DirectionUsageRule> (__pointer=<optimized out>) at /usr/include/c++/7/bits/stl_construct.h:98
---Type <return> to continue, or q <return> to quit---
#6  std::_Destroy_aux<false>::__destroy<drake::maliput::api::rules::DirectionUsageRule*> (__last=<optimized out>, __first=0x555555becaa0)
    at /usr/include/c++/7/bits/stl_construct.h:108
#7  std::_Destroy<drake::maliput::api::rules::DirectionUsageRule*> (__last=<optimized out>, __first=<optimized out>)
    at /usr/include/c++/7/bits/stl_construct.h:137
#8  std::_Destroy<drake::maliput::api::rules::DirectionUsageRule*, drake::maliput::api::rules::DirectionUsageRule> (__last=<optimized out>, 
    __first=<optimized out>) at /usr/include/c++/7/bits/stl_construct.h:206
#9  std::vector<drake::maliput::api::rules::DirectionUsageRule, std::allocator<drake::maliput::api::rules::DirectionUsageRule> >::~vector (
    this=0x555555bf53e0, __in_chrg=<optimized out>) at /usr/include/c++/7/bits/stl_vector.h:434
#10 drake::maliput::api::RoadNetwork::~RoadNetwork (this=0x555555bf5340, __in_chrg=<optimized out>)
    at /opt/drake/include/drake/automotive/maliput/api/road_network.h:40
#11 drake::maliput::api::RoadNetwork::~RoadNetwork (this=0x555555bf5340, __in_chrg=<optimized out>)
    at /opt/drake/include/drake/automotive/maliput/api/road_network.h:40
#12 std::default_delete<drake::maliput::api::RoadNetwork const>::operator() (this=<optimized out>, __ptr=0x555555bf5340)
    at /usr/include/c++/7/bits/unique_ptr.h:78
#13 std::unique_ptr<drake::maliput::api::RoadNetwork const, std::default_delete<drake::maliput::api::RoadNetwork const> >::~unique_ptr (
    this=0x7fffffffd468, __in_chrg=<optimized out>) at /usr/include/c++/7/bits/unique_ptr.h:268
#14 malidrive::DoGenerateObj (xodr_filename=..., obj_directory=...) at /home/liang/dev/dsim_workspace/src/malidrive/src/malidrive/malidrive_to_obj.cc:62
#15 0x0000555555554f0b in main (argc=<optimized out>, argv=<optimized out>)
    at /home/liang/dev/dsim_workspace/src/malidrive/src/applications/malidrive_to_obj_main.cc:23
(gdb) 
liangfok commented 5 years ago

The segfault is happening during destruction. The OBJ and MTL files are created:

$ ls Figure8*
Figure8.xodr.mtl  Figure8.xodr.obj
liangfok commented 5 years ago

Unfortunately, updating the workspace using source bringup -u /path/to/dsim-repos-index did not fix the problem.

liangfok commented 5 years ago

Closing this because after updating again post #47, the segfault went away.