1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| Stack trace (most recent call last):
47: rclcpp::spin(std::make_shared<MinimalSubscriber>()); 48: rclcpp::shutdown(); 49: return 0; > 50: }
| 45: { | 46: rclcpp::init(argc, argv); | > 47: rclcpp::spin(std::make_shared<MinimalSubscriber>()); | 48: rclcpp::shutdown(); | 49: return 0; | Source "/usr/include/c++/9/bits/shared_ptr.h", line 718, in allocate_shared<MinimalSubscriber, std::allocator<MinimalSubscriber> > | 716: typedef typename std::remove_cv<_Tp>::type _Tp_nc; | 717: return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(), | > 718: std::forward<_Args>(__args)...); | 719: } | Source "/usr/include/c++/9/bits/shared_ptr.h", line 702, in shared_ptr<std::allocator<MinimalSubscriber> > | 700: { | 701: return shared_ptr<_Tp>(_Sp_alloc_shared_tag<_Alloc>{__a}, | > 702: std::forward<_Args>(__args)...); | 703: } | Source "/usr/include/c++/9/bits/shared_ptr.h", line 359, in __shared_ptr<std::allocator<MinimalSubscriber> > | 357: template<typename _Alloc, typename... _Args> | 358: shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args) | > 359: : __shared_ptr<_Tp>(__tag, std::forward<_Args>(__args)...) | 360: { } | Source "/usr/include/c++/9/bits/shared_ptr_base.h", line 1344, in __shared_count<MinimalSubscriber, std::allocator<MinimalSubscriber> > | 1342: template<typename _Alloc, typename... _Args> | 1343: __shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args) | >1344: : _M_ptr(), _M_refcount(_M_ptr, __tag, std::forward<_Args>(__args)...) | 1345: { _M_enable_shared_from_this_with(_M_ptr); } | Source "/usr/include/c++/9/bits/shared_ptr_base.h", line 679, in _Sp_counted_ptr_inplace<> | 677: auto __guard = std::__allocate_guarded(__a2); | 678: _Sp_cp_type* __mem = __guard.get(); | > 679: auto __pi = ::new (__mem) | 680: _Sp_cp_type(__a._M_a, std::forward<_Args>(__args)...); | 681: __guard = nullptr; | Source "/usr/include/c++/9/bits/shared_ptr_base.h", line 548, in construct<MinimalSubscriber> | 546: // _GLIBCXX_RESOLVE_LIB_DEFECTS | 547: // 2070. allocate_shared should use allocator_traits<A>::construct | > 548: allocator_traits<_Alloc>::construct(__a, _M_ptr(), | 549: std::forward<_Args>(__args)...); // might throw | 550: } | Source "/usr/include/c++/9/bits/alloc_traits.h", line 483, in construct<MinimalSubscriber> | 481: construct(allocator_type& __a, _Up* __p, _Args&&... __args) | 482: noexcept(std::is_nothrow_constructible<_Up, _Args...>::value) | > 483: { __a.construct(__p, std::forward<_Args>(__args)...); } | 484: | 485: /** Source "/usr/include/c++/9/new", line 174, in main [0x56060876e7b1] 172: // Default placement versions of operator new. 173: _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT > 174: { return __p; } 175: _GLIBCXX_NODISCARD inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT 176: { return __p; }
30: "topic", 10, std::bind(&MinimalSubscriber::topic_callback, this, _1)); 31: 32: int * p = nullptr; > 33: *p = 1;//制造断错误 34: } 35: 36: private: Segmentation fault (Address not mapped to object [(nil)])
|