With the sigrok session running in a worker thread, if sr_session_stop is called from the main thread, it shuts down the pollfds used by the hardware drivers, without ensuring that the sigrok event loop is no longer using those pollfds. On the demo driver, this involves shutting down the GIOChannels, causing a segfault when the sigrok event loop tries to use them. Usu PulseView with the demo driver to test. This isn't a problem with just the demo driver; any driver's resources may be freed by sr_session_stop concurrently with the sigrok session running. st_session_stop should work with the event loop in athread-safe manner.
*** Bug 6 has been marked as a duplicate of this bug. ***
This just became a blocker for the PulseView release.
https://gitorious.org/~mrnuke/sigrok/libsigrok/commits/b4
The above patchset has two independent changes that both need to be applied to solve this bug: 1) Fix the problem I mentioned on IRC about the use of cb_data in the demo driver. 2) Make sr_session_stop() thread-safe. Applying only one of the above will not solve the problem.