SimpleBLE icon indicating copy to clipboard operation
SimpleBLE copied to clipboard

Segmentation fault with rust

Open bWanShiTong opened this issue 1 year ago • 0 comments

Sometimes when connecting to Peripheral segmentation fault happens when debugging why, stop reason is signal SIGSEGV: invalid address in function void Bindings::RustyPeripheral::link(SimpleRsBLE::Peripheral& target) in line 129:

* thread #1, name = 'ble-cron', stop reason = signal SIGSEGV: invalid address (fault address: 0x62663433)
    frame #0: 0x000055555565b2b1 ble-cron`operator(__closure=0x00007fff7400a470) at Bindings.cpp:129:56
   126      *_peripheral = ⌖  // THIS LINE IS SUPER IMPORTANT
   127 
   128      _internal->set_callback_on_connected([this]() {
-> 129          SimpleRsBLE::Peripheral* p_peripheral = *this->_peripheral;
   130          if (p_peripheral == nullptr) return;
   131 
   132          p_peripheral->on_callback_connected();

bWanShiTong avatar Sep 17 '24 19:09 bWanShiTong