chris-zen / coremidi

CoreMIDI library for Rust
https://chris-zen.github.io/coremidi/coremidi/
MIT License
75 stars 20 forks source link

SIGILL in Tests on macOS 10.14 #17

Closed jasongrlicky closed 4 years ago

jasongrlicky commented 4 years ago

Hi there! I was just investigating the issue with the notifications callback not being called, and figured getting the tests for this crate running would be a good first step. However, I ran into an error when running one of the tests:

> cargo test -- notifications::tests::notification_from_property_changed --exact

... returns the following error message when running on my machine:

    Finished test [unoptimized + debuginfo] target(s) in 1.65s
     Running target/debug/deps/coremidi-8245418d84ec7987

running 1 test
error: test failed, to rerun pass '--lib'

Caused by:
  process didn't exit successfully: `/Users/jason/projects/coremidi/target/debug/deps/coremidi-8245418d84ec7987 'notifications::tests::notification_from_property_changed' --exact` (signal: 4, SIGILL: illegal instruction)

I'm using Rust 1.43 stable on macOS Mojave 10.14.6.

From debugging the test in VSCode, it seems like a CFString might be getting over-released upon being drop()ed in Notification::from_property_changed(), which is called by Notification::from(&MidiNotification). I'm not sure, as I haven't programmed directly against the core-foundation crate yet, so I'm familiar with how things are supposed to work there.

I'll be looking into this further, but figured I'd get the conversation started to see if anyone has any ideas about what could be causing this particular test to break. Thank you!