My plugin makes octoprint segfault and crash without anything in the log file

Plugin: https://github.com/dieki-n/Octoprint-Filament-Scale

Essentially what I'm doing:

  • A util.RepeatedTimer sends a command to an external device via GPIO.
  • It then creates a GPIO.add_event_detect to wait for the data line to fall indicating the device is ready.
  • Then it reads some data from the device and sends it to the client via send_plugin_message.

Now, the crash happens during the callback from GPIO.add_event_detect. It doesn't crash every time or always crash on the same line - but always somewhere inside that function. There's nothing in octoprint.log, it segfaults and crashes without any error message. I've attached the strace.

Any idea what could be causing this?

strace.zip (252.6 KB)

Can you post your code showing where the crash occurs? If your plugin is on github you could link to that.

Somehow I missed the link to your github page! Whoops. I'll take a look when I have some time.