Created attachment 96 [details] script to demonstrate the problem The attached script starts a separate thread to run 'session.run()'. If then in the main thread another libsigrok context object is created, the program segfaults. The segfault occurs both when using the demo and the serial-dmm driver.
Created attachment 97 [details] Backtrace when using the 'demo' driver. I made it crash multiple times, it always crashed in the 'g_hash_table_iter_init()' function.
Created attachment 98 [details] Backtrace when using the 'serial-dmm' driver. I made it crash multiple times, it always crashed in an unknown function called from 'sr_session_stop_sync()'.
I'd be surprised if this is a bug in the Python bindings or even in the underlying C++ bindings. Support for even the existence of multiple contexts, let alone concurrent usage, is theoretical at best in libsigrok. I would suggest trying to reproduce this issue first with a C++ program, and then with a C one. My guess is the problem will remain. Reassigning this bug from python bindings to API.