I’m learning Rust and I’m trying to write a simple real-time audio analyzer. I’m using gtk-rs for the UI and rust-portaudio to interface with the audio devices. Gtk runs in the main thread and a portaudio stream runs in another thread, and that thread computes the power of the signal and sends it via a Sender/Receiver to the main thread which displays the value using a “level bar”.
Unfortunately, very often when I start the application or when I use one of the UI controls, the application crashes with messages like
objc: Method cache corrupted. This may be a message to an invalid object, or a memory error somewhere else.
analyzer(1084,0x7fff76a89000) malloc: *** error for object 0x7ff373877a08: incorrect checksum for freed object - object was probably modified after being freed.
The latter message happens in any possible function (BOMStorageSizeOfBlock, __psynch_cvwait, _gtk_css_image_equal, etc.)
Independently they run fine, but together it’s a mess, and frankly one I had hoped Rust would help me avoid. Is there any way to get out of this, or to find which component is causing the problem?