Closed gogins closed 3 years ago
Using valgrind --tool=helgrind
shows possible data races in the JSC library. I will research JSC issues.
GLib is not valgrind-friendly, leading to many false positives: https://gitlab.gnome.org/GNOME/glib/-/issues/947.
Running with valgrind --error-limit=no --tool=helgrind python3.7 playpen.py ~/michael.gogins.studio/music/sounds_with_internals/Drone-2.csd
shows that sound continues to play while the UI is frozen. Perhaps there is a conflict between Python logging
and PyObject-GTK.
Not using the logging.getLogger().debug -- no help.
Not using inspect.currentFrame() -- no help.
Not using the ConsoleMessageCaptor -- runs fine!
Using the ConsoleMessageCaptor but without the IOChannel watch -- runs fine!
The bug appears to be caused by using IOChannel.readline
when the IO_IN
condition is not for a whole line.
Indeed, there is a recent bug here: https://discourse.gnome.org/t/trying-to-understand-glib-iochannel-read-chars-under-python/5798/6
I will try os.read. But then the logic is tricky and it is hard to avoid a blocking read.
I have moved all message logging back to the console, and disabled the messages pane. I am closing this issue for now until a solution is found.
Ideally, the IOChannel would be polled and only available data would be read, until a newline was read, then the data would be written as a whole line.
With more happening as I build out a useful UI for Drone-2.csd, the playpen freezes after clicking on the play audio button. This is since either (a) I added more widgets to the UI, or (b) I began piping stderr into the messages TextView.
This is the best API reference: https://lazka.github.io/pgi-docs/