Coder Social home page Coder Social logo

cubeb-coreaudio-rs's Introduction

cubeb-coreaudio-rs

CircleCI Build & Test

Rust implementation of Cubeb on the MacOS platform.

Current Goals

  • Keep refactoring the implementation until it looks rusty! (it's translated from C at first.)

Status

This is now the Firefox's default audio backend on Mac OS.

Install

Install cubeb-coreaudio within cubeb

Run the following command:

curl https://raw.githubusercontent.com/mozilla/cubeb-coreaudio-rs/trailblazer/build-audiounit-rust-in-cubeb.sh | sh

Other

Just clone this repo

Test

Please run sh run_tests.sh.

Some tests cannot be run in parallel. They may operate the same device at the same time, or indirectly fire some system events that are listened by some tests.

The tests that may affect others are marked #[ignore]. They will be run by cargo test ... -- --ignored ... after finishing normal tests. Most of the tests are executed in run_tests.sh. Only those tests commented with FIXME are left.

Git Hooks

You can install git hooks by running install_git_hook.sh. Then pre-push script will be run and do the cargo fmt and cargo clippy check before the commits are pushed to remote.

Run Sanitizers

Run AddressSanitizer (ASan), LeakSanitizer (LSan), MemorySanitizer (MSan), ThreadSanitizer (TSan) by sh run_sanitizers.sh.

The above command will run all the test suits in run_tests.sh by all the available sanitizers. However, it takes a long time for finshing the tests.

Device Tests

Run run_device_tests.sh.

If you'd like to run all the device tests with sanitizers, use RUSTFLAGS="-Z sanitizer=<SAN>" sh run_device_tests.sh with valid <SAN> such as address or thread.

Device Switching

The system default device will be changed during our tests. All the available devices will take turns being the system default device. However, after finishing the tests, the default device will be set to the original one. The sounds in the tests should be able to continue whatever the system default device is.

Device Plugging/Unplugging

We implement APIs simulating plugging or unplugging a device by adding or removing an aggregate device programmatically. It's used to verify our callbacks for minitoring the system devices work.

Manual Test

  • Output devices switching
    • $ cargo test test_switch_output_device -- --ignored --nocapture
    • Enter s to switch output devices
    • Enter q to finish test
  • Device collection change
    • cargo test test_device_collection_change -- --ignored --nocapture
    • Plug/Unplug devices to see events log.
  • Manual Stream Tester
    • cargo test test_stream_tester -- --ignored --nocapture
      • c to create a stream
      • d to destroy a stream
      • s to start the created stream
      • t to stop the created stream
      • r to register a device changed callback to the created stream
      • v to set volume to the created stream
      • q to quit the test
    • It's useful to simulate the stream bahavior to reproduce the bug we found, with some modified code.

TODO

See todo list

Issues

  • Atomic:
    • We need atomic type around f32 but there is no this type in the stardard Rust
    • Using atomic-rs to do this.
  • kAudioDevicePropertyBufferFrameSize cannot be set when another stream using the same device with smaller buffer size is active. See here for details.

Test issues

  • Fail to run tests that depend on AggregateDevice::create_blank_device with the tests that work with the device event listeners
    • The AggregateDevice::create_blank_device will add an aggregate device to the system and fire the device-change events indirectly.
  • TestDeviceSwitcher cannot work when there is an alive full-duplex stream
    • An aggregate device will be created for a duplex stream when its input and output devices are different.
    • TestDeviceSwitcher will cached the available devices, upon it's created, as the candidates for default device
    • Hence the created aggregate device may be cached in TestDeviceSwitcher
    • If the aggregate device is destroyed (when the destroying the duplex stream created it) but the TestDeviceSwitcher is still working, it will set a destroyed device as the default device
    • See details in device_change.rs

Branches

cubeb-coreaudio-rs's People

Contributors

achronop avatar chunminchang avatar glandium avatar jrmuizel avatar kinetiknz avatar koalab99 avatar kvark avatar mstange avatar padenot avatar pehrsons avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cubeb-coreaudio-rs's Issues

`position` keeps growing even when stream is stopped

The failing test in BMO 1654699 indicates the position keeps growing when stream is already stopped.

I guess the reason is that interpolated_frames is increased unlimitedly.

One approach is to add outframes to OutputCallbackTimingData and use it to create a bound for interpolated_frames (e.g., interpolated_frames = min(interpolated_frames, outframes)). Or we can apply the same manner on WASAPI backend for this case.

Best strategy for pre-allocating buffers used in I/O callback

Hi there,

I'm using cubeb-rs to build an audio application (for macOS only at the moment) capable of some level of audio processing. As a result, I'm writing my own audio processing graph which involves chaining a set of audio processing nodes together and run the audio input/output through them on each I/O callback. Some of the nodes require pre-allocating buffers in order to perform their tasks.

At the moment, I'm using a naive approach of pre-allocating the same amount of space as specified when creating the I/O stream (i.e. the StreamBuilder::latency() I specified when creating the Stream).

I realize there are a few possible issues with this approach:

  1. It's possible that the requested buffer size can not be fulfilled by the audio device (e.g. due to the size being too small or too large)
  2. It's also possible that the buffer size may work initially, but if the underlying device of the stream changes (e.g. due to the initial device being disconnected), then the new device could have a different sample rate, causing resampling happening internally in cubeb, then causes the I/O callback to use a different buffer size (for example, if the initially connected device has a sample rate of 48000 and a buffer size of 256, when it disconnects and the stream falling back to another device with sample rate of 44100, then the audio I/O will start to tick with input/output buffer size of 279, at which point the pre-allocated buffers in the audio processing nodes are no longer sufficient)

For 1), I tried to find an API for figuring out the actual buffer size (or latency) of the audio stream after it has been created. However neither Stream::latency() or Stream::input_latency() seem to return the actual buffer size.

For 2), the only way I can think of now is to write some code to stop the audio stream once a device change is detected (e.g. via the device changed callback of Stream), then re-allocate buffers if needed and try to restart the stream using the new device.

Would be keen to hear your thoughts.

Thanks.

Test failure with Blackhole installed

With this, which is very useful:

thread 'backend::tests::api::test_get_same_group_id_for_builtin_device_pairs' panicked at 'assertion failed: group_ids.insert(source, id.into_string().unwrap()).is_none()', src/backend/tests/api.rs:1268:1

Looks like it's BlackHole_ModelUID multiple times.

Firefox crash when running cubeb-coreaudio-rs `./run_tests.sh`

STR on an M1 Max (not sure if relevant):

  • Play audio in Firefox, using the Web Audio API (I was playing something on soundcloud)
  • Run the tests via the wrapper script: ./run_tests.sh

Expected:

  • It messes up the audio, because it changes the default audio output device a few times, etc.

Actual:

I think we need to stop putting in asserts like this, it's really annoying to crash on something like that. It's a lot better to simply rely on the system erroring out and this crate or Firefox dealing with the error.

cubeb-coreaudio-rs fails to build with Rust 1.37

I ran into this when working on updating Firefox to use the latest Rust release, 1.37:

[task 2019-08-15T19:17:02.006Z] 19:17:02     INFO -  error: trait objects without an explicit `dyn` are deprecated
[task 2019-08-15T19:17:02.006Z] 19:17:02     INFO -     --> media/libcubeb/cubeb-coreaudio-rs/src/backend/mod.rs:320:17
[task 2019-08-15T19:17:02.007Z] 19:17:02     INFO -      |
[task 2019-08-15T19:17:02.007Z] 19:17:02     INFO -  320 | ) -> Result<Box<AutoArrayWrapper>> {
[task 2019-08-15T19:17:02.007Z] 19:17:02     INFO -      |                 ^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn AutoArrayWrapper`
[task 2019-08-15T19:17:02.007Z] 19:17:02     INFO -      |
[task 2019-08-15T19:17:02.008Z] 19:17:02     INFO -      = note: `-D bare-trait-objects` implied by `-D warnings`
[task 2019-08-15T19:17:02.008Z] 19:17:02     INFO -  error: trait objects without an explicit `dyn` are deprecated
[task 2019-08-15T19:17:02.008Z] 19:17:02     INFO -      --> media/libcubeb/cubeb-coreaudio-rs/src/backend/mod.rs:2559:37
[task 2019-08-15T19:17:02.008Z] 19:17:02     INFO -       |
[task 2019-08-15T19:17:02.008Z] 19:17:02     INFO -  2559 |     input_linear_buffer: Option<Box<AutoArrayWrapper>>,
[task 2019-08-15T19:17:02.008Z] 19:17:02     INFO -       |                                     ^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn AutoArrayWrapper`
[task 2019-08-15T19:17:02.008Z] 19:17:02     INFO -  warning: ignoring -C extra-filename flag due to -o flag
[task 2019-08-15T19:17:02.008Z] 19:17:02     INFO -  error: aborting due to 2 previous errors
[task 2019-08-15T19:17:02.008Z] 19:17:02    ERROR -  error: Could not compile `cubeb-coreaudio`.

Test passed when `cargo fmt --all -- --check` fails

My terminal gives a warning when running the update introduced by #57 as follow, but the travis server doesn't fail.

We should make cargo fmt --all -- --check work.

cchang@cchang-37365 cubeb-coreaudio-rs % cargo fmt --all -- --check                                                                     < (git) pr-57
Diff in /Users/cchang/Work/cubeb-coreaudio-rs/src/backend/mod.rs at line 673:
                 .unwrap()
                 .elements()
                 / input_channels;
-            if prev_frames_written == 0 && buffered_input_frames > input_frames_needed  as usize {
-                let samples_to_pop = (buffered_input_frames - input_frames_needed as usize) * input_channels;
+            if prev_frames_written == 0 && buffered_input_frames > input_frames_needed as usize {
+                let samples_to_pop =
+                    (buffered_input_frames - input_frames_needed as usize) * input_channels;
                 stm.core_stream_data
                     .input_linear_buffer
                     .as_mut()
Diff in /Users/cchang/Work/cubeb-coreaudio-rs/src/backend/mod.rs at line 681:
                     .unwrap()
                     .pop(samples_to_pop);
-                stm.frames_read.fetch_sub((samples_to_pop / input_channels) as i64, Ordering::SeqCst);
+                stm.frames_read
+                    .fetch_sub((samples_to_pop / input_channels) as i64, Ordering::SeqCst);
             }
 
             let elements = (missing_frames

Hi assertion when running `sh run_device_tests.sh`

The assertion is hit when running sh run_device_tests.sh

Assertion failed: (out_len == output_frame_count), function output, file /Users/cchang/.cargo/registry/src/github.com-1ecc6299db9ec823/cubeb-sys-0.6.2/libcubeb/src/cubeb_resampler_internal.h, line 257.
warning: unused variable: `frames_written`
   --> src/backend/mod.rs:659:17
    |
659 |             let frames_written = stm.frames_written.load(Ordering::SeqCst);
    |                 ^^^^^^^^^^^^^^ help: consider prefixing with an underscore: `_frames_written`
    |
    = note: `#[warn(unused_variables)]` on by default

    Finished test [unoptimized + debuginfo] target(s) in 0.03s
     Running target/debug/deps/cubeb_coreaudio-0fc83ebf572ae290

running 1 test
Device change callback. data @ 0x7fc48b000400
Assertion failed: (out_len == output_frame_count), function output, file /Users/cchang/.cargo/registry/src/github.com-1ecc6299db9ec823/cubeb-sys-0.6.2/libcubeb/src/cubeb_resampler_internal.h, line 257.
error: test failed, to rerun pass '--lib'

frames_queued and total_output_latency_frames may not update in a synchronized fashion

frames_queued is in the TripleBuffer, but total_output_latency_frames is not (it's a separate atomic), so position() might be using two values from different invocations to the audio output callback. This is probably not a big problem in practice, because total_output_latency_frames probably does not vary very much if the audio callback is called at consistent times. But it's probably still worth fixing, by moving total_output_latency_frames into the TripleBuffer.

Investigate the data race in `test_reinit_duplex_stream_by_unplugging_a_nondefault_input_device`

A data race is hunt by running test_reinit_duplex_stream_by_unplugging_a_nondefault_input_device with ThreadSanitizer on github-action server. See: https://github.com/ChunMinChang/cubeb-coreaudio-rs/runs/2071091523?check_suite_focus=true#step:8:1559

running 1 test
Before plugging, default Input device is 52
Create plugger device: 187 for Input
After plugging, default Input device is 187
Stream runs on the device 187 for Input
Device change callback. data @ 0x7b0800006150
Device 187 for Input is unplugged. The default Input device now is 52
==================
WARNING: ThreadSanitizer: data race (pid=8133)
  Write of size 8 at 0x7b5800010688 by thread T6 (mutexes: write M1113):
    #0 cubeb_coreaudio::backend::CoreStreamData::close::h9015010392ee632b mod.rs:2892 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1000b248c)
    #1 cubeb_coreaudio::backend::AudioUnitStream::reinit::he9f08a062e914a99 mod.rs:3282 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1000baf09)
    #2 cubeb_coreaudio::backend::AudioUnitStream::reinit_async::_$u7b$$u7b$closure$u7d$$u7d$::h7a61df819a311341 mod.rs:3380 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001a0d3b)
    #3 coreaudio_sys_utils::dispatch::Queue::run_async::_$u7b$$u7b$closure$u7d$$u7d$::h52e5360c09d9745c dispatch.rs:34 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100124855)
    #4 coreaudio_sys_utils::dispatch::Queue::create_closure_and_executor::closure_executer::hf49625ff2858a8a0 dispatch.rs:120 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001238e7)
    #5 __tsan::dispatch_callback_wrap(void*) <null>:2 (librustc-nightly_rt.tsan.dylib:x86_64+0x54041)
    #6 _dispatch_client_callout <null>:2 (libdispatch.dylib:x86_64+0x2657)

  Previous read of size 8 at 0x7b5800010688 by thread T7:
    [failed to restore the stack]

  As if synchronized via sleep:
    #0 usleep <null>:2 (librustc-nightly_rt.tsan.dylib:x86_64+0xaf0e)
    #1 <null> <null>:2 (CoreAudio:x86_64+0xb97b)
    #2 cubeb_coreaudio::backend::stop_audiounit::h5fe93aab38d43816 mod.rs:955 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1000806f3)
    #3 cubeb_coreaudio::backend::CoreStreamData::stop_audiounits::heb4499a4ac00cf36 mod.rs:2419 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10009e015)
    #4 cubeb_coreaudio::backend::AudioUnitStream::reinit::he9f08a062e914a99 mod.rs:3262 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1000bac6e)
    #5 cubeb_coreaudio::backend::AudioUnitStream::reinit_async::_$u7b$$u7b$closure$u7d$$u7d$::h7a61df819a311341 mod.rs:3380 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001a0d3b)
    #6 coreaudio_sys_utils::dispatch::Queue::run_async::_$u7b$$u7b$closure$u7d$$u7d$::h52e5360c09d9745c dispatch.rs:34 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100124855)
    #7 coreaudio_sys_utils::dispatch::Queue::create_closure_and_executor::closure_executer::hf49625ff2858a8a0 dispatch.rs:120 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001238e7)
    #8 __tsan::dispatch_callback_wrap(void*) <null>:2 (librustc-nightly_rt.tsan.dylib:x86_64+0x54041)
    #9 _dispatch_client_callout <null>:2 (libdispatch.dylib:x86_64+0x2657)

  Location is heap block of size 704 at 0x7b5800010500 allocated by thread T1:
    #0 malloc <null>:2 (librustc-nightly_rt.tsan.dylib:x86_64+0x3138a)
    #1 alloc::alloc::alloc::h8464aec3c2ee1768 alloc.rs:86 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10000d2dd)
    #2 alloc::alloc::Global::alloc_impl::h48bf059a4d76d23b alloc.rs:166 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10000d41d)
    #3 _$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::allocate::h206a99dbb0cc906c alloc.rs:226 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10000dd6b)
    #4 alloc::alloc::exchange_malloc::h919d416a52bfc4d5 alloc.rs:316 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10000d1f4)
    #5 _$LT$cubeb_coreaudio..backend..AudioUnitContext$u20$as$u20$cubeb_backend..traits..ContextOps$GT$::stream_init::hba287f3d2084a7d3 mod.rs:2207 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10009b3d1)
    #6 cubeb_backend::capi::capi_stream_init::he43df76d4b4080e0 capi.rs:155 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001b0450)
    #7 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::_$u7b$$u7b$closure$u7d$$u7d$::h6d64f649ec48387d utils.rs:1075 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10013db49)
    #8 cubeb_coreaudio::backend::tests::utils::test_ops_context_operation::hf93f7992163b915c utils.rs:1038 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10013567c)
    #9 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::h7bbe750bd9d16c4b utils.rs:1059 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10013726e)
    #10 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation_with_default_callbacks::hb505f06d2b147cc8 utils.rs:1227 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100142292)
    #11 cubeb_coreaudio::backend::tests::utils::test_get_stream_with_default_callbacks_by_type::hfbdb2b7565c8f30b utils.rs:1175 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100141ecb)
    #12 cubeb_coreaudio::backend::tests::device_change::test_get_stream_with_device_changed_callback::hbc05360c724e6c3a device_change.rs:664 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1000308ee)
    #13 cubeb_coreaudio::backend::tests::device_change::test_unplug_a_device_on_an_active_stream::h0efb158f6a0a2e4f device_change.rs:577 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001878b1)
    #14 cubeb_coreaudio::backend::tests::device_change::test_reinit_duplex_stream_by_unplugging_a_nondefault_input_device::hafd275bc07775578 device_change.rs:485 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001880b9)
    #15 cubeb_coreaudio::backend::tests::device_change::test_reinit_duplex_stream_by_unplugging_a_nondefault_input_device::_$u7b$$u7b$closure$u7d$$u7d$::h04b19c1436993d29 device_change.rs:484 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100031201)
    #16 core::ops::function::FnOnce::call_once::h1f83c02ec5a569da function.rs:227 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100010769)
    #17 test::__rust_begin_short_backtrace::he972f8a06bb130a1 lib.rs:567 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001e6819)

test backend::tests::device_change::test_reinit_duplex_stream_by_unplugging_a_nondefault_input_device ... ok
  Mutex M1113 (0x7b1000004300) created at:

    #0 pthread_mutex_init <null>:2 (librustc-nightly_rt.tsan.dylib:x86_64+0xd483)
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 182 filtered out; finished in 5.16s
    #1 std::sys_common::mutex::MovableMutex::new::h3cb9036416153eab mutex.rs:65 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100252336)

    #2 cubeb_coreaudio::backend::AudioUnitStream::reinit_async::ha597bd51e5318977 mod.rs:3365 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1000bcb5a)
    #3 cubeb_coreaudio::backend::audiounit_property_listener_callback::h1cd677da2e38e815 mod.rs:809 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10007be91)
    #4 HALObject::PropertiesChanged(unsigned int, AudioObjectPropertyAddress const*) <null>:2 (CoreAudio:x86_64+0x184a75)
    #5 _dispatch_client_callout <null>:2 (libdispatch.dylib:x86_64+0x2657)

  Thread T6 (tid=55539, running) is a GCD worker thread

  Thread T7 (tid=55542, running) created by thread T1 at:
    #0 pthread_create <null>:2 (librustc-nightly_rt.tsan.dylib:x86_64+0xc26d)
    #1 HALB_IOThread::StartAndWaitForState(unsigned int) <null>:2 (CoreAudio:x86_64+0x248a30)
    #2 cubeb_coreaudio::backend::start_audiounit::hc50fd7adc8f7c483 mod.rs:945 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10007fbe3)
    #3 cubeb_coreaudio::backend::CoreStreamData::start_audiounits::h09fa821ee3db60ec mod.rs:2405 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10009dda7)
    #4 _$LT$cubeb_coreaudio..backend..AudioUnitStream$u20$as$u20$cubeb_backend..traits..StreamOps$GT$::start::_$u7b$$u7b$closure$u7d$$u7d$::hbd076fdc7bc158d3 mod.rs:3463 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001a1a50)
    #5 coreaudio_sys_utils::dispatch::Queue::run_sync::_$u7b$$u7b$closure$u7d$$u7d$::h1d6d7f2290d89430 dispatch.rs:50 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001242dc)
    #6 coreaudio_sys_utils::dispatch::Queue::create_closure_and_executor::closure_executer::hc11768e997e13e62 dispatch.rs:120 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100123844)
    #7 __tsan::dispatch_callback_wrap(void*) <null>:2 (librustc-nightly_rt.tsan.dylib:x86_64+0x54041)
    #8 _dispatch_client_callout <null>:2 (libdispatch.dylib:x86_64+0x2657)
    #9 coreaudio_sys_utils::dispatch::Queue::run_sync::h9f32df2fb84b6ab6 dispatch.rs:53 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100124048)
    #10 _$LT$cubeb_coreaudio..backend..AudioUnitStream$u20$as$u20$cubeb_backend..traits..StreamOps$GT$::start::h6838f09e5d7b8483 mod.rs:3462 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1000bed87)
    #11 cubeb_coreaudio::backend::tests::device_change::test_unplug_a_device_on_an_active_stream::_$u7b$$u7b$closure$u7d$$u7d$::h85eb42ff79b77b4e device_change.rs:587 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10002f972)
    #12 cubeb_coreaudio::backend::tests::device_change::test_get_stream_with_device_changed_callback::_$u7b$$u7b$closure$u7d$$u7d$::h2e58100bb37b04b0 device_change.rs:674 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100030bd3)
    #13 cubeb_coreaudio::backend::tests::utils::test_get_stream_with_default_callbacks_by_type::_$u7b$$u7b$closure$u7d$$u7d$::h5281cd56d202ccf0 utils.rs:1184 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100141f7f)
    #14 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::_$u7b$$u7b$closure$u7d$$u7d$::h6d64f649ec48387d utils.rs:1092 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10013dcc2)
    #15 cubeb_coreaudio::backend::tests::utils::test_ops_context_operation::hf93f7992163b915c utils.rs:1038 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10013567c)
    #16 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::h7bbe750bd9d16c4b utils.rs:1059 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10013726e)
    #17 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation_with_default_callbacks::hb505f06d2b147cc8 utils.rs:1227 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100142292)
    #18 cubeb_coreaudio::backend::tests::utils::test_get_stream_with_default_callbacks_by_type::hfbdb2b7565c8f30b utils.rs:1175 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100141ecb)
    #19 cubeb_coreaudio::backend::tests::device_change::test_get_stream_with_device_changed_callback::hbc05360c724e6c3a device_change.rs:664 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1000308ee)
    #20 cubeb_coreaudio::backend::tests::device_change::test_unplug_a_device_on_an_active_stream::h0efb158f6a0a2e4f device_change.rs:577 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001878b1)
    #21 cubeb_coreaudio::backend::tests::device_change::test_reinit_duplex_stream_by_unplugging_a_nondefault_input_device::hafd275bc07775578 device_change.rs:485 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001880b9)
    #22 cubeb_coreaudio::backend::tests::device_change::test_reinit_duplex_stream_by_unplugging_a_nondefault_input_device::_$u7b$$u7b$closure$u7d$$u7d$::h04b19c1436993d29 device_change.rs:484 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100031201)
    #23 core::ops::function::FnOnce::call_once::h1f83c02ec5a569da function.rs:227 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100010769)
    #24 test::__rust_begin_short_backtrace::he972f8a06bb130a1 lib.rs:567 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1001e6819)

  Thread T1 (tid=55534, running) created by main thread at:
    #0 pthread_create <null>:2 (librustc-nightly_rt.tsan.dylib:x86_64+0xc26d)
    #1 std::sys::unix::thread::Thread::new::h907eaa9202bc7657 thread.rs:50 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100259bb4)
    #2 core::ops::function::FnOnce::call_once::h69e50838ed00ba81 function.rs:227 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x1000117ce)
    #3 std::sys_common::backtrace::__rust_begin_short_backtrace::h5bfcfecaa07c5a45 backtrace.rs:125 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100056311)
    #4 std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hb64e69d70cb55916 rt.rs:66 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10011cfdd)
    #5 std::rt::lang_start_internal::h40998ab1eb2cac0a rt.rs:51 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x100254613)
    #6 main <null>:2 (cubeb_coreaudio-054ada4152802ca0:x86_64+0x10005f22d)

SUMMARY: ThreadSanitizer: data race mod.rs:2892 in cubeb_coreaudio::backend::CoreStreamData::close::h9015010392ee632b
==================
ThreadSanitizer: reported 1 warnings
error: test failed, to rerun pass '--lib'

Caused by:
  process didn't exit successfully: `/Users/runner/work/cubeb-coreaudio-rs/cubeb-coreaudio-rs/target/debug/deps/cubeb_coreaudio-054ada4152802ca0 test_reinit_duplex_stream_by_unplugging_a_nondefault_input_device --ignored --nocapture` (signal: 6, SIGABRT: process abort signal)

take care of `clippy::non_send_fields_in_send_ty`

We have two clippy::non_send_fields_in_send_ty warnings that should be take care of carefully.

unsafe impl Send for AudioUnitContext {}

warning: this implementation is unsound, as some fields in `AudioUnitContext` are `!Send`
    --> src/backend/mod.rs:2263:1
     |
2263 | unsafe impl Send for AudioUnitContext {}
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: `#[warn(clippy::non_send_fields_in_send_ty)]` on by default
note: the type of field `serial_queue` is `!Send`
    --> src/backend/mod.rs:1882:5
     |
1882 |     serial_queue: Queue,
     |     ^^^^^^^^^^^^^^^^^^^
     = help: use a thread-safe type that implements `Send`
note: the type of field `devices` is `!Send`
    --> src/backend/mod.rs:1884:5
     |
1884 |     devices: Mutex<SharedDevices>,
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     = help: use a thread-safe type that implements `Send`
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_send_fields_in_send_ty

unsafe impl<'ctx> Send for AudioUnitStream<'ctx> {}

warning: this implementation is unsound, as some fields in `AudioUnitStream<'ctx>` are `!Send`
    --> src/backend/mod.rs:3632:1
     |
3632 | unsafe impl<'ctx> Send for AudioUnitStream<'ctx> {}
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
note: the type of field `queue` is `!Send`
    --> src/backend/mod.rs:3135:5
     |
3135 |     queue: Queue,
     |     ^^^^^^^^^^^^
     = help: use a thread-safe type that implements `Send`
note: the type of field `core_stream_data` is `!Send`
    --> src/backend/mod.rs:3164:5
     |
3164 |     core_stream_data: CoreStreamData<'ctx>,
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     = help: use a thread-safe type that implements `Send`
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_send_fields_in_send_ty

See more here: https://rust-lang.github.io/rust-clippy/master/#non_send_fields_in_send_ty

I temporarily allow this for now since I cannot find serious bugs related to this. But it's better to take care of the threading issue more carefully.

Investigate why `activate_clock_drift_compensation` has less than 2 sub devices

In BMO 1677766, we've seen AggregateDevice::activate_clock_drift_compensation could have less than 2 subdevices:
https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/87667052a5ffaf47fbeac4ae67f1ecdefa8d7b09/src/backend/aggregate_device.rs#L485-L488
after AggregateDevice::set_sub_devices_sync is set successfully.
https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/87667052a5ffaf47fbeac4ae67f1ecdefa8d7b09/src/backend/aggregate_device.rs#L45-L47

One possible reason I could think now is that kAudioAggregateDevicePropertyFullSubDeviceList, which is used in AggregateDevice::set_sub_devices_sync,
https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/87667052a5ffaf47fbeac4ae67f1ecdefa8d7b09/src/backend/aggregate_device.rs#L273-L277
is not synchronous or symmetric to kAudioObjectPropertyOwnedObjects,
which is used in AggregateDevice::activate_clock_drift_compensation
https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/87667052a5ffaf47fbeac4ae67f1ecdefa8d7b09/src/backend/aggregate_device.rs#L462-L466

To get rid of the crashes caused by this assertion in Firefox, #118 change the code and return an error instead. However, it's better to investigate how to set the aggregate properly to avoid getting logical conflicts in our code. Ideally, once we confirm that we've set at least one input and at least one output device into the sub-device list, "number of sub-devices > 2" should be the invariant in the following calls.

Do not reinitialize audio stream if its device isn't changed

Step to reproduce

  1. Make sure the computer has at least two input/output devices, and device S is the system default input/output device
  2. Initialize an input/output stream with device X, where X is not the system default input device.
  3. Change the system default input/output device to another device

Expect

The audio stream keeps playing without being initialized.

Actual

The audio stream is re-initialized even though nothing change for its device

Assertion failed on `test_destroy_duplex_stream_after_unplugging_a_nondefault_input_device`

Here is the assertion failed:

cchang@cchang-37365 cubeb-coreaudio-rs % cargo test test_destroy_duplex_stream_after_unplugging_a_nondefault_input_device -- --ignored --nocapture 
    Finished test [unoptimized + debuginfo] target(s) in 0.03s
     Running target/debug/deps/cubeb_coreaudio-ebf01d779bba143b

running 1 test
Assertion failed: (destination && source), function PodCopy, file /Users/cchang/.cargo/registry/src/github.com-1ecc6299db9ec823/cubeb-sys-0.7.0/libcubeb/src/cubeb_utils.h, line 31.
error: test failed, to rerun pass '--lib'

Caused by:
  process didn't exit successfully: `/Users/cchang/Work/cubeb-coreaudio-rs/target/debug/deps/cubeb_coreaudio-ebf01d779bba143b test_destroy_duplex_stream_after_unplugging_a_nondefault_input_device --ignored --nocapture` (signal: 6, SIGABRT: process abort signal)

Here is the backtrace in lldb:

cchang@cchang-37365 cubeb-coreaudio-rs % lldb target/debug/deps/cubeb_coreaudio-ebf01d779bba143b 
(lldb) target create "target/debug/deps/cubeb_coreaudio-ebf01d779bba143b"
Current executable set to 'target/debug/deps/cubeb_coreaudio-ebf01d779bba143b' (x86_64).
(lldb) r test_destroy_duplex_stream_after_unplugging_a_nondefault_input_device --ignored --nocapture
Process 4354 launched: '/Users/cchang/Work/cubeb-coreaudio-rs/target/debug/deps/cubeb_coreaudio-ebf01d779bba143b' (x86_64)

running 1 test
2020-05-06 10:31:42.061895-0700 cubeb_coreaudio-ebf01d779bba143b[4354:69748] [plugin] AddInstanceForFactory: No factory registered for id  F8BB1C28-BAE8-11D6-9C31-00039315CD46
2020-05-06 10:31:42.101003-0700 cubeb_coreaudio-ebf01d779bba143b[4354:69748]  HALC_ShellDriverPlugIn::Open: Can't get a pointer to the Open routine
2020-05-06 10:31:42.101657-0700 cubeb_coreaudio-ebf01d779bba143b[4354:69748]  HALC_ShellDriverPlugIn::Open: Can't get a pointer to the Open routine
2020-05-06 10:31:42.108476-0700 cubeb_coreaudio-ebf01d779bba143b[4354:69748]  HALC_ShellDriverPlugIn::Open: Can't get a pointer to the Open routine
Assertion failed: (destination && source), function PodCopy, file /Users/cchang/.cargo/registry/src/github.com-1ecc6299db9ec823/cubeb-sys-0.7.0/libcubeb/src/cubeb_utils.h, line 31.
Process 4354 stopped
* thread #8, name = 'com.apple.audio.IOThread.client', stop reason = signal SIGABRT
    frame #0: 0x00007fff6d7ce33a libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff6d7ce33a <+10>: jae    0x7fff6d7ce344            ; <+20>
    0x7fff6d7ce33c <+12>: movq   %rax, %rdi
    0x7fff6d7ce33f <+15>: jmp    0x7fff6d7c8629            ; cerror_nocancel
    0x7fff6d7ce344 <+20>: retq   
Target 0: (cubeb_coreaudio-ebf01d779bba143b) stopped.
(lldb) bt
* thread #8, name = 'com.apple.audio.IOThread.client', stop reason = signal SIGABRT
  * frame #0: 0x00007fff6d7ce33a libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff6d88ae60 libsystem_pthread.dylib`pthread_kill + 430
    frame #2: 0x00007fff6d755808 libsystem_c.dylib`abort + 120
    frame #3: 0x00007fff6d754ac6 libsystem_c.dylib`__assert_rtn + 314
    frame #4: 0x00000001001b1722 cubeb_coreaudio-ebf01d779bba143b`void PodCopy(destination=0x0000000000000000, source=0x0000000102037c00, count=0) at cubeb_utils.h:31:3
    frame #5: 0x00000001001af60a cubeb_coreaudio-ebf01d779bba143b`auto_array::push(this=0x000000010101f030, elements=0x0000000102037c00, length=0) at cubeb_utils.h:198:5
    frame #6: 0x00000001001b6e4e cubeb_coreaudio-ebf01d779bba143b`cubeb_resampler_speex_one_way::input(this=0x000000010101f010, input_buffer=0x0000000102037c00, input_frame_count=0) at cubeb_resampler_internal.h:216:26
    frame #7: 0x00000001001b63ea cubeb_coreaudio-ebf01d779bba143b`cubeb_resampler_speex, cubeb_resampler_speex_one_way >::fill_internal_duplex(this=0x000000010101a520, in_buffer=0x0000000102037c00, input_frames_count=0x0000700007eb4800, out_buffer=0x00000001012cf010, output_frames_needed=512) at cubeb_resampler.cpp:288:22
    frame #8: 0x00000001001b6922 cubeb_coreaudio-ebf01d779bba143b`cubeb_resampler_speex, cubeb_resampler_speex_one_way >::fill(this=0x000000010101a520, input_buffer=0x0000000102037c00, input_frames_count=0x0000700007eb4800, output_buffer=0x00000001012cf010, output_frames_needed=512) at cubeb_resampler.cpp:174:10
    frame #9: 0x00000001001b12d0 cubeb_coreaudio-ebf01d779bba143b`::cubeb_resampler_fill(resampler=0x000000010101a520, input_buffer=0x0000000102037c00, input_frames_count=0x0000700007eb4800, output_buffer=0x00000001012cf010, output_frames_needed=512) at cubeb_resampler.cpp:374:21
    frame #10: 0x00000001000bbffe cubeb_coreaudio-ebf01d779bba143b`cubeb_coreaudio::backend::resampler::Resampler::fill::h225081ff4af4ef3a(self=0x000000010131cf58, input_buffer=0x0000000102037c00, input_frame_count=0x0000700007eb4800, output_buffer=0x00000001012cf010, output_frames_needed=512) at resampler.rs:52:13
    frame #11: 0x00000001000c1729 cubeb_coreaudio-ebf01d779bba143b`cubeb_coreaudio::backend::audiounit_output_callback::_$u7b$$u7b$closure$u7d$$u7d$::h6f3331137d437f07((null)=0x0000700007eb6940, stm=0x000000010131ce50, output_frames=512, buffers=&mut [coreaudio_sys::AudioBuffer] @ 0x0000700007eb5528) at mod.rs:657:25
    frame #12: 0x00000001000d9060 cubeb_coreaudio-ebf01d779bba143b`cubeb_coreaudio::backend::audiounit_output_callback::hdd2ba8278e53a428(user_ptr=0x000000010131ce50, (null)=0x0000700007eb6d00, tstamp=0x0000700007eb6c88, bus=0, output_frames=512, out_buffer_list=0x0000000101020820) at mod.rs:718:34
    frame #13: 0x0000000101509d98 CoreAudio`___lldb_unnamed_symbol90$$CoreAudio + 966
    frame #14: 0x000000010152bc23 CoreAudio`___lldb_unnamed_symbol675$$CoreAudio + 1473
    frame #15: 0x000000010150cdf5 CoreAudio`___lldb_unnamed_symbol175$$CoreAudio + 2001
    frame #16: 0x00007fff32d25aaa CoreAudio`___ZN19HALC_ProxyIOContextC2Ejj_block_invoke + 5639
    frame #17: 0x00007fff32e58c22 CoreAudio`HALB_IOThread::Entry(void*) + 72
    frame #18: 0x00007fff6d88b109 libsystem_pthread.dylib`_pthread_start + 148
    frame #19: 0x00007fff6d886b8b libsystem_pthread.dylib`thread_start + 15
(lldb) 

`audiounit_get_{current,preferred}_channel_layout` behaves differently on recent MacBook Pro

On a mid-2018 MacBook Pro (MacBookPro15,1 running 10.14) using the default speakers, test_get_current_channel_layout_output and test_get_preferred_channel_layout_output fail with:

thread 'backend::tests::api::test_get_current_channel_layout_output' panicked at 'assertion failed: `(left == right)`
  left: `[Silence, Silence]`,
 right: `[FrontLeft, FrontRight]`', src/backend/tests/api.rs:782:9

For whatever reason, the AudioChannelLayout queried via AudioUnitGetProperty(kAudioUnitProperty_AudioChannelLayout) appears to be valid/correctly initialized (52 bytes) but is mostly filled with zero values:

AudioChannelLayout.mChannelLayoutTag == kAudioChannelLayoutTag_UseChannelDescriptions (0),
AudioChannelLayout.mChannelBitmap == 0,
AudioChannelLayout.mNumberChannelDescriptions == 2,
{
  AudioChannelDescription.mChannelLabel == 0,
  AudioChannelDescription.mChannelFlags == 0,
  AudioChannelDescription.mCoordinates == [0.0, 0.0, 0.0],
},
{
  AudioChannelDescription.mChannelLabel == 0,
  AudioChannelDescription.mChannelFlags == 0,
  AudioChannelDescription.mCoordinates == [0.0, 0.0, 0.0],
}

...which results in audiounit_convert_channel_layout returning a Vec of [mixer::Channel::Silence, mixer::Channel::Silence], causing the tests expecting [mixer::Channel::FrontLeft, mixer::Channel::FrontRight] to fail.

It's not clear to me the correct way to handle this situation. Whether it's correct or not, I noticed that other code querying kAudioUnitProperty_AudioChannelLayout often treats AudioChannelLayout.mNumberChannelDescriptions <= 2 as special and forces mono/stereo examining the AudioChannelDescriptions only for the > 2 case.

FWIW, kAudioUnitProperty_SupportedChannelLayoutTags in the same context returns kAudioUnitErr_InvalidProperty.

Chun-Min mentioned that @padenot has seen the same issue on a 2019 MBP.

Initialize a duplex stream properly when using aggregate device

A problem is found when investigating BMO 1631814.

The properties of a duplex stream are initialized with different devices when we use an internal aggregate device. The AudioUnit with out_dev_info but current_latency_frames and output_source_listener will be set via output_device. The output_device and out_dev_info are different values when we use an internal aggregate device for the duplex stream.

Memory leaks found by LeakSanitizer

There are lots of memory leaks found by LeakSanitizer

The result of running RUSTFLAGS="-Z sanitizer=leak" cargo test is SUMMARY: LeakSanitizer: 16950 byte(s) leaked in 400 allocation(s).:

==10821==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 6820 byte(s) in 155 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #6 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #7 0x7fff3b5f4cfe in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338cfe)
    #8 0x7fff3b319b99 in HALC_ShellDevice::RebuildControlList(bool) (CoreAudio:x86_64+0x5db99)
    #9 0x7fff3b3163de in HALC_ShellDevice::Activate() (CoreAudio:x86_64+0x5a3de)
    #10 0x7fff3b3856f9 in HALC_ShellObjectMap::CreateObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0xc96f9)
    #11 0x7fff3b3a668b in HALC_ShellPlugIn::_ReconcileDeviceList(bool, bool, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&) (CoreAudio:x86_64+0xea68b)
    #12 0x7fff3b618f5b in HALB_CommandGate::ExecuteCommand(void () block_pointer) const (CoreAudio:x86_64+0x35cf5b)
    #13 0x7fff3b3a61b7 in HALC_ShellPlugIn::ReconcileDeviceList(bool, bool) (CoreAudio:x86_64+0xea1b7)
    #14 0x7fff3b3a7107 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb107)
    #15 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #16 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #17 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #18 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #19 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #20 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #21 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #22 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #23 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #24 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #25 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #26 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #27 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #28 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #29 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305

Direct leak of 308 byte(s) in 7 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #6 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #7 0x7fff3b5f4cfe in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338cfe)
    #8 0x7fff3b3e159f in HALC_ShellSimpleProxyList::Reconcile(bool, bool) (CoreAudio:x86_64+0x12559f)
    #9 0x7fff3b3a70d9 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb0d9)
    #10 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #11 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #12 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #13 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #14 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #15 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #16 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #17 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #18 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #19 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #20 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #21 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #22 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #23 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #24 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #25 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #26 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #27 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #28 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #29 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)

Direct leak of 308 byte(s) in 7 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #6 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #7 0x7fff3b5f4cfe in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338cfe)
    #8 0x7fff3b31945e in HALC_ShellDevice::RebuildStreamLists(bool) (CoreAudio:x86_64+0x5d45e)
    #9 0x7fff3b3163d1 in HALC_ShellDevice::Activate() (CoreAudio:x86_64+0x5a3d1)
    #10 0x7fff3b3856f9 in HALC_ShellObjectMap::CreateObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0xc96f9)
    #11 0x7fff3b3a668b in HALC_ShellPlugIn::_ReconcileDeviceList(bool, bool, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&) (CoreAudio:x86_64+0xea68b)
    #12 0x7fff3b618f5b in HALB_CommandGate::ExecuteCommand(void () block_pointer) const (CoreAudio:x86_64+0x35cf5b)
    #13 0x7fff3b3a61b7 in HALC_ShellPlugIn::ReconcileDeviceList(bool, bool) (CoreAudio:x86_64+0xea1b7)
    #14 0x7fff3b3a7107 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb107)
    #15 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #16 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #17 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #18 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #19 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #20 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #21 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #22 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #23 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #24 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #25 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #26 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #27 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #28 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #29 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305

Direct leak of 220 byte(s) in 5 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3b6b5a9b in HALB_DispatchQueue::InstallMIGServer(unsigned int, unsigned int, unsigned int (*)(mach_msg_header_t*, mach_msg_header_t*)) (CoreAudio:x86_64+0x3f9a9b)
    #6 0x7fff3b5f4c27 in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338c27)
    #7 0x7fff3b31c03f in HALC_ShellDevice::BuildIOContext(unsigned int) (CoreAudio:x86_64+0x6003f)
    #8 0x7fff3b3856f9 in HALC_ShellObjectMap::CreateObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0xc96f9)
    #9 0x7fff3b3a668b in HALC_ShellPlugIn::_ReconcileDeviceList(bool, bool, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&) (CoreAudio:x86_64+0xea68b)
    #10 0x7fff3b618f5b in HALB_CommandGate::ExecuteCommand(void () block_pointer) const (CoreAudio:x86_64+0x35cf5b)
    #11 0x7fff3b3a61b7 in HALC_ShellPlugIn::ReconcileDeviceList(bool, bool) (CoreAudio:x86_64+0xea1b7)
    #12 0x7fff3b3a7107 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb107)
    #13 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #14 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #15 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #16 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #17 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #18 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #19 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #20 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #21 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #22 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #23 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #24 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #25 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #26 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #27 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #28 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #29 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474

Direct leak of 220 byte(s) in 5 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #6 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #7 0x7fff3b5f48c9 in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x3388c9)
    #8 0x7fff3b31c03f in HALC_ShellDevice::BuildIOContext(unsigned int) (CoreAudio:x86_64+0x6003f)
    #9 0x7fff3b3856f9 in HALC_ShellObjectMap::CreateObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0xc96f9)
    #10 0x7fff3b3a668b in HALC_ShellPlugIn::_ReconcileDeviceList(bool, bool, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&) (CoreAudio:x86_64+0xea68b)
    #11 0x7fff3b618f5b in HALB_CommandGate::ExecuteCommand(void () block_pointer) const (CoreAudio:x86_64+0x35cf5b)
    #12 0x7fff3b3a61b7 in HALC_ShellPlugIn::ReconcileDeviceList(bool, bool) (CoreAudio:x86_64+0xea1b7)
    #13 0x7fff3b3a7107 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb107)
    #14 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #15 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #16 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #17 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #18 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #19 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #20 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #21 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #22 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #23 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #24 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #25 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #26 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #27 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #28 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #29 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86

Direct leak of 220 byte(s) in 5 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #6 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #7 0x7fff3b5f4cfe in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338cfe)
    #8 0x7fff3b3a6638 in HALC_ShellPlugIn::_ReconcileDeviceList(bool, bool, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&) (CoreAudio:x86_64+0xea638)
    #9 0x7fff3b618f5b in HALB_CommandGate::ExecuteCommand(void () block_pointer) const (CoreAudio:x86_64+0x35cf5b)
    #10 0x7fff3b3a61b7 in HALC_ShellPlugIn::ReconcileDeviceList(bool, bool) (CoreAudio:x86_64+0xea1b7)
    #11 0x7fff3b3a7107 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb107)
    #12 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #13 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #14 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #15 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #16 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #17 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #18 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #19 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #20 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #21 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #22 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #23 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #24 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #25 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #26 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #27 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #28 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #29 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015

Direct leak of 128 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45f5a in wrap_calloc (librustc_rt.lsan.dylib:x86_64+0x7f5a)
    #1 0x7fff720ade5e in class_createInstance (libobjc.A.dylib:x86_64h+0x5e5e)
    #2 0x7fff733ceeaf in _os_object_alloc_realized (libdispatch.dylib:x86_64+0x2eaf)
    #3 0x7fff733dffd6 in dispatch_source_create (libdispatch.dylib:x86_64+0x13fd6)
    #4 0x7fff733ea8d0 in _dispatch_kq_poll (libdispatch.dylib:x86_64+0x1e8d0)
    #5 0x7fff733ea461 in _dispatch_kq_drain (libdispatch.dylib:x86_64+0x1e461)
    #6 0x7fff733e99ee in _dispatch_kq_unote_update (libdispatch.dylib:x86_64+0x1d9ee)
    #7 0x7fff733e0b86 in _dispatch_source_install (libdispatch.dylib:x86_64+0x14b86)
    #8 0x7fff733e0adc in _dispatch_source_activate (libdispatch.dylib:x86_64+0x14adc)
    #9 0x7fff733d4313 in _dispatch_lane_resume_activate (libdispatch.dylib:x86_64+0x8313)
    #10 0x7fff6f61047d in caulk::alloc::details::dispatch_memory_monitor::dispatch_memory_monitor(std::__1::function<void ()> const&) (caulk:x86_64+0x247d)
    #11 0x7fff6f6102c9 in caulk::alloc::details::dispatch_resource<caulk::alloc::caching_page_allocator<16384ul> >::dispatch_resource() (caulk:x86_64+0x22c9)
    #12 0x7fff6f610237 in caulk::alloc::global_allocator<caulk::alloc::caching_page_allocator<16384ul> >::impl() (caulk:x86_64+0x2237)
    #13 0x7fff6f60ffd2 in caulk::alloc::details::dispatch_resource<caulk::alloc::dsw_allocator<true> >::dispatch_resource() (caulk:x86_64+0x1fd2)
    #14 0x7fff6f60ff87 in caulk::alloc::global_allocator<caulk::alloc::dsw_allocator<true> >::impl() (caulk:x86_64+0x1f87)
    #15 0x7fff6f60ff05 in caulk::alloc::get_realtime_safe_resource() (caulk:x86_64+0x1f05)
    #16 0x7fff3b2c7105 in caulk::concurrent::async_message_queue::async_message_queue(caulk::concurrent::messenger::thread_strategy, caulk::thread::attributes const&) (CoreAudio:x86_64+0xb105)
    #17 0x7fff3b2c668e in AMCP::Log::Scope::Scope(char const*, char const*) (CoreAudio:x86_64+0xa68e)
    #18 0x7fff3b2c6388 in AMCP::Log::Scope_Registry::create(std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) (CoreAudio:x86_64+0xa388)
    #19 0x7fff3b2c6113 in AMCP::Log::Scope_Registry::fetch(char const*, char const*) (CoreAudio:x86_64+0xa113)
    #20 0x7fff3b47f679 in void std::__1::__call_once_proxy<std::__1::tuple<AMCP::run_new_hal()::$_0&&> >(void*) (CoreAudio:x86_64+0x1c3679)
    #21 0x7fff7053e81b in std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) (libc++.1.dylib:x86_64+0x181b)
    #22 0x7fff3b47f50e in AMCP::run_new_hal() (CoreAudio:x86_64+0x1c350e)
    #23 0x7fff3b2c3318 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7318)
    #24 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #25 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #26 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #27 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #28 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #29 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015

Direct leak of 55 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45e6a in wrap_realloc (librustc_rt.lsan.dylib:x86_64+0x7e6a)
    #1 0x10b9a5992 in std::ffi::c_str::CString::from_vec_unchecked::hc073cda091e4ba8e raw_vec.rs:659
    #2 0x10b988864 in coreaudio_sys_utils::string::StringRef::to_cstring::h6195dd75e9801430 string.rs:54
    #3 0x10b988894 in coreaudio_sys_utils::string::StringRef::into_cstring::h8517f11d470dcb33 string.rs:59
    #4 0x10b926ece in cubeb_coreaudio::backend::create_cubeb_device_info::he5c80dd5ccd118a4 mod.rs:1471
    #5 0x10b8d1734 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_infos_by_device::h4a511338138d223d api.rs:1388
    #6 0x10b8d0e5e in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_from_hwdev_in_scope::ha44f89f0f4adb3f4 api.rs:1355
    #7 0x10b8d0d49 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::h47b43ca6ea5620ec api.rs:1349
    #8 0x10b8eee80 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::_$u7b$$u7b$closure$u7d$$u7d$::h201b62b28ed56a6b api.rs:1345
    #9 0x10b86df50 in core::ops::function::FnOnce::call_once::h858ab7776d44cdc2 function.rs:232
    #10 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #11 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #12 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #13 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #14 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #15 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #16 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #17 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #18 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #19 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #20 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff6fc85de8 in CASmartPreferences::CASmartPreferences() (libAudioToolboxUtility.dylib:x86_64+0x2de8)
    #6 0x7fff6fc85d0b in CASmartPreferences::instance() (libAudioToolboxUtility.dylib:x86_64+0x2d0b)
    #7 0x7fff5030742d in assertXPCServiceReachable(NSString*) (AudioToolboxCore:x86_64+0x1942d)
    #8 0x7fff50307212 in AudioComponentMgr_RegistrarService::initPhase2() (AudioToolboxCore:x86_64+0x19212)
    #9 0x7fff50306c95 in AudioComponentMgr_NSExtension::initPhase2() (AudioToolboxCore:x86_64+0x18c95)
    #10 0x7fff50306abd in GlobalComponentPluginMgr() (AudioToolboxCore:x86_64+0x18abd)
    #11 0x7fff503069dd in AudioComponentFindNext (AudioToolboxCore:x86_64+0x189dd)
    #12 0x10b92301f in cubeb_coreaudio::backend::create_audiounit_by_description::h3e4af7b27780a734 mod.rs:1155
    #13 0x10b922f37 in cubeb_coreaudio::backend::create_default_audiounit::h71dec69af7fc8e1f mod.rs:1128
    #14 0x10b8cc464 in cubeb_coreaudio::backend::tests::api::test_create_default_audiounit::h8aaa060f00d09422 api.rs:857
    #15 0x10b8eeb20 in cubeb_coreaudio::backend::tests::api::test_create_default_audiounit::_$u7b$$u7b$closure$u7d$$u7d$::head8ffc071c77119 api.rs:845
    #16 0x10b86e400 in core::ops::function::FnOnce::call_once::h9250e57df7b85fe5 function.rs:232
    #17 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #18 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #19 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #20 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #21 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #22 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #23 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #24 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #25 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #26 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #27 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff6f610474 in caulk::alloc::details::dispatch_memory_monitor::dispatch_memory_monitor(std::__1::function<void ()> const&) (caulk:x86_64+0x2474)
    #6 0x7fff6f6102c9 in caulk::alloc::details::dispatch_resource<caulk::alloc::caching_page_allocator<16384ul> >::dispatch_resource() (caulk:x86_64+0x22c9)
    #7 0x7fff6f610237 in caulk::alloc::global_allocator<caulk::alloc::caching_page_allocator<16384ul> >::impl() (caulk:x86_64+0x2237)
    #8 0x7fff6f60ffd2 in caulk::alloc::details::dispatch_resource<caulk::alloc::dsw_allocator<true> >::dispatch_resource() (caulk:x86_64+0x1fd2)
    #9 0x7fff6f60ff87 in caulk::alloc::global_allocator<caulk::alloc::dsw_allocator<true> >::impl() (caulk:x86_64+0x1f87)
    #10 0x7fff6f60ff05 in caulk::alloc::get_realtime_safe_resource() (caulk:x86_64+0x1f05)
    #11 0x7fff3b2c7105 in caulk::concurrent::async_message_queue::async_message_queue(caulk::concurrent::messenger::thread_strategy, caulk::thread::attributes const&) (CoreAudio:x86_64+0xb105)
    #12 0x7fff3b2c668e in AMCP::Log::Scope::Scope(char const*, char const*) (CoreAudio:x86_64+0xa68e)
    #13 0x7fff3b2c6388 in AMCP::Log::Scope_Registry::create(std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) (CoreAudio:x86_64+0xa388)
    #14 0x7fff3b2c6113 in AMCP::Log::Scope_Registry::fetch(char const*, char const*) (CoreAudio:x86_64+0xa113)
    #15 0x7fff3b47f679 in void std::__1::__call_once_proxy<std::__1::tuple<AMCP::run_new_hal()::$_0&&> >(void*) (CoreAudio:x86_64+0x1c3679)
    #16 0x7fff7053e81b in std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) (libc++.1.dylib:x86_64+0x181b)
    #17 0x7fff3b47f50e in AMCP::run_new_hal() (CoreAudio:x86_64+0x1c350e)
    #18 0x7fff3b2c3318 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7318)
    #19 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #20 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #21 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #22 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #23 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #24 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #25 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #26 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #27 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #28 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #29 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #6 0x7fff3b5e523d in HALC_ProxySystem::HALC_ProxySystem() (CoreAudio:x86_64+0x32923d)
    #7 0x7fff3b5f50af in HALC_ProxyObjectMap::_CreateSystemObject() (CoreAudio:x86_64+0x3390af)
    #8 0x7fff3b5f448a in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x33848a)
    #9 0x7fff3b2be812 in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x2812)
    #10 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #11 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #12 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #13 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #14 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #15 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #16 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #17 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #18 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #19 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #20 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #21 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #22 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #23 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #24 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #25 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #26 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #27 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #6 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #7 0x7fff3b5f4cfe in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338cfe)
    #8 0x7fff3b3e159f in HALC_ShellSimpleProxyList::Reconcile(bool, bool) (CoreAudio:x86_64+0x12559f)
    #9 0x7fff3b3a70ff in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb0ff)
    #10 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #11 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #12 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #13 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #14 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #15 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #16 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #17 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #18 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #19 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #20 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #21 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #22 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #23 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #24 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #25 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #26 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #27 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #28 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #29 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3d1c1894 in connectToCoreServicesD() (CarbonCore:x86_64+0x1894)
    #6 0x7fff3d1c176c in getStatus() (CarbonCore:x86_64+0x176c)
    #7 0x7fff3d1c4611 in scCreateSystemServiceVersion (CarbonCore:x86_64+0x4611)
    #8 0x7fff3d1c43a2 in FileIDTreeGetCachedPort (CarbonCore:x86_64+0x43a2)
    #9 0x7fff3d1c4224 in FSNodeStorageGetAndLockCurrentUniverse (CarbonCore:x86_64+0x4224)
    #10 0x7fff3d1c405b in FileIDTreeGetAndLockVolumeEntryForDeviceID (CarbonCore:x86_64+0x405b)
    #11 0x7fff3d1c3f34 in FSMount::FSMount(unsigned int, FSMountNumberType, int*, unsigned int const*) (CarbonCore:x86_64+0x3f34)
    #12 0x7fff3d1c3ea6 in FSMountPrepare (CarbonCore:x86_64+0x3ea6)
    #13 0x7fff5488f2e2 in MountInfoPrepare (CoreServicesInternal:x86_64+0x62e2)
    #14 0x7fff5488ebb8 in parseAttributeBuffer(__CFAllocator const*, unsigned char const*, unsigned char, attrlist const*, void const*, void**, _FileAttributes*, unsigned int*) (CoreServicesInternal:x86_64+0x5bb8)
    #15 0x7fff5488dbc7 in corePropertyProviderPrepareValues(__CFURL const*, __FileCache*, __CFString const* const*, void const**, long, void const*, __CFError**) (CoreServicesInternal:x86_64+0x4bc7)
    #16 0x7fff5488d7e3 in prepareValuesForBitmap(__CFURL const*, __FileCache*, _FilePropertyBitmap*, __CFError**) (CoreServicesInternal:x86_64+0x47e3)
    #17 0x7fff54889eb9 in _FSURLCopyResourcePropertyForKeyInternal(__CFURL const*, __CFString const*, void*, void*, __CFError**, unsigned char) (CoreServicesInternal:x86_64+0xeb9)
    #18 0x7fff3bda0957 in CFURLCopyResourcePropertyForKey (CoreFoundation:x86_64h+0x57957)
    #19 0x7fff3be54486 in _CFBundleForksCouldBeResourceFile (CoreFoundation:x86_64h+0x10b486)
    #20 0x7fff3be5420f in _CFBundleCopyInfoDictionaryInResourceForkWithAllocator (CoreFoundation:x86_64h+0x10b20f)
    #21 0x7fff3d1c1242 in GetBugsForOurBundleIDFromCoreservicesd (CarbonCore:x86_64+0x1242)
    #22 0x7fff3d1c10c1 in _CSCheckFix (CarbonCore:x86_64+0x10c1)
    #23 0x7fff6fcb14a8 in CAAppWorkArounds::CSCheckFix(__CFString const*) (libAudioToolboxUtility.dylib:x86_64+0x2e4a8)
    #24 0x7fff6fcb1370 in Prime() (libAudioToolboxUtility.dylib:x86_64+0x2e370)
    #25 0x7fff736294a5 in __pthread_once_handler (libsystem_pthread.dylib:x86_64+0x24a5)
    #26 0x7fff7361ed06 in _os_once_callout (libsystem_platform.dylib:x86_64+0x1d06)
    #27 0x7fff73629441 in pthread_once (libsystem_pthread.dylib:x86_64+0x2441)
    #28 0x7fff503be6b2 in _AudioConverterNewInternal (AudioToolboxCore:x86_64+0xd06b2)
    #29 0x1107042b8  (CoreAudio:x86_64+0x42b8)

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff6f610474 in caulk::alloc::details::dispatch_memory_monitor::dispatch_memory_monitor(std::__1::function<void ()> const&) (caulk:x86_64+0x2474)
    #6 0x7fff6f6100c0 in caulk::alloc::details::dispatch_resource<caulk::alloc::dsw_allocator<true> >::dispatch_resource() (caulk:x86_64+0x20c0)
    #7 0x7fff6f60ff87 in caulk::alloc::global_allocator<caulk::alloc::dsw_allocator<true> >::impl() (caulk:x86_64+0x1f87)
    #8 0x7fff6f60ff05 in caulk::alloc::get_realtime_safe_resource() (caulk:x86_64+0x1f05)
    #9 0x7fff3b2c7105 in caulk::concurrent::async_message_queue::async_message_queue(caulk::concurrent::messenger::thread_strategy, caulk::thread::attributes const&) (CoreAudio:x86_64+0xb105)
    #10 0x7fff3b2c668e in AMCP::Log::Scope::Scope(char const*, char const*) (CoreAudio:x86_64+0xa68e)
    #11 0x7fff3b2c6388 in AMCP::Log::Scope_Registry::create(std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) (CoreAudio:x86_64+0xa388)
    #12 0x7fff3b2c6113 in AMCP::Log::Scope_Registry::fetch(char const*, char const*) (CoreAudio:x86_64+0xa113)
    #13 0x7fff3b47f679 in void std::__1::__call_once_proxy<std::__1::tuple<AMCP::run_new_hal()::$_0&&> >(void*) (CoreAudio:x86_64+0x1c3679)
    #14 0x7fff7053e81b in std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) (libc++.1.dylib:x86_64+0x181b)
    #15 0x7fff3b47f50e in AMCP::run_new_hal() (CoreAudio:x86_64+0x1c350e)
    #16 0x7fff3b2c3318 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7318)
    #17 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #18 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #19 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #20 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #21 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #22 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #23 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #24 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #25 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #26 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #27 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #28 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #29 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3eb50e6c in IONotificationPortSetDispatchQueue (IOKit:x86_64+0x3e6c)
    #6 0x7fff3b2beda2 in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x2da2)
    #7 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #8 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #9 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #10 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #11 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #12 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #13 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #14 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #15 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #16 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #17 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #18 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #19 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #20 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #21 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #22 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #23 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #24 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3b6b5a9b in HALB_DispatchQueue::InstallMIGServer(unsigned int, unsigned int, unsigned int (*)(mach_msg_header_t*, mach_msg_header_t*)) (CoreAudio:x86_64+0x3f9a9b)
    #6 0x7fff3b5e526a in HALC_ProxySystem::HALC_ProxySystem() (CoreAudio:x86_64+0x32926a)
    #7 0x7fff3b5f50af in HALC_ProxyObjectMap::_CreateSystemObject() (CoreAudio:x86_64+0x3390af)
    #8 0x7fff3b5f448a in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x33848a)
    #9 0x7fff3b2be812 in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x2812)
    #10 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #11 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #12 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #13 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #14 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #15 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #16 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #17 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #18 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #19 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #20 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #21 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #22 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #23 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #24 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #25 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #26 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #27 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45676 in wrap_dispatch_source_set_cancel_handler (librustc_rt.lsan.dylib:x86_64+0x7676)
    #5 0x7fff3d1c1867 in connectToCoreServicesD() (CarbonCore:x86_64+0x1867)
    #6 0x7fff3d1c176c in getStatus() (CarbonCore:x86_64+0x176c)
    #7 0x7fff3d1c4611 in scCreateSystemServiceVersion (CarbonCore:x86_64+0x4611)
    #8 0x7fff3d1c43a2 in FileIDTreeGetCachedPort (CarbonCore:x86_64+0x43a2)
    #9 0x7fff3d1c4224 in FSNodeStorageGetAndLockCurrentUniverse (CarbonCore:x86_64+0x4224)
    #10 0x7fff3d1c405b in FileIDTreeGetAndLockVolumeEntryForDeviceID (CarbonCore:x86_64+0x405b)
    #11 0x7fff3d1c3f34 in FSMount::FSMount(unsigned int, FSMountNumberType, int*, unsigned int const*) (CarbonCore:x86_64+0x3f34)
    #12 0x7fff3d1c3ea6 in FSMountPrepare (CarbonCore:x86_64+0x3ea6)
    #13 0x7fff5488f2e2 in MountInfoPrepare (CoreServicesInternal:x86_64+0x62e2)
    #14 0x7fff5488ebb8 in parseAttributeBuffer(__CFAllocator const*, unsigned char const*, unsigned char, attrlist const*, void const*, void**, _FileAttributes*, unsigned int*) (CoreServicesInternal:x86_64+0x5bb8)
    #15 0x7fff5488dbc7 in corePropertyProviderPrepareValues(__CFURL const*, __FileCache*, __CFString const* const*, void const**, long, void const*, __CFError**) (CoreServicesInternal:x86_64+0x4bc7)
    #16 0x7fff5488d7e3 in prepareValuesForBitmap(__CFURL const*, __FileCache*, _FilePropertyBitmap*, __CFError**) (CoreServicesInternal:x86_64+0x47e3)
    #17 0x7fff54889eb9 in _FSURLCopyResourcePropertyForKeyInternal(__CFURL const*, __CFString const*, void*, void*, __CFError**, unsigned char) (CoreServicesInternal:x86_64+0xeb9)
    #18 0x7fff3bda0957 in CFURLCopyResourcePropertyForKey (CoreFoundation:x86_64h+0x57957)
    #19 0x7fff3be54486 in _CFBundleForksCouldBeResourceFile (CoreFoundation:x86_64h+0x10b486)
    #20 0x7fff3be5420f in _CFBundleCopyInfoDictionaryInResourceForkWithAllocator (CoreFoundation:x86_64h+0x10b20f)
    #21 0x7fff3d1c1242 in GetBugsForOurBundleIDFromCoreservicesd (CarbonCore:x86_64+0x1242)
    #22 0x7fff3d1c10c1 in _CSCheckFix (CarbonCore:x86_64+0x10c1)
    #23 0x7fff6fcb14a8 in CAAppWorkArounds::CSCheckFix(__CFString const*) (libAudioToolboxUtility.dylib:x86_64+0x2e4a8)
    #24 0x7fff6fcb1370 in Prime() (libAudioToolboxUtility.dylib:x86_64+0x2e370)
    #25 0x7fff736294a5 in __pthread_once_handler (libsystem_pthread.dylib:x86_64+0x24a5)
    #26 0x7fff7361ed06 in _os_once_callout (libsystem_platform.dylib:x86_64+0x1d06)
    #27 0x7fff73629441 in pthread_once (libsystem_pthread.dylib:x86_64+0x2441)
    #28 0x7fff503be6b2 in _AudioConverterNewInternal (AudioToolboxCore:x86_64+0xd06b2)
    #29 0x1107042b8  (CoreAudio:x86_64+0x42b8)

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733d2742 in dispatch_async (libdispatch.dylib:x86_64+0x6742)
    #4 0x10bc45401 in wrap_dispatch_async (librustc_rt.lsan.dylib:x86_64+0x7401)
    #5 0x7fff3b3d2a38 in invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) (CoreAudio:x86_64+0x116a38)
    #6 0x7fff3b50961b in HALB_IOThread::Entry(void*) (CoreAudio:x86_64+0x24d61b)
    #7 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #8 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #3 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #4 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #5 0x7fff3eb50e6c in IONotificationPortSetDispatchQueue (IOKit:x86_64+0x3e6c)
    #6 0x7fff3b2be060 in HALSystem::InitializeShell() (CoreAudio:x86_64+0x2060)
    #7 0x7fff3b2bd85c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x185c)
    #8 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #9 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #10 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #11 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #12 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #13 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #14 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #15 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #16 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #17 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #18 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #19 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #20 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #21 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #22 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #23 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #24 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 33 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45e6a in wrap_realloc (librustc_rt.lsan.dylib:x86_64+0x7e6a)
    #1 0x10b9a5992 in std::ffi::c_str::CString::from_vec_unchecked::hc073cda091e4ba8e raw_vec.rs:659
    #2 0x10b988864 in coreaudio_sys_utils::string::StringRef::to_cstring::h6195dd75e9801430 string.rs:54
    #3 0x10b988894 in coreaudio_sys_utils::string::StringRef::into_cstring::h8517f11d470dcb33 string.rs:59
    #4 0x10b926ece in cubeb_coreaudio::backend::create_cubeb_device_info::he5c80dd5ccd118a4 mod.rs:1471
    #5 0x10b8d1734 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_infos_by_device::h4a511338138d223d api.rs:1388
    #6 0x10b8d0e5e in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_from_hwdev_in_scope::ha44f89f0f4adb3f4 api.rs:1355
    #7 0x10b8d0d38 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::h47b43ca6ea5620ec api.rs:1348
    #8 0x10b8eee80 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::_$u7b$$u7b$closure$u7d$$u7d$::h201b62b28ed56a6b api.rs:1345
    #9 0x10b86df50 in core::ops::function::FnOnce::call_once::h858ab7776d44cdc2 function.rs:232
    #10 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #11 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #12 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #13 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #14 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #15 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #16 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #17 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #18 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #19 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #20 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 20 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x10b9a5821 in _$LT$$RF$str$u20$as$u20$std..ffi..c_str..CString..new..SpecIntoVec$GT$::into_vec::hfaea03acdad6700c raw_vec.rs:88
    #2 0x10b98855e in std::ffi::c_str::CString::new::h18a8bea7eea4dcb5 c_str.rs:350
    #3 0x10b8d2fe5 in cubeb_coreaudio::backend::tests::api::test_device_destroy_with_different_device_id_and_group_id::h978c739d554a98fe api.rs:1520
    #4 0x10b8eef40 in cubeb_coreaudio::backend::tests::api::test_device_destroy_with_different_device_id_and_group_id::_$u7b$$u7b$closure$u7d$$u7d$::he643a991dd88c993 api.rs:1515
    #5 0x10b86f0b0 in core::ops::function::FnOnce::call_once::hdfe4d114b1697b29 function.rs:232
    #6 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #7 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #8 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #9 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #10 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #11 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #12 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #13 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #14 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #15 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #16 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 20 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45e6a in wrap_realloc (librustc_rt.lsan.dylib:x86_64+0x7e6a)
    #1 0x10b9a5992 in std::ffi::c_str::CString::from_vec_unchecked::hc073cda091e4ba8e raw_vec.rs:659
    #2 0x10b988864 in coreaudio_sys_utils::string::StringRef::to_cstring::h6195dd75e9801430 string.rs:54
    #3 0x10b988894 in coreaudio_sys_utils::string::StringRef::into_cstring::h8517f11d470dcb33 string.rs:59
    #4 0x10b9274a3 in cubeb_coreaudio::backend::create_cubeb_device_info::he5c80dd5ccd118a4 mod.rs:1486
    #5 0x10b8d1734 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_infos_by_device::h4a511338138d223d api.rs:1388
    #6 0x10b8d0e5e in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_from_hwdev_in_scope::ha44f89f0f4adb3f4 api.rs:1355
    #7 0x10b8d0d38 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::h47b43ca6ea5620ec api.rs:1348
    #8 0x10b8eee80 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::_$u7b$$u7b$closure$u7d$$u7d$::h201b62b28ed56a6b api.rs:1345
    #9 0x10b86df50 in core::ops::function::FnOnce::call_once::h858ab7776d44cdc2 function.rs:232
    #10 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #11 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #12 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #13 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #14 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #15 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #16 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #17 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #18 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #19 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #20 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 18 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x10b9a5821 in _$LT$$RF$str$u20$as$u20$std..ffi..c_str..CString..new..SpecIntoVec$GT$::into_vec::hfaea03acdad6700c raw_vec.rs:88
    #2 0x10b98855e in std::ffi::c_str::CString::new::h18a8bea7eea4dcb5 c_str.rs:350
    #3 0x10b8d3039 in cubeb_coreaudio::backend::tests::api::test_device_destroy_with_different_device_id_and_group_id::h978c739d554a98fe api.rs:1521
    #4 0x10b8eef40 in cubeb_coreaudio::backend::tests::api::test_device_destroy_with_different_device_id_and_group_id::_$u7b$$u7b$closure$u7d$$u7d$::he643a991dd88c993 api.rs:1515
    #5 0x10b86f0b0 in core::ops::function::FnOnce::call_once::hdfe4d114b1697b29 function.rs:232
    #6 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #7 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #8 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #9 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #10 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #11 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #12 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #13 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #14 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #15 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #16 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x10b9a5821 in _$LT$$RF$str$u20$as$u20$std..ffi..c_str..CString..new..SpecIntoVec$GT$::into_vec::hfaea03acdad6700c raw_vec.rs:88
    #2 0x10b98855e in std::ffi::c_str::CString::new::h18a8bea7eea4dcb5 c_str.rs:350
    #3 0x10b8d2f4e in cubeb_coreaudio::backend::tests::api::test_device_destroy_with_different_device_id_and_group_id::h978c739d554a98fe api.rs:1518
    #4 0x10b8eef40 in cubeb_coreaudio::backend::tests::api::test_device_destroy_with_different_device_id_and_group_id::_$u7b$$u7b$closure$u7d$$u7d$::he643a991dd88c993 api.rs:1515
    #5 0x10b86f0b0 in core::ops::function::FnOnce::call_once::hdfe4d114b1697b29 function.rs:232
    #6 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #7 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #8 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #9 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #10 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #11 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #12 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #13 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #14 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #15 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #16 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 15 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x10b9a5821 in _$LT$$RF$str$u20$as$u20$std..ffi..c_str..CString..new..SpecIntoVec$GT$::into_vec::hfaea03acdad6700c raw_vec.rs:88
    #2 0x10b98855e in std::ffi::c_str::CString::new::h18a8bea7eea4dcb5 c_str.rs:350
    #3 0x10b8d2f8b in cubeb_coreaudio::backend::tests::api::test_device_destroy_with_different_device_id_and_group_id::h978c739d554a98fe api.rs:1519
    #4 0x10b8eef40 in cubeb_coreaudio::backend::tests::api::test_device_destroy_with_different_device_id_and_group_id::_$u7b$$u7b$closure$u7d$$u7d$::he643a991dd88c993 api.rs:1515
    #5 0x10b86f0b0 in core::ops::function::FnOnce::call_once::hdfe4d114b1697b29 function.rs:232
    #6 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #7 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #8 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #9 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #10 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #11 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #12 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #13 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #14 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #15 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #16 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 11 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45e6a in wrap_realloc (librustc_rt.lsan.dylib:x86_64+0x7e6a)
    #1 0x10b9a5992 in std::ffi::c_str::CString::from_vec_unchecked::hc073cda091e4ba8e raw_vec.rs:659
    #2 0x10b988864 in coreaudio_sys_utils::string::StringRef::to_cstring::h6195dd75e9801430 string.rs:54
    #3 0x10b988894 in coreaudio_sys_utils::string::StringRef::into_cstring::h8517f11d470dcb33 string.rs:59
    #4 0x10b927ac2 in cubeb_coreaudio::backend::create_cubeb_device_info::he5c80dd5ccd118a4 mod.rs:1501
    #5 0x10b8d1734 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_infos_by_device::h4a511338138d223d api.rs:1388
    #6 0x10b8d0e5e in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_from_hwdev_in_scope::ha44f89f0f4adb3f4 api.rs:1355
    #7 0x10b8d0d38 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::h47b43ca6ea5620ec api.rs:1348
    #8 0x10b8eee80 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::_$u7b$$u7b$closure$u7d$$u7d$::h201b62b28ed56a6b api.rs:1345
    #9 0x10b86df50 in core::ops::function::FnOnce::call_once::h858ab7776d44cdc2 function.rs:232
    #10 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #11 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #12 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #13 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #14 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #15 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #16 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #17 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #18 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #19 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #20 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 11 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45e6a in wrap_realloc (librustc_rt.lsan.dylib:x86_64+0x7e6a)
    #1 0x10b9a5992 in std::ffi::c_str::CString::from_vec_unchecked::hc073cda091e4ba8e raw_vec.rs:659
    #2 0x10b988864 in coreaudio_sys_utils::string::StringRef::to_cstring::h6195dd75e9801430 string.rs:54
    #3 0x10b988894 in coreaudio_sys_utils::string::StringRef::into_cstring::h8517f11d470dcb33 string.rs:59
    #4 0x10b927ac2 in cubeb_coreaudio::backend::create_cubeb_device_info::he5c80dd5ccd118a4 mod.rs:1501
    #5 0x10b8d1734 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_infos_by_device::h4a511338138d223d api.rs:1388
    #6 0x10b8d0e5e in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_from_hwdev_in_scope::ha44f89f0f4adb3f4 api.rs:1355
    #7 0x10b8d0d49 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::h47b43ca6ea5620ec api.rs:1349
    #8 0x10b8eee80 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::_$u7b$$u7b$closure$u7d$$u7d$::h201b62b28ed56a6b api.rs:1345
    #9 0x10b86df50 in core::ops::function::FnOnce::call_once::h858ab7776d44cdc2 function.rs:232
    #10 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #11 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #12 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #13 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #14 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #15 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #16 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #17 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #18 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #19 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #20 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Direct leak of 7 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45e6a in wrap_realloc (librustc_rt.lsan.dylib:x86_64+0x7e6a)
    #1 0x10b9a5992 in std::ffi::c_str::CString::from_vec_unchecked::hc073cda091e4ba8e raw_vec.rs:659
    #2 0x10b988864 in coreaudio_sys_utils::string::StringRef::to_cstring::h6195dd75e9801430 string.rs:54
    #3 0x10b988894 in coreaudio_sys_utils::string::StringRef::into_cstring::h8517f11d470dcb33 string.rs:59
    #4 0x10b9274a3 in cubeb_coreaudio::backend::create_cubeb_device_info::he5c80dd5ccd118a4 mod.rs:1486
    #5 0x10b8d1734 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_infos_by_device::h4a511338138d223d api.rs:1388
    #6 0x10b8d0e5e in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::test_create_device_from_hwdev_in_scope::ha44f89f0f4adb3f4 api.rs:1355
    #7 0x10b8d0d49 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::h47b43ca6ea5620ec api.rs:1349
    #8 0x10b8eee80 in cubeb_coreaudio::backend::tests::api::test_create_cubeb_device_info::_$u7b$$u7b$closure$u7d$$u7d$::h201b62b28ed56a6b api.rs:1345
    #9 0x10b86df50 in core::ops::function::FnOnce::call_once::h858ab7776d44cdc2 function.rs:232
    #10 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #11 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #12 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #13 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #14 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #15 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #16 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #17 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #18 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #19 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #20 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Indirect leak of 6200 byte(s) in 155 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #8 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #9 0x7fff3b5f4cfe in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338cfe)
    #10 0x7fff3b319b99 in HALC_ShellDevice::RebuildControlList(bool) (CoreAudio:x86_64+0x5db99)
    #11 0x7fff3b3163de in HALC_ShellDevice::Activate() (CoreAudio:x86_64+0x5a3de)
    #12 0x7fff3b3856f9 in HALC_ShellObjectMap::CreateObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0xc96f9)
    #13 0x7fff3b3a668b in HALC_ShellPlugIn::_ReconcileDeviceList(bool, bool, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&) (CoreAudio:x86_64+0xea68b)
    #14 0x7fff3b618f5b in HALB_CommandGate::ExecuteCommand(void () block_pointer) const (CoreAudio:x86_64+0x35cf5b)
    #15 0x7fff3b3a61b7 in HALC_ShellPlugIn::ReconcileDeviceList(bool, bool) (CoreAudio:x86_64+0xea1b7)
    #16 0x7fff3b3a7107 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb107)
    #17 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #18 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #19 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #20 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #21 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #22 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #23 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #24 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #25 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #26 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #27 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #28 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #29 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539

Indirect leak of 280 byte(s) in 7 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #8 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #9 0x7fff3b5f4cfe in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338cfe)
    #10 0x7fff3b3e159f in HALC_ShellSimpleProxyList::Reconcile(bool, bool) (CoreAudio:x86_64+0x12559f)
    #11 0x7fff3b3a70d9 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb0d9)
    #12 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #13 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #14 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #15 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #16 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #17 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #18 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #19 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #20 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #21 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #22 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #23 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #24 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #25 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #26 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #27 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #28 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #29 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015

Indirect leak of 280 byte(s) in 7 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #8 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #9 0x7fff3b5f4cfe in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338cfe)
    #10 0x7fff3b31945e in HALC_ShellDevice::RebuildStreamLists(bool) (CoreAudio:x86_64+0x5d45e)
    #11 0x7fff3b3163d1 in HALC_ShellDevice::Activate() (CoreAudio:x86_64+0x5a3d1)
    #12 0x7fff3b3856f9 in HALC_ShellObjectMap::CreateObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0xc96f9)
    #13 0x7fff3b3a668b in HALC_ShellPlugIn::_ReconcileDeviceList(bool, bool, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&) (CoreAudio:x86_64+0xea68b)
    #14 0x7fff3b618f5b in HALB_CommandGate::ExecuteCommand(void () block_pointer) const (CoreAudio:x86_64+0x35cf5b)
    #15 0x7fff3b3a61b7 in HALC_ShellPlugIn::ReconcileDeviceList(bool, bool) (CoreAudio:x86_64+0xea1b7)
    #16 0x7fff3b3a7107 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb107)
    #17 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #18 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #19 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #20 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #21 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #22 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #23 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #24 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #25 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #26 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #27 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #28 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #29 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539

Indirect leak of 200 byte(s) in 5 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #8 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #9 0x7fff3b5f48c9 in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x3388c9)
    #10 0x7fff3b31c03f in HALC_ShellDevice::BuildIOContext(unsigned int) (CoreAudio:x86_64+0x6003f)
    #11 0x7fff3b3856f9 in HALC_ShellObjectMap::CreateObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0xc96f9)
    #12 0x7fff3b3a668b in HALC_ShellPlugIn::_ReconcileDeviceList(bool, bool, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&) (CoreAudio:x86_64+0xea68b)
    #13 0x7fff3b618f5b in HALB_CommandGate::ExecuteCommand(void () block_pointer) const (CoreAudio:x86_64+0x35cf5b)
    #14 0x7fff3b3a61b7 in HALC_ShellPlugIn::ReconcileDeviceList(bool, bool) (CoreAudio:x86_64+0xea1b7)
    #15 0x7fff3b3a7107 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb107)
    #16 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #17 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #18 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #19 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #20 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #21 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #22 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #23 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #24 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #25 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #26 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #27 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #28 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #29 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129

Indirect leak of 200 byte(s) in 5 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #8 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #9 0x7fff3b5f4cfe in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338cfe)
    #10 0x7fff3b3a6638 in HALC_ShellPlugIn::_ReconcileDeviceList(bool, bool, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&) (CoreAudio:x86_64+0xea638)
    #11 0x7fff3b618f5b in HALB_CommandGate::ExecuteCommand(void () block_pointer) const (CoreAudio:x86_64+0x35cf5b)
    #12 0x7fff3b3a61b7 in HALC_ShellPlugIn::ReconcileDeviceList(bool, bool) (CoreAudio:x86_64+0xea1b7)
    #13 0x7fff3b3a7107 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb107)
    #14 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #15 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #16 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #17 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #18 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #19 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #20 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #21 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #22 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #23 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #24 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #25 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #26 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #27 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #28 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #29 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86

Indirect leak of 156 byte(s) in 3 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3b6b5a9b in HALB_DispatchQueue::InstallMIGServer(unsigned int, unsigned int, unsigned int (*)(mach_msg_header_t*, mach_msg_header_t*)) (CoreAudio:x86_64+0x3f9a9b)
    #8 0x7fff3b5f4c27 in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338c27)
    #9 0x7fff3b31c03f in HALC_ShellDevice::BuildIOContext(unsigned int) (CoreAudio:x86_64+0x6003f)
    #10 0x7fff3b3856f9 in HALC_ShellObjectMap::CreateObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0xc96f9)
    #11 0x7fff3b3a668b in HALC_ShellPlugIn::_ReconcileDeviceList(bool, bool, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >&) (CoreAudio:x86_64+0xea68b)
    #12 0x7fff3b618f5b in HALB_CommandGate::ExecuteCommand(void () block_pointer) const (CoreAudio:x86_64+0x35cf5b)
    #13 0x7fff3b3a61b7 in HALC_ShellPlugIn::ReconcileDeviceList(bool, bool) (CoreAudio:x86_64+0xea1b7)
    #14 0x7fff3b3a7107 in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb107)
    #15 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #16 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #17 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #18 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #19 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #20 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #21 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #22 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #23 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #24 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #25 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #26 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #27 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #28 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #29 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305

Indirect leak of 128 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45f5a in wrap_calloc (librustc_rt.lsan.dylib:x86_64+0x7f5a)
    #1 0x7fff720ade5e in class_createInstance (libobjc.A.dylib:x86_64h+0x5e5e)
    #2 0x7fff733ceeaf in _os_object_alloc_realized (libdispatch.dylib:x86_64+0x2eaf)
    #3 0x7fff733dffd6 in dispatch_source_create (libdispatch.dylib:x86_64+0x13fd6)
    #4 0x7fff3d1c1824 in connectToCoreServicesD() (CarbonCore:x86_64+0x1824)
    #5 0x7fff3d1c176c in getStatus() (CarbonCore:x86_64+0x176c)
    #6 0x7fff3d1c4611 in scCreateSystemServiceVersion (CarbonCore:x86_64+0x4611)
    #7 0x7fff3d1c43a2 in FileIDTreeGetCachedPort (CarbonCore:x86_64+0x43a2)
    #8 0x7fff3d1c4224 in FSNodeStorageGetAndLockCurrentUniverse (CarbonCore:x86_64+0x4224)
    #9 0x7fff3d1c405b in FileIDTreeGetAndLockVolumeEntryForDeviceID (CarbonCore:x86_64+0x405b)
    #10 0x7fff3d1c3f34 in FSMount::FSMount(unsigned int, FSMountNumberType, int*, unsigned int const*) (CarbonCore:x86_64+0x3f34)
    #11 0x7fff3d1c3ea6 in FSMountPrepare (CarbonCore:x86_64+0x3ea6)
    #12 0x7fff5488f2e2 in MountInfoPrepare (CoreServicesInternal:x86_64+0x62e2)
    #13 0x7fff5488ebb8 in parseAttributeBuffer(__CFAllocator const*, unsigned char const*, unsigned char, attrlist const*, void const*, void**, _FileAttributes*, unsigned int*) (CoreServicesInternal:x86_64+0x5bb8)
    #14 0x7fff5488dbc7 in corePropertyProviderPrepareValues(__CFURL const*, __FileCache*, __CFString const* const*, void const**, long, void const*, __CFError**) (CoreServicesInternal:x86_64+0x4bc7)
    #15 0x7fff5488d7e3 in prepareValuesForBitmap(__CFURL const*, __FileCache*, _FilePropertyBitmap*, __CFError**) (CoreServicesInternal:x86_64+0x47e3)
    #16 0x7fff54889eb9 in _FSURLCopyResourcePropertyForKeyInternal(__CFURL const*, __CFString const*, void*, void*, __CFError**, unsigned char) (CoreServicesInternal:x86_64+0xeb9)
    #17 0x7fff3bda0957 in CFURLCopyResourcePropertyForKey (CoreFoundation:x86_64h+0x57957)
    #18 0x7fff3be54486 in _CFBundleForksCouldBeResourceFile (CoreFoundation:x86_64h+0x10b486)
    #19 0x7fff3be5420f in _CFBundleCopyInfoDictionaryInResourceForkWithAllocator (CoreFoundation:x86_64h+0x10b20f)
    #20 0x7fff3d1c1242 in GetBugsForOurBundleIDFromCoreservicesd (CarbonCore:x86_64+0x1242)
    #21 0x7fff3d1c10c1 in _CSCheckFix (CarbonCore:x86_64+0x10c1)
    #22 0x7fff6fcb14a8 in CAAppWorkArounds::CSCheckFix(__CFString const*) (libAudioToolboxUtility.dylib:x86_64+0x2e4a8)
    #23 0x7fff6fcb1370 in Prime() (libAudioToolboxUtility.dylib:x86_64+0x2e370)
    #24 0x7fff736294a5 in __pthread_once_handler (libsystem_pthread.dylib:x86_64+0x24a5)
    #25 0x7fff7361ed06 in _os_once_callout (libsystem_platform.dylib:x86_64+0x1d06)
    #26 0x7fff73629441 in pthread_once (libsystem_pthread.dylib:x86_64+0x2441)
    #27 0x7fff503be6b2 in _AudioConverterNewInternal (AudioToolboxCore:x86_64+0xd06b2)
    #28 0x1107042b8  (CoreAudio:x86_64+0x42b8)
    #29 0x1107041fd  (CoreAudio:x86_64+0x41fd)

Indirect leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff6f610474 in caulk::alloc::details::dispatch_memory_monitor::dispatch_memory_monitor(std::__1::function<void ()> const&) (caulk:x86_64+0x2474)
    #8 0x7fff6f6102c9 in caulk::alloc::details::dispatch_resource<caulk::alloc::caching_page_allocator<16384ul> >::dispatch_resource() (caulk:x86_64+0x22c9)
    #9 0x7fff6f610237 in caulk::alloc::global_allocator<caulk::alloc::caching_page_allocator<16384ul> >::impl() (caulk:x86_64+0x2237)
    #10 0x7fff6f60ffd2 in caulk::alloc::details::dispatch_resource<caulk::alloc::dsw_allocator<true> >::dispatch_resource() (caulk:x86_64+0x1fd2)
    #11 0x7fff6f60ff87 in caulk::alloc::global_allocator<caulk::alloc::dsw_allocator<true> >::impl() (caulk:x86_64+0x1f87)
    #12 0x7fff6f60ff05 in caulk::alloc::get_realtime_safe_resource() (caulk:x86_64+0x1f05)
    #13 0x7fff3b2c7105 in caulk::concurrent::async_message_queue::async_message_queue(caulk::concurrent::messenger::thread_strategy, caulk::thread::attributes const&) (CoreAudio:x86_64+0xb105)
    #14 0x7fff3b2c668e in AMCP::Log::Scope::Scope(char const*, char const*) (CoreAudio:x86_64+0xa68e)
    #15 0x7fff3b2c6388 in AMCP::Log::Scope_Registry::create(std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) (CoreAudio:x86_64+0xa388)
    #16 0x7fff3b2c6113 in AMCP::Log::Scope_Registry::fetch(char const*, char const*) (CoreAudio:x86_64+0xa113)
    #17 0x7fff3b47f679 in void std::__1::__call_once_proxy<std::__1::tuple<AMCP::run_new_hal()::$_0&&> >(void*) (CoreAudio:x86_64+0x1c3679)
    #18 0x7fff7053e81b in std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) (libc++.1.dylib:x86_64+0x181b)
    #19 0x7fff3b47f50e in AMCP::run_new_hal() (CoreAudio:x86_64+0x1c350e)
    #20 0x7fff3b2c3318 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7318)
    #21 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #22 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #23 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #24 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #25 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #26 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #27 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #28 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #29 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129

Indirect leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff6f610474 in caulk::alloc::details::dispatch_memory_monitor::dispatch_memory_monitor(std::__1::function<void ()> const&) (caulk:x86_64+0x2474)
    #8 0x7fff6f6100c0 in caulk::alloc::details::dispatch_resource<caulk::alloc::dsw_allocator<true> >::dispatch_resource() (caulk:x86_64+0x20c0)
    #9 0x7fff6f60ff87 in caulk::alloc::global_allocator<caulk::alloc::dsw_allocator<true> >::impl() (caulk:x86_64+0x1f87)
    #10 0x7fff6f60ff05 in caulk::alloc::get_realtime_safe_resource() (caulk:x86_64+0x1f05)
    #11 0x7fff3b2c7105 in caulk::concurrent::async_message_queue::async_message_queue(caulk::concurrent::messenger::thread_strategy, caulk::thread::attributes const&) (CoreAudio:x86_64+0xb105)
    #12 0x7fff3b2c668e in AMCP::Log::Scope::Scope(char const*, char const*) (CoreAudio:x86_64+0xa68e)
    #13 0x7fff3b2c6388 in AMCP::Log::Scope_Registry::create(std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) (CoreAudio:x86_64+0xa388)
    #14 0x7fff3b2c6113 in AMCP::Log::Scope_Registry::fetch(char const*, char const*) (CoreAudio:x86_64+0xa113)
    #15 0x7fff3b47f679 in void std::__1::__call_once_proxy<std::__1::tuple<AMCP::run_new_hal()::$_0&&> >(void*) (CoreAudio:x86_64+0x1c3679)
    #16 0x7fff7053e81b in std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) (libc++.1.dylib:x86_64+0x181b)
    #17 0x7fff3b47f50e in AMCP::run_new_hal() (CoreAudio:x86_64+0x1c350e)
    #18 0x7fff3b2c3318 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7318)
    #19 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #20 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #21 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #22 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #23 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #24 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #25 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #26 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #27 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #28 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #29 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86

Indirect leak of 80 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45f5a in wrap_calloc (librustc_rt.lsan.dylib:x86_64+0x7f5a)
    #1 0x7fff733ce4dc in _dispatch_calloc (libdispatch.dylib:x86_64+0x24dc)
    #2 0x7fff733e7fba in _dispatch_unote_create (libdispatch.dylib:x86_64+0x1bfba)
    #3 0x7fff733dffb9 in dispatch_source_create (libdispatch.dylib:x86_64+0x13fb9)
    #4 0x7fff733ea8d0 in _dispatch_kq_poll (libdispatch.dylib:x86_64+0x1e8d0)
    #5 0x7fff733ea461 in _dispatch_kq_drain (libdispatch.dylib:x86_64+0x1e461)
    #6 0x7fff733e99ee in _dispatch_kq_unote_update (libdispatch.dylib:x86_64+0x1d9ee)
    #7 0x7fff733e0b86 in _dispatch_source_install (libdispatch.dylib:x86_64+0x14b86)
    #8 0x7fff733e0adc in _dispatch_source_activate (libdispatch.dylib:x86_64+0x14adc)
    #9 0x7fff733d4313 in _dispatch_lane_resume_activate (libdispatch.dylib:x86_64+0x8313)
    #10 0x7fff6f61047d in caulk::alloc::details::dispatch_memory_monitor::dispatch_memory_monitor(std::__1::function<void ()> const&) (caulk:x86_64+0x247d)
    #11 0x7fff6f6102c9 in caulk::alloc::details::dispatch_resource<caulk::alloc::caching_page_allocator<16384ul> >::dispatch_resource() (caulk:x86_64+0x22c9)
    #12 0x7fff6f610237 in caulk::alloc::global_allocator<caulk::alloc::caching_page_allocator<16384ul> >::impl() (caulk:x86_64+0x2237)
    #13 0x7fff6f60ffd2 in caulk::alloc::details::dispatch_resource<caulk::alloc::dsw_allocator<true> >::dispatch_resource() (caulk:x86_64+0x1fd2)
    #14 0x7fff6f60ff87 in caulk::alloc::global_allocator<caulk::alloc::dsw_allocator<true> >::impl() (caulk:x86_64+0x1f87)
    #15 0x7fff6f60ff05 in caulk::alloc::get_realtime_safe_resource() (caulk:x86_64+0x1f05)
    #16 0x7fff3b2c7105 in caulk::concurrent::async_message_queue::async_message_queue(caulk::concurrent::messenger::thread_strategy, caulk::thread::attributes const&) (CoreAudio:x86_64+0xb105)
    #17 0x7fff3b2c668e in AMCP::Log::Scope::Scope(char const*, char const*) (CoreAudio:x86_64+0xa68e)
    #18 0x7fff3b2c6388 in AMCP::Log::Scope_Registry::create(std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) (CoreAudio:x86_64+0xa388)
    #19 0x7fff3b2c6113 in AMCP::Log::Scope_Registry::fetch(char const*, char const*) (CoreAudio:x86_64+0xa113)
    #20 0x7fff3b47f679 in void std::__1::__call_once_proxy<std::__1::tuple<AMCP::run_new_hal()::$_0&&> >(void*) (CoreAudio:x86_64+0x1c3679)
    #21 0x7fff7053e81b in std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) (libc++.1.dylib:x86_64+0x181b)
    #22 0x7fff3b47f50e in AMCP::run_new_hal() (CoreAudio:x86_64+0x1c350e)
    #23 0x7fff3b2c3318 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7318)
    #24 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #25 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #26 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #27 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #28 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #29 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015

Indirect leak of 52 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3b6b5a9b in HALB_DispatchQueue::InstallMIGServer(unsigned int, unsigned int, unsigned int (*)(mach_msg_header_t*, mach_msg_header_t*)) (CoreAudio:x86_64+0x3f9a9b)
    #8 0x7fff3b5e526a in HALC_ProxySystem::HALC_ProxySystem() (CoreAudio:x86_64+0x32926a)
    #9 0x7fff3b5f50af in HALC_ProxyObjectMap::_CreateSystemObject() (CoreAudio:x86_64+0x3390af)
    #10 0x7fff3b5f448a in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x33848a)
    #11 0x7fff3b2be812 in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x2812)
    #12 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #13 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #14 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #15 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #16 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #17 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #18 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #19 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #20 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #21 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #22 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #23 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #24 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #25 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #26 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #27 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #28 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #29 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Indirect leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45676 in wrap_dispatch_source_set_cancel_handler (librustc_rt.lsan.dylib:x86_64+0x7676)
    #7 0x7fff3d1c1867 in connectToCoreServicesD() (CarbonCore:x86_64+0x1867)
    #8 0x7fff3d1c176c in getStatus() (CarbonCore:x86_64+0x176c)
    #9 0x7fff3d1c4611 in scCreateSystemServiceVersion (CarbonCore:x86_64+0x4611)
    #10 0x7fff3d1c43a2 in FileIDTreeGetCachedPort (CarbonCore:x86_64+0x43a2)
    #11 0x7fff3d1c4224 in FSNodeStorageGetAndLockCurrentUniverse (CarbonCore:x86_64+0x4224)
    #12 0x7fff3d1c405b in FileIDTreeGetAndLockVolumeEntryForDeviceID (CarbonCore:x86_64+0x405b)
    #13 0x7fff3d1c3f34 in FSMount::FSMount(unsigned int, FSMountNumberType, int*, unsigned int const*) (CarbonCore:x86_64+0x3f34)
    #14 0x7fff3d1c3ea6 in FSMountPrepare (CarbonCore:x86_64+0x3ea6)
    #15 0x7fff5488f2e2 in MountInfoPrepare (CoreServicesInternal:x86_64+0x62e2)
    #16 0x7fff5488ebb8 in parseAttributeBuffer(__CFAllocator const*, unsigned char const*, unsigned char, attrlist const*, void const*, void**, _FileAttributes*, unsigned int*) (CoreServicesInternal:x86_64+0x5bb8)
    #17 0x7fff5488dbc7 in corePropertyProviderPrepareValues(__CFURL const*, __FileCache*, __CFString const* const*, void const**, long, void const*, __CFError**) (CoreServicesInternal:x86_64+0x4bc7)
    #18 0x7fff5488d7e3 in prepareValuesForBitmap(__CFURL const*, __FileCache*, _FilePropertyBitmap*, __CFError**) (CoreServicesInternal:x86_64+0x47e3)
    #19 0x7fff54889eb9 in _FSURLCopyResourcePropertyForKeyInternal(__CFURL const*, __CFString const*, void*, void*, __CFError**, unsigned char) (CoreServicesInternal:x86_64+0xeb9)
    #20 0x7fff3bda0957 in CFURLCopyResourcePropertyForKey (CoreFoundation:x86_64h+0x57957)
    #21 0x7fff3be54486 in _CFBundleForksCouldBeResourceFile (CoreFoundation:x86_64h+0x10b486)
    #22 0x7fff3be5420f in _CFBundleCopyInfoDictionaryInResourceForkWithAllocator (CoreFoundation:x86_64h+0x10b20f)
    #23 0x7fff3d1c1242 in GetBugsForOurBundleIDFromCoreservicesd (CarbonCore:x86_64+0x1242)
    #24 0x7fff3d1c10c1 in _CSCheckFix (CarbonCore:x86_64+0x10c1)
    #25 0x7fff6fcb14a8 in CAAppWorkArounds::CSCheckFix(__CFString const*) (libAudioToolboxUtility.dylib:x86_64+0x2e4a8)
    #26 0x7fff6fcb1370 in Prime() (libAudioToolboxUtility.dylib:x86_64+0x2e370)
    #27 0x7fff736294a5 in __pthread_once_handler (libsystem_pthread.dylib:x86_64+0x24a5)
    #28 0x7fff7361ed06 in _os_once_callout (libsystem_platform.dylib:x86_64+0x1d06)
    #29 0x7fff73629441 in pthread_once (libsystem_pthread.dylib:x86_64+0x2441)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #8 0x7fff3b5e523d in HALC_ProxySystem::HALC_ProxySystem() (CoreAudio:x86_64+0x32923d)
    #9 0x7fff3b5f50af in HALC_ProxyObjectMap::_CreateSystemObject() (CoreAudio:x86_64+0x3390af)
    #10 0x7fff3b5f448a in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x33848a)
    #11 0x7fff3b2be812 in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x2812)
    #12 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #13 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #14 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #15 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #16 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #17 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #18 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #19 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #20 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #21 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #22 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #23 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #24 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #25 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #26 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #27 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #28 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #29 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff6fc85de8 in CASmartPreferences::CASmartPreferences() (libAudioToolboxUtility.dylib:x86_64+0x2de8)
    #8 0x7fff6fc85d0b in CASmartPreferences::instance() (libAudioToolboxUtility.dylib:x86_64+0x2d0b)
    #9 0x7fff5030742d in assertXPCServiceReachable(NSString*) (AudioToolboxCore:x86_64+0x1942d)
    #10 0x7fff50307212 in AudioComponentMgr_RegistrarService::initPhase2() (AudioToolboxCore:x86_64+0x19212)
    #11 0x7fff50306c95 in AudioComponentMgr_NSExtension::initPhase2() (AudioToolboxCore:x86_64+0x18c95)
    #12 0x7fff50306abd in GlobalComponentPluginMgr() (AudioToolboxCore:x86_64+0x18abd)
    #13 0x7fff503069dd in AudioComponentFindNext (AudioToolboxCore:x86_64+0x189dd)
    #14 0x10b92301f in cubeb_coreaudio::backend::create_audiounit_by_description::h3e4af7b27780a734 mod.rs:1155
    #15 0x10b922f37 in cubeb_coreaudio::backend::create_default_audiounit::h71dec69af7fc8e1f mod.rs:1128
    #16 0x10b8cc464 in cubeb_coreaudio::backend::tests::api::test_create_default_audiounit::h8aaa060f00d09422 api.rs:857
    #17 0x10b8eeb20 in cubeb_coreaudio::backend::tests::api::test_create_default_audiounit::_$u7b$$u7b$closure$u7d$$u7d$::head8ffc071c77119 api.rs:845
    #18 0x10b86e400 in core::ops::function::FnOnce::call_once::h9250e57df7b85fe5 function.rs:232
    #19 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #20 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #21 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #22 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #23 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #24 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #25 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #26 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #27 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #28 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #29 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3b626977 in CADispatchQueue::InstallMachPortDeathNotification(unsigned int, void () block_pointer) (CoreAudio:x86_64+0x36a977)
    #8 0x7fff3b53761c in HALC_ProxyObject::HALC_ProxyObject(unsigned int, unsigned int, unsigned int, unsigned int) (CoreAudio:x86_64+0x27b61c)
    #9 0x7fff3b5f4cfe in HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int) (CoreAudio:x86_64+0x338cfe)
    #10 0x7fff3b3e159f in HALC_ShellSimpleProxyList::Reconcile(bool, bool) (CoreAudio:x86_64+0x12559f)
    #11 0x7fff3b3a70ff in HALC_ShellPlugIn::ConnectToServer() (CoreAudio:x86_64+0xeb0ff)
    #12 0x7fff3b3a929e in HAL_HardwarePlugIn_InitializeWithObjectID(AudioHardwarePlugInInterface**, unsigned int) (CoreAudio:x86_64+0xed29e)
    #13 0x7fff3b2c09df in HALPlugInManagement::CreateHALPlugIn(HALCFPlugIn const*) (CoreAudio:x86_64+0x49df)
    #14 0x7fff3b2bf82b in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x382b)
    #15 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #16 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #17 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #18 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #19 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #20 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #21 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #22 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #23 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #24 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #25 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #26 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #27 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #28 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #29 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3d1c1894 in connectToCoreServicesD() (CarbonCore:x86_64+0x1894)
    #8 0x7fff3d1c176c in getStatus() (CarbonCore:x86_64+0x176c)
    #9 0x7fff3d1c4611 in scCreateSystemServiceVersion (CarbonCore:x86_64+0x4611)
    #10 0x7fff3d1c43a2 in FileIDTreeGetCachedPort (CarbonCore:x86_64+0x43a2)
    #11 0x7fff3d1c4224 in FSNodeStorageGetAndLockCurrentUniverse (CarbonCore:x86_64+0x4224)
    #12 0x7fff3d1c405b in FileIDTreeGetAndLockVolumeEntryForDeviceID (CarbonCore:x86_64+0x405b)
    #13 0x7fff3d1c3f34 in FSMount::FSMount(unsigned int, FSMountNumberType, int*, unsigned int const*) (CarbonCore:x86_64+0x3f34)
    #14 0x7fff3d1c3ea6 in FSMountPrepare (CarbonCore:x86_64+0x3ea6)
    #15 0x7fff5488f2e2 in MountInfoPrepare (CoreServicesInternal:x86_64+0x62e2)
    #16 0x7fff5488ebb8 in parseAttributeBuffer(__CFAllocator const*, unsigned char const*, unsigned char, attrlist const*, void const*, void**, _FileAttributes*, unsigned int*) (CoreServicesInternal:x86_64+0x5bb8)
    #17 0x7fff5488dbc7 in corePropertyProviderPrepareValues(__CFURL const*, __FileCache*, __CFString const* const*, void const**, long, void const*, __CFError**) (CoreServicesInternal:x86_64+0x4bc7)
    #18 0x7fff5488d7e3 in prepareValuesForBitmap(__CFURL const*, __FileCache*, _FilePropertyBitmap*, __CFError**) (CoreServicesInternal:x86_64+0x47e3)
    #19 0x7fff54889eb9 in _FSURLCopyResourcePropertyForKeyInternal(__CFURL const*, __CFString const*, void*, void*, __CFError**, unsigned char) (CoreServicesInternal:x86_64+0xeb9)
    #20 0x7fff3bda0957 in CFURLCopyResourcePropertyForKey (CoreFoundation:x86_64h+0x57957)
    #21 0x7fff3be54486 in _CFBundleForksCouldBeResourceFile (CoreFoundation:x86_64h+0x10b486)
    #22 0x7fff3be5420f in _CFBundleCopyInfoDictionaryInResourceForkWithAllocator (CoreFoundation:x86_64h+0x10b20f)
    #23 0x7fff3d1c1242 in GetBugsForOurBundleIDFromCoreservicesd (CarbonCore:x86_64+0x1242)
    #24 0x7fff3d1c10c1 in _CSCheckFix (CarbonCore:x86_64+0x10c1)
    #25 0x7fff6fcb14a8 in CAAppWorkArounds::CSCheckFix(__CFString const*) (libAudioToolboxUtility.dylib:x86_64+0x2e4a8)
    #26 0x7fff6fcb1370 in Prime() (libAudioToolboxUtility.dylib:x86_64+0x2e370)
    #27 0x7fff736294a5 in __pthread_once_handler (libsystem_pthread.dylib:x86_64+0x24a5)
    #28 0x7fff7361ed06 in _os_once_callout (libsystem_platform.dylib:x86_64+0x1d06)
    #29 0x7fff73629441 in pthread_once (libsystem_pthread.dylib:x86_64+0x2441)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3eb50e6c in IONotificationPortSetDispatchQueue (IOKit:x86_64+0x3e6c)
    #8 0x7fff3b2beda2 in HALSystem::InitializeDevices() (CoreAudio:x86_64+0x2da2)
    #9 0x7fff3b2bd86c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x186c)
    #10 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #11 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #12 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #13 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #14 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #15 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #16 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #17 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #18 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #19 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #20 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #21 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #22 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #23 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #24 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #25 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #26 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x10bc45d15 in wrap_malloc (librustc_rt.lsan.dylib:x86_64+0x7d15)
    #1 0x7fff734769af in _Block_copy (libsystem_blocks.dylib:x86_64+0x9af)
    #2 0x7fff73476a84 in _Block_object_assign (libsystem_blocks.dylib:x86_64+0xa84)
    #3 0x7fff734769ea in _Block_copy (libsystem_blocks.dylib:x86_64+0x9ea)
    #4 0x7fff733ce565 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x2565)
    #5 0x7fff733e0671 in _dispatch_source_set_handler (libdispatch.dylib:x86_64+0x14671)
    #6 0x10bc45741 in wrap_dispatch_source_set_event_handler (librustc_rt.lsan.dylib:x86_64+0x7741)
    #7 0x7fff3eb50e6c in IONotificationPortSetDispatchQueue (IOKit:x86_64+0x3e6c)
    #8 0x7fff3b2be060 in HALSystem::InitializeShell() (CoreAudio:x86_64+0x2060)
    #9 0x7fff3b2bd85c in HALSystem::CheckOutInstance() (CoreAudio:x86_64+0x185c)
    #10 0x7fff3b2c3390 in AudioObjectGetPropertyDataSize (CoreAudio:x86_64+0x7390)
    #11 0x10b98a651 in coreaudio_sys_utils::audio_object::audio_object_get_property_data_size::he0eaf833299eebe4 audio_object.rs:53
    #12 0x10b8e5aab in cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::h3e76404f9b14a63e aggregate_device.rs:71
    #13 0x10b8ddf5c in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::h0d70a68fe2e1203a aggregate_device.rs:91
    #14 0x10b9083e0 in cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h9d52174c383a86be aggregate_device.rs:90
    #15 0x10b86cc90 in core::ops::function::FnOnce::call_once::h17f8e75c23dc132f function.rs:232
    #16 0x10b94e24d in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h2e4f93f81da76d17 boxed.rs:1015
    #17 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #18 0x10b967aa4 in test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h4b9b8a01f72b9615 lib.rs:539
    #19 0x10b94241a in std::sys_common::backtrace::__rust_begin_short_backtrace::h8b1b834f82c031fe backtrace.rs:129
    #20 0x10b946afa in std::panicking::try::do_call::h966c935c18dac3cf panicking.rs:305
    #21 0x10b9b563a in __rust_maybe_catch_panic lib.rs:86
    #22 0x10b9477a5 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hb4f3a0d1b28e2122 mod.rs:474
    #23 0x10b9a36dd in _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd024fcd4bc850c39 boxed.rs:1015
    #24 0x10b9b4ebd in std::sys::unix::thread::Thread::new::thread_start::h29195c599e6e65d6 boxed.rs:1015
    #25 0x7fff7362ce64 in _pthread_start (libsystem_pthread.dylib:x86_64+0x5e64)
    #26 0x7fff7362883a in thread_start (libsystem_pthread.dylib:x86_64+0x183a)

SUMMARY: LeakSanitizer: 16950 byte(s) leaked in 400 allocation(s).

intermittent timeout when running `cargo test` on MBP M1Max

Intermittent timeout occurs when running cargo test:

....
test backend::tests::interfaces::test_ops_stream_register_device_changed_callback ... ok
test backend::tests::interfaces::test_ops_stream_position ... ok
test backend::tests::api::test_set_buffer_size_sync has been running for over 60 seconds
test backend::tests::interfaces::test_ops_context_register_device_collection_changed_with_a_duplex_stream has been running for over 60 seconds
test backend::tests::interfaces::test_ops_stream_set_volume has been running for over 60 seconds
test backend::tests::interfaces::test_ops_stream_start has been running for over 60 seconds
test backend::tests::interfaces::test_ops_stream_stop has been running for over 60 seconds
test backend::tests::tone::test_dial_tone has been running for over 60 seconds

assertion failed: stm.switching_device

This is the error line:

thread '<unnamed>' panicked at 'assertion failed: stm.switching_device.load(Ordering::SeqCst)', src/backend/mod.rs:647:25

Secnario:

  1. Duplex call to the default devices
  2. Change the default output
  3. Change the default input, then crashed

The full logs:

mod.rs:213: Creating a default device info.
mod.rs:218: Requesting default system device.
mod.rs:213: Creating a default device info.
mod.rs:218: Requesting default system device.
mod.rs:2595: (0x7fb0f6e14550) Initialize input by device info: device_info { id: 217, flags: DEV_INPUT | DEV_SYSTEM_DEFAULT | DEV_SELECTED_DEFAULT }
mod.rs:2606: (0x7fb0f6e14550) Opening input side: rate 44100, channels 1, format Float32LE, layout (empty), prefs NONE, latency in frames 128.
mod.rs:2635: (0x7fb0f6e14550) Input hardware description: AudioStreamBasicDescription { mSampleRate: 44100.0, mFormatID: 1819304813, mFormatFlags: 9, mBytesPerPacket: 8, mFramesPerPacket: 1, mBytesPerFrame: 8, mChannelsPerFrame: 2, mBitsPerChannel: 32, mReserved: 0 }
mod.rs:1351: The new buffer frames size of AudioUnit 0x8cef706f for INPUT is 128
mod.rs:2723: (0x7fb0f6e14550) Input audiounit init with device 217 successfully.
mod.rs:2731: (0x7fb0f6e14550) Initialize output by device info: device_info { id: 203, flags: DEV_OUTPUT | DEV_SYSTEM_DEFAULT | DEV_SELECTED_DEFAULT }
mod.rs:2742: (0x7fb0f6e14550) Opening output side: rate 44100, channels 2, format Float32LE, layout FRONT_LEFT | FRONT_RIGHT, prefs NONE, latency in frames 128.
mod.rs:2780: (0x7fb0f6e14550) Output hardware description: AudioStreamBasicDescription { mSampleRate: 44100.0, mFormatID: 1819304813, mFormatFlags: 9, mBytesPerPacket: 8, mFramesPerPacket: 1, mBytesPerFrame: 8, mChannelsPerFrame: 2, mBitsPerChannel: 32, mReserved: 0 }
mod.rs:1351: The new buffer frames size of AudioUnit 0x8cef7070 for OUTPUT is 128
mod.rs:2885: (0x7fb0f6e14550) Output audiounit init with device 203 successfully.
mod.rs:2328: (0x7fb0f6e14550) Cubeb stream init successful.
stream_init succeed
state is CUBEB_STATE_STARTED
mod.rs:3598: Cubeb stream (0x7fb0f6e14550) started successfully.
stream_start succeed
press `q` to abort or `h` for help
mod.rs:630: Dropping 1792 frames in input buffer.
mod.rs:774: (0x7fb0f6e14550) Audio device changed, 1 events.
mod.rs:782: Event[0] - mSelector == kAudioHardwarePropertyDefaultOutputDevice for id=1
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:213: Creating a default device info.
mod.rs:218: Requesting default system device.
mod.rs:213: Creating a default device info.
mod.rs:218: Requesting default system device.
mod.rs:2595: (0x7fb0f6e14550) Initialize input by device info: device_info { id: 217, flags: DEV_INPUT | DEV_SYSTEM_DEFAULT | DEV_SELECTED_DEFAULT }
mod.rs:2606: (0x7fb0f6e14550) Opening input side: rate 44100, channels 1, format Float32LE, layout (empty), prefs NONE, latency in frames 128.
mod.rs:2635: (0x7fb0f6e14550) Input hardware description: AudioStreamBasicDescription { mSampleRate: 44100.0, mFormatID: 1819304813, mFormatFlags: 9, mBytesPerPacket: 8, mFramesPerPacket: 1, mBytesPerFrame: 8, mChannelsPerFrame: 2, mBitsPerChannel: 32, mReserved: 0 }
mod.rs:1280: The buffer frame size of AudioUnit 0x8cef7075 for INPUT is already 128
mod.rs:2723: (0x7fb0f6e14550) Input audiounit init with device 217 successfully.
mod.rs:2731: (0x7fb0f6e14550) Initialize output by device info: device_info { id: 217, flags: DEV_OUTPUT | DEV_SYSTEM_DEFAULT | DEV_SELECTED_DEFAULT }
mod.rs:2742: (0x7fb0f6e14550) Opening output side: rate 44100, channels 2, format Float32LE, layout FRONT_LEFT | FRONT_RIGHT, prefs NONE, latency in frames 128.
mod.rs:2780: (0x7fb0f6e14550) Output hardware description: AudioStreamBasicDescription { mSampleRate: 44100.0, mFormatID: 1819304813, mFormatFlags: 9, mBytesPerPacket: 8, mFramesPerPacket: 1, mBytesPerFrame: 8, mChannelsPerFrame: 2, mBitsPerChannel: 32, mReserved: 0 }
mod.rs:1280: The buffer frame size of AudioUnit 0x8cef7076 for OUTPUT is already 128
mod.rs:2885: (0x7fb0f6e14550) Output audiounit init with device 217 successfully.
mod.rs:774: (0x7fb0f6e14550) Audio device changed, 1 events.
mod.rs:806: Event[0] - mSelector == kAudioHardwarePropertyDefaultInputDevice for id=1
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:641: (0x7fb0f6e14550) Missing Frames: device switching, will append 128 frames of input silence.
mod.rs:213: Creating a default device info.
mod.rs:218: Requesting default system device.
mod.rs:213: Creating a default device info.
mod.rs:218: Requesting default system device.
mod.rs:2595: (0x7fb0f6e14550) Initialize input by device info: device_info { id: 196, flags: DEV_INPUT | DEV_SYSTEM_DEFAULT | DEV_SELECTED_DEFAULT }
mod.rs:2606: (0x7fb0f6e14550) Opening input side: rate 44100, channels 1, format Float32LE, layout (empty), prefs NONE, latency in frames 128.
mod.rs:2635: (0x7fb0f6e14550) Input hardware description: AudioStreamBasicDescription { mSampleRate: 44100.0, mFormatID: 1819304813, mFormatFlags: 9, mBytesPerPacket: 8, mFramesPerPacket: 1, mBytesPerFrame: 8, mChannelsPerFrame: 2, mBitsPerChannel: 32, mReserved: 0 }
mod.rs:1351: The new buffer frames size of AudioUnit 0x8cef707d for INPUT is 128
mod.rs:2723: (0x7fb0f6e14550) Input audiounit init with device 196 successfully.
mod.rs:2731: (0x7fb0f6e14550) Initialize output by device info: device_info { id: 217, flags: DEV_OUTPUT | DEV_SYSTEM_DEFAULT | DEV_SELECTED_DEFAULT }
mod.rs:2742: (0x7fb0f6e14550) Opening output side: rate 44100, channels 2, format Float32LE, layout FRONT_LEFT | FRONT_RIGHT, prefs NONE, latency in frames 128.
mod.rs:2780: (0x7fb0f6e14550) Output hardware description: AudioStreamBasicDescription { mSampleRate: 44100.0, mFormatID: 1819304813, mFormatFlags: 9, mBytesPerPacket: 8, mFramesPerPacket: 1, mBytesPerFrame: 8, mChannelsPerFrame: 2, mBitsPerChannel: 32, mReserved: 0 }
mod.rs:1280: The buffer frame size of AudioUnit 0x8cef707e for OUTPUT is already 128
mod.rs:2885: (0x7fb0f6e14550) Output audiounit init with device 217 successfully.
thread '<unnamed>' panicked at 'assertion failed: stm.switching_device.load(Ordering::SeqCst)', src/backend/mod.rs:647:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: Rust panics must be rethrown
Abort trap: 6

Test passed when `cargo clippy -- -D warnings` fails

My terminal gives a warning when running the update introduced by #57 as follows, but the Travis server doesn't fail.

We should make cargo clippy -- -D warnings work.

chang@cchang-37365 cubeb-coreaudio-rs % cargo clippy -- -D warnings                                                                    < (git) pr-57
    Checking cubeb-coreaudio v0.1.0 (/Users/cchang/Work/cubeb-coreaudio-rs)
error: unused variable: `frames_written`
   --> src/backend/mod.rs:659:17
    |
659 |             let frames_written = stm.frames_written.load(Ordering::SeqCst);
    |                 ^^^^^^^^^^^^^^ help: consider prefixing with an underscore: `_frames_written`
    |
    = note: `-D unused-variables` implied by `-D warnings`

error: aborting due to previous error

error: could not compile `cubeb-coreaudio`.

To learn more, run the command again with --verbose.

intermittent crash when running cargo test

The cargo test crashes randomly.

Here is a log for the crash when running rust-lldb target/debug/deps/cubeb_coreaudio-*

Process 2001 stopped
* thread #24, name = 'backend::tests::api::test_set_channel_layout_input', stop reason = EXC_BAD_ACCESS (code=1, address=0xa)
    frame #0: 0x00007fff3c23e198 CoreFoundation`CFRelease + 11
CoreFoundation`CFRelease:
->  0x7fff3c23e198 <+11>: movq   0x8(%rdi), %rcx
    0x7fff3c23e19c <+15>: movq   (%rdi), %rax
    0x7fff3c23e19f <+18>: testq  %rax, %rax
    0x7fff3c23e1a2 <+21>: je     0x7fff3c23e1cb            ; <+62>
Target 0: (cubeb_coreaudio-fb8fa5520de9e09f) stopped.
(lldb) bt
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
* thread #24, name = 'backend::tests::api::test_set_channel_layout_input', stop reason = EXC_BAD_ACCESS (code=1, address=0xa)
  * frame #0: 0x00007fff3c23e198 CoreFoundation`CFRelease + 11
    frame #1: 0x0000000105bc2134 CoreAudio`___lldb_unnamed_symbol120$$CoreAudio + 34
    frame #2: 0x0000000105c5c300 CoreAudio`___lldb_unnamed_symbol2202$$CoreAudio + 14
    frame #3: 0x0000000105c5cbdf CoreAudio`___lldb_unnamed_symbol2210$$CoreAudio + 37
    frame #4: 0x0000000105be3115 CoreAudio`___lldb_unnamed_symbol672$$CoreAudio + 165
    frame #5: 0x0000000105cbdd2c CoreAudio`___lldb_unnamed_symbol3288$$CoreAudio + 30
    frame #6: 0x00007fff50950653 AudioToolboxCore`AudioComponentInstanceDispose + 58
    frame #7: 0x00000001000e3134 cubeb_coreaudio-fb8fa5520de9e09f`_$LT$cubeb_coreaudio..backend..tests..utils..TestAudioUnit$u20$as$u20$core..ops..drop..Drop$GT$::drop::hade0d12626f943fa(self=&0x70000a248788) at utils.rs:81:12
    frame #8: 0x00000001000c7bd5 cubeb_coreaudio-fb8fa5520de9e09f`core::ptr::real_drop_in_place::h9a4495cedf5ac709((null)=&0x70000a248788) at mod.rs:175
    frame #9: 0x000000010000ac7d cubeb_coreaudio-fb8fa5520de9e09f`cubeb_coreaudio::backend::tests::api::test_set_channel_layout_input::h69123317f82de5dc at api.rs:995:4
    frame #10: 0x00000001001096f1 cubeb_coreaudio-fb8fa5520de9e09f`cubeb_coreaudio::backend::tests::api::test_set_channel_layout_input::_$u7b$$u7b$closure$u7d$$u7d$::h80a84f1d5587d4da((null)=&0x70000a2488c0) at api.rs:983
    frame #11: 0x00000001000c44f1 cubeb_coreaudio-fb8fa5520de9e09f`core::ops::function::FnOnce::call_once::hb3a5bff67965f914((null)=closure-0 {

}, (null)=<unavailable>) at function.rs:227:4
    frame #12: 0x00000001001272ae cubeb_coreaudio-fb8fa5520de9e09f`_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h62abc180af5184b6 at boxed.rs:922:8 [opt]
    frame #13: 0x000000010018050f cubeb_coreaudio-fb8fa5520de9e09f`__rust_maybe_catch_panic at lib.rs:80:7 [opt]
    frame #14: 0x0000000100140477 cubeb_coreaudio-fb8fa5520de9e09f`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h26163299dd66a05b [inlined] std::panicking::try::hc6851a78b7283b60 at panicking.rs:271:12 [opt]
    frame #15: 0x0000000100140432 cubeb_coreaudio-fb8fa5520de9e09f`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h26163299dd66a05b [inlined] std::panic::catch_unwind::h4f224793963be037 at panic.rs:394 [opt]
    frame #16: 0x0000000100140432 cubeb_coreaudio-fb8fa5520de9e09f`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h26163299dd66a05b at lib.rs:1413 [opt]
    frame #17: 0x000000010011c915 cubeb_coreaudio-fb8fa5520de9e09f`std::sys_common::backtrace::__rust_begin_short_backtrace::h09f30e53b0d36855 at backtrace.rs:126:4 [opt]
    frame #18: 0x0000000100120ad5 cubeb_coreaudio-fb8fa5520de9e09f`std::panicking::try::do_call::h2a1d2c5cb64914d2 [inlined] std::thread::Builder::spawn_unchecked::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h11ad033de2bf23bd at mod.rs:470:16 [opt]
    frame #19: 0x0000000100120ac2 cubeb_coreaudio-fb8fa5520de9e09f`std::panicking::try::do_call::h2a1d2c5cb64914d2 [inlined] _$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::hdfd84f2d534f6c68 at panic.rs:315 [opt]
    frame #20: 0x0000000100120ac2 cubeb_coreaudio-fb8fa5520de9e09f`std::panicking::try::do_call::h2a1d2c5cb64914d2 at panicking.rs:292 [opt]
    frame #21: 0x000000010018050f cubeb_coreaudio-fb8fa5520de9e09f`__rust_maybe_catch_panic at lib.rs:80:7 [opt]
    frame #22: 0x0000000100121085 cubeb_coreaudio-fb8fa5520de9e09f`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h8de107699c84b337 [inlined] std::panicking::try::h830b2026ed6a44c3 at panicking.rs:271:12 [opt]
    frame #23: 0x000000010012104c cubeb_coreaudio-fb8fa5520de9e09f`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h8de107699c84b337 [inlined] std::panic::catch_unwind::h8489ab8e1eca8899 at panic.rs:394 [opt]
    frame #24: 0x000000010012104c cubeb_coreaudio-fb8fa5520de9e09f`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h8de107699c84b337 [inlined] std::thread::Builder::spawn_unchecked::_$u7b$$u7b$closure$u7d$$u7d$::hb9ab1346bf0aa0ce at mod.rs:469 [opt]
    frame #25: 0x0000000100121017 cubeb_coreaudio-fb8fa5520de9e09f`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h8de107699c84b337 at function.rs:227 [opt]
    frame #26: 0x0000000100173c7e cubeb_coreaudio-fb8fa5520de9e09f`_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd1afe4d791e3679f at boxed.rs:922:8 [opt]
    frame #27: 0x000000010017fd9e cubeb_coreaudio-fb8fa5520de9e09f`std::sys::unix::thread::Thread::new::thread_start::h785fcf8d81bd0f52 [inlined] _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hd175b6857cf77782 at boxed.rs:922:8 [opt]
    frame #28: 0x000000010017fd92 cubeb_coreaudio-fb8fa5520de9e09f`std::sys::unix::thread::Thread::new::thread_start::h785fcf8d81bd0f52 [inlined] std::sys_common::thread::start_thread::hed1d18da7acfc5a9 at thread.rs:13 [opt]
    frame #29: 0x000000010017fd1e cubeb_coreaudio-fb8fa5520de9e09f`std::sys::unix::thread::Thread::new::thread_start::h785fcf8d81bd0f52 at thread.rs:79 [opt]
    frame #30: 0x00007fff73b16e65 libsystem_pthread.dylib`_pthread_start + 148
    frame #31: 0x00007fff73b1283b libsystem_pthread.dylib`thread_start + 15

Run sanitizer tests on circle-ci

#124 will initialize the settings for circle-ci but it only runs the regular tests. We should turn on the sanitizer tests as well, which requires to be run with Rust nightly

WARNING: ThreadSanitizer: data race

Running RUSTFLAGS="-Z sanitizer=thread" cargo test or the executable it generates will shows the following data-race warning

(lldb) r
Process 8952 launched: '/Users/cchang/Work/cubeb/src/cubeb-coreaudio-rs/target/debug/deps/cubeb_coreaudio-c4da6e229b8adc8d' (x86_64)

running 190 tests
test backend::auto_array::test_auto_array ... ok
test backend::tests::aggregate_device::test_aggregate_activate_clock_drift_compensation ... ignored
test backend::tests::aggregate_device::test_aggregate_activate_clock_drift_compensation_for_a_blank_aggregate_device ... ignored
test backend::tests::aggregate_device::test_aggregate_activate_clock_drift_compensation_for_an_aggregate_device_without_master_device ... ignored
test backend::auto_release::test_auto_release ... ok
test backend::tests::aggregate_device::test_aggregate_create_blank_device ... ignored
test backend::tests::aggregate_device::test_aggregate_activate_clock_drift_compensation_for_an_unknown_aggregate_device ... ok
test backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_plugin_device ... ignored
test backend::tests::aggregate_device::test_aggregate_destroy_device_for_unknown_plugin_and_aggregate_devices ... ok
test backend::tests::aggregate_device::test_aggregate_get_sub_devices_for_blank_aggregate_devices ... ignored
test backend::tests::aggregate_device::test_aggregate_set_master_device ... ignored
test backend::tests::aggregate_device::test_aggregate_set_master_device_for_a_blank_aggregate_device ... ignored
test backend::tests::aggregate_device::test_aggregate_get_sub_devices_for_a_unknown_device ... ok
test backend::tests::aggregate_device::test_aggregate_set_sub_devices ... ignored
test backend::tests::aggregate_device::test_aggregate_set_master_device_for_an_unknown_aggregate_device ... ok
test backend::tests::aggregate_device::test_aggregate_set_sub_devices_for_unknown_input_devices ... ignored
test backend::tests::aggregate_device::test_aggregate_set_sub_devices_for_unknown_output_devices ... ignored
test backend::tests::aggregate_device::test_aggregate_set_sub_devices_for_unknown_devices ... ok
2019-12-19 15:22:35.932814-0800 cubeb_coreaudio-c4da6e229b8adc8d[8952:132502] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x7b0800003b40> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2019-12-19 15:22:35.972639-0800 cubeb_coreaudio-c4da6e229b8adc8d[8952:132502]  HALC_ShellDriverPlugIn::Open: Can't get a pointer to the Open routine
2019-12-19 15:22:35.972991-0800 cubeb_coreaudio-c4da6e229b8adc8d[8952:132502]  HALC_ShellDriverPlugIn::Open: Can't get a pointer to the Open routine
2019-12-19 15:22:35.984974-0800 cubeb_coreaudio-c4da6e229b8adc8d[8952:132502]  HALC_ShellDriverPlugIn::Open: Can't get a pointer to the Open routine
2019-12-19 15:22:35.985918-0800 cubeb_coreaudio-c4da6e229b8adc8d[8952:132515]  AudioObjectAddPropertyListener: no object with given ID 0
test backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device ... ok
test backend::tests::api::test_add_listener_unknown_device ... ok
test backend::tests::api::test_add_devices_changed_listener_with_none_callback ... ok
test backend::tests::api::test_add_devices_changed_listener_in_unknown_scope ... ok
test backend::tests::aggregate_device::test_aggregate_set_sub_devices_for_an_unknown_aggregate_device ... ok
test backend::tests::api::test_add_listener_then_remove_system_device ... ok
test backend::tests::aggregate_device::test_aggregate_get_sub_devices ... ok
test backend::tests::api::test_channel_label_to_cubeb_channel_layout ... ok
test backend::tests::api::test_convert_channel_layout ... ok
test backend::tests::api::test_clamp_latency ... ok
test backend::tests::api::test_convert_uint32_into_string ... ok
test backend::tests::api::test_create_audiounit_with_unknown_scope ... ok
test backend::tests::api::test_create_auto_array ... ok
test backend::tests::api::test_create_auto_array_with_empty_audiodescription ... ok
test backend::tests::api::test_create_auto_array_with_invalid_audiodescription ... ok
test backend::tests::api::test_create_auto_array_with_zero_latency_f32 ... ok
test backend::tests::api::test_create_auto_array_with_zero_latency_i16 ... ok
test backend::tests::api::test_create_device_from_hwdev_with_inout_type ... ok
test backend::tests::api::test_create_device_info_by_unknown_device ... ok
test backend::tests::api::test_create_device_info_from_unknown_input_device ... ok
test backend::tests::api::test_create_device_info_from_unknown_output_device ... ok
test backend::tests::api::test_create_device_info_with_unknown_type ... ok
test backend::tests::api::test_create_stream_description ... ok
test backend::tests::api::test_cubeb_channel_layout_to_channel_label ... ok
test backend::tests::api::test_cubeb_channel_layout_to_channel_label_with_invalid_channel ... ok
test backend::tests::api::test_cubeb_channel_layout_to_channel_label_with_unknown_channel ... ok
test backend::tests::api::test_create_cubeb_device_info ... ok
test backend::tests::api::test_device_destroy ... ok
test backend::tests::api::test_device_destroy_empty_device ... ok
test backend::tests::api::test_device_destroy_with_different_device_id_and_group_id ... ok
test backend::tests::api::test_add_devices_changed_listener ... ok
test backend::tests::api::test_enable_audiounit_scope_with_null_unit ... ok
test backend::tests::api::test_get_channel_count ... ok
test backend::tests::api::test_get_channel_count_of_inout_type ... ok
test backend::tests::api::test_get_channel_count_of_input_for_a_output_only_deivce ... ok
test backend::tests::api::test_get_channel_count_of_unknown_device ... ok
test backend::tests::api::test_get_channel_count_of_output_for_a_input_only_deivce ... ok
test backend::tests::api::test_get_channel_count_of_unknwon_type ... ok
test backend::tests::api::test_get_default_device_id ... ok
test backend::tests::api::test_get_default_device_id_with_inout_type ... ok
test backend::tests::api::test_get_default_device_id_with_unknown_type ... ok
test backend::tests::api::test_get_default_device_name ... ok
test backend::tests::api::test_get_device_presentation_latency ... ok
test backend::tests::api::test_get_devices_of_type_unknown ... ok
test backend::tests::api::test_get_range_of_sample_rates ... ok
test backend::tests::api::test_get_devices_of_type ... ok
test backend::tests::api::test_is_aggregate_device ... ok
test backend::tests::api::test_is_device_a_type_of ... ok
test backend::tests::api::test_make_silent ... ok
test backend::tests::api::test_make_sized_audio_channel_layout ... ok
test backend::tests::api::test_make_sized_audio_channel_layout_with_wrong_size ... ok
test backend::tests::api::test_minimum_resampling_input_frames ... ok
test backend::tests::api::test_minimum_resampling_input_frames_equal_input_output_rate ... ok
test backend::tests::api::test_minimum_resampling_input_frames_zero_input_rate ... ok
test backend::tests::api::test_minimum_resampling_input_frames_zero_output_rate ... ok
test backend::tests::api::test_increase_and_decrease_context_streams ... ok
test backend::tests::api::test_remove_devices_changed_listener ... ok
test backend::tests::api::test_remove_devices_changed_listener_without_adding_listeners ... ok
2019-12-19 15:22:36.054276-0800 cubeb_coreaudio-c4da6e229b8adc8d[8952:132607]  AudioObjectRemovePropertyListener: no object with given ID 0
test backend::tests::api::test_remove_listener_unknown_device ... ok
test backend::tests::api::test_remove_listener_without_adding_any_listener_before_system_device ... ok
test backend::tests::api::test_remove_devices_changed_listener_within_all_scopes ... ok
test backend::tests::api::test_set_buffer_size_sync_for_input_with_null_input_unit ... ok
test backend::tests::api::test_set_buffer_size_sync_for_output_with_null_output_unit ... ok
test backend::tests::api::test_enable_audiounit_scope ... ok
test backend::tests::api::test_enable_audiounit_scope_for_default_output_unit ... ok
test backend::tests::api::test_get_current_channel_layout_output ... ok
test backend::tests::api::test_set_channel_layout_with_null_unit ... ok
test backend::tests::api::test_set_device_info_to_nonexistent_input_device ... ignored
test backend::tests::api::test_set_device_info_to_nonexistent_output_device ... ignored
test backend::tests::api::test_set_device_info_to_system_input_device ... ok
test backend::tests::api::test_get_preferred_channel_layout_output ... ok
test backend::tests::api::test_set_device_info_to_system_output_device ... ok
test backend::tests::backlog::test_stream_register_device_changed_callback ... ok
test backend::tests::backlog::test_stream_register_device_changed_callback_twice ... ok
test backend::tests::device_change::test_destroy_duplex_stream_after_unplugging_a_default_input_device ... ignored
test backend::tests::device_change::test_destroy_duplex_stream_after_unplugging_a_default_output_device ... ignored
test backend::tests::device_change::test_destroy_duplex_stream_after_unplugging_a_nondefault_input_device ... ignored
test backend::tests::device_change::test_destroy_duplex_stream_after_unplugging_a_nondefault_output_device ... ignored
test backend::tests::device_change::test_destroy_input_stream_after_unplugging_a_default_input_device ... ignored
test backend::tests::device_change::test_destroy_input_stream_after_unplugging_a_nondefault_input_device ... ignored
test backend::tests::device_change::test_destroy_output_stream_after_unplugging_a_default_output_device ... ignored
test backend::tests::device_change::test_destroy_output_stream_after_unplugging_a_nondefault_output_device ... ignored
test backend::tests::device_change::test_plug_and_unplug_device ... ignored
test backend::tests::device_change::test_register_device_changed_callback_to_check_default_device_changed_duplex ... ignored
test backend::tests::device_change::test_register_device_changed_callback_to_check_default_device_changed_input ... ignored
test backend::tests::device_change::test_register_device_changed_callback_to_check_default_device_changed_output ... ignored
test backend::tests::device_change::test_reinit_duplex_stream_by_unplugging_a_default_input_device ... ignored
test backend::tests::device_change::test_reinit_duplex_stream_by_unplugging_a_default_output_device ... ignored
test backend::tests::device_change::test_reinit_duplex_stream_by_unplugging_a_nondefault_input_device ... ignored
test backend::tests::device_change::test_reinit_duplex_stream_by_unplugging_a_nondefault_output_device ... ignored
test backend::tests::device_change::test_reinit_input_stream_by_unplugging_a_default_input_device ... ignored
test backend::tests::device_change::test_reinit_input_stream_by_unplugging_a_nondefault_input_device ... ignored
test backend::tests::device_change::test_reinit_output_stream_by_unplugging_a_default_output_device ... ignored
test backend::tests::device_change::test_reinit_output_stream_by_unplugging_a_nondefault_output_device ... ignored
test backend::tests::device_change::test_switch_device ... ignored
test backend::tests::device_property::test_get_device_buffer_frame_size_range ... ok
test backend::tests::api::test_set_channel_layout_input ... ok
test backend::tests::device_property::test_get_device_buffer_frame_size_range_by_unknown_device ... ok
test backend::tests::device_property::test_get_device_global_uid ... ok
test backend::tests::device_property::test_get_device_global_uid_by_unknwon_device ... ok
test backend::tests::device_property::test_get_device_label_by_unknown_device ... ok
test backend::tests::api::test_set_channel_layout_output ... ok
test backend::tests::device_property::test_get_device_latency ... ok
test backend::tests::device_property::test_get_device_label ... ok
test backend::tests::device_property::test_get_device_latency_by_unknown_device ... ok
test backend::tests::device_property::test_get_device_manufacturer_by_unknown_device ... ok
test backend::tests::device_property::test_get_device_manufacturer ... ok
test backend::tests::api::test_set_channel_layout_output_undefind ... ok
test backend::tests::device_property::test_get_device_name_by_unknown_device ... ok
test backend::tests::device_property::test_get_device_name ... ok
test backend::tests::api::test_stream_get_volume ... ok
test backend::tests::device_property::test_get_device_sample_rate ... ok
test backend::tests::device_property::test_get_device_sample_rate_by_unknown_device ... ok
test backend::tests::device_property::test_get_device_source_by_unknown_device ... ok
test backend::tests::device_property::test_get_device_source ... ok
test backend::tests::device_property::test_get_device_source_name_by_unknown_device ... ok
test backend::tests::device_property::test_get_device_source_name ... ok
test backend::tests::device_property::test_get_device_stream_configuration_by_unknown_device ... ok
test backend::tests::device_property::test_get_device_stream_configuration ... ok
test backend::tests::device_property::test_get_device_stream_format_by_unknown_device ... ok
test backend::tests::device_property::test_get_device_stream_format ... ok
test backend::tests::device_property::test_get_device_streams ... ok
test backend::tests::device_property::test_get_device_streams_by_unknown_device ... ok
test backend::tests::device_property::test_get_device_uid ... ok
test backend::tests::api::test_set_buffer_size_sync ... ok
test backend::tests::api::test_for_create_audiounit ... ok
test backend::tests::device_property::test_get_device_uid_by_unknwon_device ... ok
test backend::tests::device_property::test_get_ranges_of_device_sample_rate_by_unknown_device ... ok
test backend::tests::device_property::test_get_ranges_of_device_sample_rate ... ok
test backend::tests::device_property::test_get_stream_latency ... ok
test backend::tests::device_property::test_get_stream_latency_by_unknown_device ... ok
test backend::tests::interfaces::test_ops_context_backend_id ... ok
test backend::tests::interfaces::test_ops_context_device_collection_destroy ... ok
test backend::tests::interfaces::test_ops_context_enumerate_devices_unknown ... ok
test backend::tests::interfaces::test_ops_context_init_and_destroy ... ok
test backend::tests::interfaces::test_ops_context_max_channel_count ... ok
test backend::tests::interfaces::test_ops_context_min_latency ... ok
test backend::tests::interfaces::test_ops_context_register_device_collection_changed_manual ... ignored
test backend::tests::interfaces::test_ops_context_preferred_sample_rate ... ok
test backend::tests::api::test_create_default_audiounit ... ok
test backend::tests::interfaces::test_ops_context_register_device_collection_changed_unknown ... ok
test backend::tests::interfaces::test_ops_context_register_device_collection_changed_twice_input ... ok
test backend::tests::interfaces::test_ops_context_register_device_collection_changed_twice_output ... ok
test backend::tests::interfaces::test_ops_context_enumerate_devices_input ... ok
test backend::tests::interfaces::test_ops_context_register_device_collection_changed_twice_inout ... ok
test backend::tests::interfaces::test_ops_context_enumerate_devices_output ... ok
test backend::tests::interfaces::test_ops_stream_device_destroy ... ok
test backend::tests::interfaces::test_ops_stream_current_device ... ok
test backend::tests::interfaces::test_ops_stream_init_and_destroy ... ok
test backend::tests::interfaces::test_ops_stream_latency ... ok
test backend::tests::manual::test_add_then_remove_listeners ... ignored
test backend::tests::manual::test_device_collection_change ... ignored
test backend::tests::manual::test_stream_tester ... ignored
test backend::tests::manual::test_switch_output_device ... ignored
test backend::tests::parallel::test_parallel_init_streams_in_parallel_duplex ... ignored
test backend::tests::parallel::test_parallel_init_streams_in_parallel_input ... ignored
test backend::tests::parallel::test_parallel_init_streams_in_parallel_output ... ignored
test backend::tests::parallel::test_parallel_ops_init_streams_in_parallel_duplex ... ignored
test backend::tests::parallel::test_parallel_ops_init_streams_in_parallel_input ... ignored
test backend::tests::parallel::test_parallel_ops_init_streams_in_parallel_output ... ignored
test backend::tests::parallel::test_set_buffer_frame_size_in_parallel ... ignored
test backend::tests::interfaces::test_ops_stream_position ... ok
test backend::utils::test_cubeb_sample_size ... ok
test backend::utils::test_finally ... ok
test backend::utils::test_forget_vec_and_retake_it ... ok
test backend::tests::interfaces::test_ops_stream_register_device_changed_callback ... ok
test backend::tests::interfaces::test_ops_context_register_device_collection_changed ... ok
test backend::tests::interfaces::test_ops_stream_reset_default_device ... ok
test backend::tests::interfaces::test_ops_stream_set_volume ... ok
test backend::tests::interfaces::test_ops_stream_stop ... ok
test backend::tests::interfaces::test_ops_stream_start ... ok
2019-12-19 15:22:37.207787-0800 atos[8955:132708] examining /Users/USER/*/cubeb_coreaudio-c4da6e229b8adc8d [8952]
2019-12-19 15:22:37.329025-0800 atos[8956:132716] examining /Users/USER/*/cubeb_coreaudio-c4da6e229b8adc8d [8952]
==================
WARNING: ThreadSanitizer: data race (pid=8952)
  Write of size 1 at 0x7b540005ff58 by thread T38:
    #0 _$LT$cubeb_coreaudio..backend..AudioUnitStream$u20$as$u20$cubeb_backend..traits..StreamOps$GT$::stop::h56d0fab4f1f92552 mod.rs:3445 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10005603a)
    #1 cubeb_backend::capi::capi_stream_stop::h2a2aa09a90195560 capi.rs:186 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10017ad20)
    #2 cubeb_coreaudio::backend::tests::tone::test_dial_tone::_$u7b$$u7b$closure$u7d$$u7d$::h81452bba3112fc9d tone.rs:43 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000a936e)
    #3 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::_$u7b$$u7b$closure$u7d$$u7d$::h3a124a47a2cd9f38 utils.rs:1089 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100105cb3)
    #4 cubeb_coreaudio::backend::tests::utils::test_ops_context_operation::hb152e938d324a359 utils.rs:1035 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000fb4d5)
    #5 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::hb658820b2f03c09a utils.rs:1056 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100100a67)
    #6 cubeb_coreaudio::backend::tests::tone::test_dial_tone::h4bcba1d01664f24e tone.rs:30 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10009b1be)
    #7 cubeb_coreaudio::backend::tests::tone::test_dial_tone::_$u7b$$u7b$closure$u7d$$u7d$::h7438cd72b6fce8a3 tone.rs:5 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000a9034)
    #8 core::ops::function::FnOnce::call_once::h3285cd6ea1ab5ae6 function.rs:227 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100143a69)
    #9 _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::heea29d305168cdf7 boxed.rs:922 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001c13ed)

  Previous atomic read of size 1 at 0x7b540005ff58 by thread T26 (mutexes: write M1011, write M1776):
    #0 __tsan_atomic8_load <null>:12141584 (lib__rustc__clang_rt.tsan_osx_dynamic.dylib:x86_64+0x253b3)
    #1 core::sync::atomic::atomic_load::h724350f76636876b atomic.rs:2125 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000cfb1b)
    #2 core::sync::atomic::AtomicBool::load::h021080efa33fc51c atomic.rs:401 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001abd27)
    #3 cubeb_coreaudio::backend::audiounit_output_callback::h7f415e5cf9a6d3f8 mod.rs:639 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10002e1ab)
    #4 <null> <null>:12141584 (CoreAudio:x86_64+0x45e90)

  As if synchronized via sleep:
    #0 nanosleep <null>:12141712 (lib__rustc__clang_rt.tsan_osx_dynamic.dylib:x86_64+0x7b13)
    #1 std::thread::sleep::h80eb7fbfe4465e74 thread.rs:166 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100217ddf)
    #2 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::_$u7b$$u7b$closure$u7d$$u7d$::h3a124a47a2cd9f38 utils.rs:1089 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100105cb3)
    #3 cubeb_coreaudio::backend::tests::utils::test_ops_context_operation::hb152e938d324a359 utils.rs:1035 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000fb4d5)
    #4 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::hb658820b2f03c09a utils.rs:1056 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100100a67)
    #5 cubeb_coreaudio::backend::tests::tone::test_dial_tone::h4bcba1d01664f24e tone.rs:30 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10009b1be)
    #6 cubeb_coreaudio::backend::tests::tone::test_dial_tone::_$u7b$$u7b$closure$u7d$$u7d$::h7438cd72b6fce8a3 tone.rs:5 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000a9034)
    #7 core::ops::function::FnOnce::call_once::h3285cd6ea1ab5ae6 function.rs:227 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100143a69)
    #8 _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::heea29d305168cdf7 boxed.rs:922 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001c13ed)

  Location is heap block of size 528 at 0x7b540005ff00 allocated by thread T38:
    #0 malloc <null>:12141616 (lib__rustc__clang_rt.tsan_osx_dynamic.dylib:x86_64+0x2e16a)
    #1 alloc::alloc::alloc::h1f950b7b6b346bde alloc.rs:84 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10009ddaa)
    #2 alloc::alloc::exchange_malloc::h24fd84441ccb6771 alloc.rs:206 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10009dcd5)
    #3 _$LT$cubeb_coreaudio..backend..AudioUnitContext$u20$as$u20$cubeb_backend..traits..ContextOps$GT$::stream_init::h4af9b2f2531f7f0d mod.rs:2260 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100041db7)
    #4 cubeb_backend::capi::capi_stream_init::h178991a295d21419 capi.rs:155 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10017ab50)
    #5 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::_$u7b$$u7b$closure$u7d$$u7d$::h3a124a47a2cd9f38 utils.rs:1072 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100105a2a)
    #6 cubeb_coreaudio::backend::tests::utils::test_ops_context_operation::hb152e938d324a359 utils.rs:1035 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000fb4d5)
    #7 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::hb658820b2f03c09a utils.rs:1056 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100100a67)
    #8 cubeb_coreaudio::backend::tests::tone::test_dial_tone::h4bcba1d01664f24e tone.rs:30 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10009b1be)
    #9 cubeb_coreaudio::backend::tests::tone::test_dial_tone::_$u7b$$u7b$closure$u7d$$u7d$::h7438cd72b6fce8a3 tone.rs:5 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000a9034)
    #10 core::ops::function::FnOnce::call_once::h3285cd6ea1ab5ae6 function.rs:227 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100143a69)
    #11 _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::heea29d305168cdf7 boxed.rs:922 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001c13ed)

  Mutex M1011 (0x7b60000119d8) created at:
    #0 pthread_mutex_init <null>:12141472 (lib__rustc__clang_rt.tsan_osx_dynamic.dylib:x86_64+0x9db3)
    #1 HALB_Mutex::HALB_Mutex() <null>:12141472 (CoreAudio:x86_64+0x402ccf)
    #2 cubeb_coreaudio::backend::aggregate_device::AggregateDevice::get_system_plugin_id::hf67ad387c6e4b086 aggregate_device.rs:71 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000bea1a)
    #3 cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::hf353c151d8ef16ae aggregate_device.rs:91 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100059c95)
    #4 cubeb_coreaudio::backend::tests::aggregate_device::test_aggregate_destroy_aggregate_device_for_a_unknown_aggregate_device::_$u7b$$u7b$closure$u7d$$u7d$::h2c721887be9f5510 aggregate_device.rs:90 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100092c64)
    #5 core::ops::function::FnOnce::call_once::h119dbe6961455c4f function.rs:227 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001432e9)
    #6 _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::heea29d305168cdf7 boxed.rs:922 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001c13ed)

  Mutex M1776 (0x7b6c0005ff50) created at:
    #0 pthread_mutex_init <null>:12141472 (lib__rustc__clang_rt.tsan_osx_dynamic.dylib:x86_64+0x9db3)
    #1 CAMutex::CAMutex(char const*) <null>:12141472 (libAudioToolboxUtility.dylib:x86_64+0x34c0)
    #2 cubeb_coreaudio::backend::create_default_audiounit::h7e4dc28ee4fadcef mod.rs:1230 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100034971)
    #3 cubeb_coreaudio::backend::create_audiounit::hce01e48e6257636b mod.rs:1132 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100033efa)
    #4 cubeb_coreaudio::backend::CoreStreamData::setup::h948c8371d105316e mod.rs:2679 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100048b2a)
    #5 _$LT$cubeb_coreaudio..backend..AudioUnitContext$u20$as$u20$cubeb_backend..traits..ContextOps$GT$::stream_init::h4af9b2f2531f7f0d mod.rs:2271 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100042911)
    #6 cubeb_backend::capi::capi_stream_init::h178991a295d21419 capi.rs:155 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10017ab50)
    #7 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::_$u7b$$u7b$closure$u7d$$u7d$::h3a124a47a2cd9f38 utils.rs:1072 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100105a2a)
    #8 cubeb_coreaudio::backend::tests::utils::test_ops_context_operation::hb152e938d324a359 utils.rs:1035 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000fb4d5)
    #9 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::hb658820b2f03c09a utils.rs:1056 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100100a67)
    #10 cubeb_coreaudio::backend::tests::tone::test_dial_tone::h4bcba1d01664f24e tone.rs:30 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10009b1be)
    #11 cubeb_coreaudio::backend::tests::tone::test_dial_tone::_$u7b$$u7b$closure$u7d$$u7d$::h7438cd72b6fce8a3 tone.rs:5 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000a9034)
    #12 core::ops::function::FnOnce::call_once::h3285cd6ea1ab5ae6 function.rs:227 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100143a69)
    #13 _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::heea29d305168cdf7 boxed.rs:922 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001c13ed)

  Thread T38 (tid=132677, running) created by main thread at:
    #0 pthread_create <null>:12141664 (lib__rustc__clang_rt.tsan_osx_dynamic.dylib:x86_64+0x8d4d)
    #1 std::sys::unix::thread::Thread::new::h181ead94dbcaa0ea thread.rs:67 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1002238d7)
    #2 std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h699c055986a2cff3 rt.rs:64 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001adc48)
    #3 std::panicking::try::do_call::h052d8578a7311cdc panicking.rs:296 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100221ca7)
    #4 main <null>:12141664 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100126f90)

  Thread T26 (tid=132681, running) created by thread T27 at:
    #0 pthread_create <null>:12141664 (lib__rustc__clang_rt.tsan_osx_dynamic.dylib:x86_64+0x8d4d)
    #1 HALB_IOThread::StartAndWaitForState(unsigned int) <null>:12141664 (CoreAudio:x86_64+0x24d4ae)
    #2 cubeb_coreaudio::backend::start_audiounit::haf5a1d345efb7ec6 mod.rs:1105 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100033349)
    #3 cubeb_coreaudio::backend::CoreStreamData::start_audiounits::h006a9faf9a067449 mod.rs:2456 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10004429e)
    #4 _$LT$cubeb_coreaudio..backend..AudioUnitStream$u20$as$u20$cubeb_backend..traits..StreamOps$GT$::start::_$u7b$$u7b$closure$u7d$$u7d$::h58fe8e659e0fd328 mod.rs:3429 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10012096e)
    #5 coreaudio_sys_utils::dispatch::create_closure_and_executor::closure_executer::h66b39f2d9a16f056 dispatch.rs:59 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001ad4a1)
    #6 __tsan::dispatch_callback_wrap(void*) <null>:12141664 (lib__rustc__clang_rt.tsan_osx_dynamic.dylib:x86_64+0x51651)
    #7 _dispatch_client_callout <null>:12141664 (libdispatch.dylib:x86_64+0x350d)
    #8 coreaudio_sys_utils::dispatch::sync_dispatch::h3688f39e312f3619 dispatch.rs:42 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001ad08f)
    #9 _$LT$cubeb_coreaudio..backend..AudioUnitStream$u20$as$u20$cubeb_backend..traits..StreamOps$GT$::start::h5b0f330a30cbf37f mod.rs:3428 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100055acb)
    #10 cubeb_backend::capi::capi_stream_start::h9e8a63fb7eb48d19 capi.rs:179 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10017adb0)
    #11 cubeb_coreaudio::backend::tests::interfaces::test_ops_stream_start::_$u7b$$u7b$closure$u7d$$u7d$::h8096bc7a1182b75e interfaces.rs:433 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10019c8f1)
    #12 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::_$u7b$$u7b$closure$u7d$$u7d$::h7a8b8b3497174fef utils.rs:1089 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100107233)
    #13 cubeb_coreaudio::backend::tests::utils::test_ops_context_operation::hba25cafc0a977080 utils.rs:1035 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000fc9a5)
    #14 cubeb_coreaudio::backend::tests::utils::test_ops_stream_operation::h912af3234c46df9d utils.rs:1056 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001003a7)
    #15 cubeb_coreaudio::backend::tests::interfaces::test_default_output_stream_operation::hcde1738d5a79fbd3 interfaces.rs:411 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001955c2)
    #16 cubeb_coreaudio::backend::tests::interfaces::test_ops_stream_start::h26f64f227d4149cb interfaces.rs:432 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1000f2d71)
    #17 cubeb_coreaudio::backend::tests::interfaces::test_ops_stream_start::_$u7b$$u7b$closure$u7d$$u7d$::h728669625071a2ad interfaces.rs:431 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x10019c844)
    #18 core::ops::function::FnOnce::call_once::h929a2f1e3c34cf33 function.rs:227 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x100145209)
    #19 _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::heea29d305168cdf7 boxed.rs:922 (cubeb_coreaudio-c4da6e229b8adc8d:x86_64+0x1001c13ed)

SUMMARY: ThreadSanitizer: data race mod.rs:3445 in _$LT$cubeb_coreaudio..backend..AudioUnitStream$u20$as$u20$cubeb_backend..traits..StreamOps$GT$::stop::h56d0fab4f1f92552
==================
test backend::tests::tone::test_dial_tone ... ok

test result: ok. 144 passed; 0 failed; 46 ignored; 0 measured; 0 filtered out

ThreadSanitizer: reported 1 warnings
Process 8952 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007fff644e37fa libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff644e37fa <+10>: jae    0x7fff644e3804            ; <+20>
    0x7fff644e37fc <+12>: movq   %rax, %rdi
    0x7fff644e37ff <+15>: jmp    0x7fff644dda89            ; cerror_nocancel
    0x7fff644e3804 <+20>: retq   
Target 0: (cubeb_coreaudio-c4da6e229b8adc8d) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007fff644e37fa libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff645a0bc1 libsystem_pthread.dylib`pthread_kill + 432
    frame #2: 0x00000001005e0625 lib__rustc__clang_rt.tsan_osx_dynamic.dylib`wrap_pthread_kill + 325
    frame #3: 0x00007fff6446aa1c libsystem_c.dylib`abort + 120
    frame #4: 0x000000010063ac86 lib__rustc__clang_rt.tsan_osx_dynamic.dylib`__sanitizer::Abort() + 70
    frame #5: 0x000000010063a654 lib__rustc__clang_rt.tsan_osx_dynamic.dylib`__sanitizer::Die() + 196
    frame #6: 0x00000001005f6143 lib__rustc__clang_rt.tsan_osx_dynamic.dylib`__tsan::finalize(void*) + 67
    frame #7: 0x00007fff64445446 libsystem_c.dylib`__cxa_finalize_ranges + 319
    frame #8: 0x00007fff6444571c libsystem_c.dylib`exit + 55
    frame #9: 0x00007fff6439c804 libdyld.dylib`start + 8

Boost the speed when opening multiple streams simultaneously

In the current C implementation, each time when the stream starts, we will first try locking the mutex within cubeb context to avoid racing with reinit/destroy/stop, then call stream-start.

In the current Rust implementation, each time when the stream starts, we will dispatch this operation to the same task queue where reinit/destroy/stop is on to avoid racing issues.

Starting a cubeb stream in both implementations above requires sharing a resource in its cubeb context to avoid racing issues. For this reason, when opening multiple streams (in same cubeb context) at the same time, the stream-start will be executed sequentially, while they could actually be run in parallel since they are not sharing data.

To boost the speed when opening multiple streams at the same time, we could

  1. either move the task queue for stream operations, serial_queue, from cubeb context to cubeb stream
  2. or use a dummy mutex, Mutex<()>, as the token to operate core_stream_data to avoid racing issues
    • Ideally we should just change core_stream_data to Mutex<CoreStreamData>, but it's likely to cause deadlocks
    • workaround for above deadlock: Using Mutex<()> for CoreStreamData
      • except callback thread, core_stream_data should only be changed within the thread that locks the a dummy mutex: Mutex<()>
      • to avoid racing with callback thread, just stop the AudioUnit in the right place. Stopping AudioUnit will acquire the same mutex inside AudioUnit that is used when it's data callback is run.

Both approaches can be implemented easily in the current Rust code. From my test, they give similar speeds. They are both around 6x faster than the current Rust implementation, when opening and starting 10 streams at the same time. For opening one stream at a time, the above approaches doesn't bring much benefit.

This problem is not urgent since (I believe) users don't often open multiple streams at the same time. We could fix this when this becomes a real issue. This is more like a note for now.

Make sure the input rate and the output rates are same if the stream is duplex

The cubeb.c disallows to create a duplex stream with different input rates and output rates. However, it's ok to do so in this crate:

https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/dce7ddc846fb4784b4452f6eda282b67d286e27d/src/backend/tests/interfaces.rs#L487-L499

Aligning the policy here and the policy used in the main cubeb repo makes more sense and causes less confusion. Otherwise, the reader may have different assumptions when reading the code.

A good first step is to add an assertion when initializing the stream.

Fire error callback when non-default output device is unplugged

Now we disable the automatic input device switching when the input device is unplugged. We will fire an error callback and enter an error state if this happens. However, we never monitor the alive status for output device. If the output device doesn't follow the default, then the stream will probably stop working without firing an error callback. Now the cubeb users rely on device-collection changes to know the device is gone.

To align with the policy we have for microphone switching, we should do the same for the output device.

Make mixer become an independent crate

The mixer crate is introduced in #23 to solve the BMO 1468381. The new mixer is able to mix audio from any input layout to any output layout.

The BMO 1368938: mixer only support pre-defined layout on Windows, is probably the same problem of BMO 1468381 so it is likely to be solved by adopting the new mixer on Windows.

Therefore, it's better to make the new mixer crate as an independent crate that can be used to other platforms and make it as a successor of cubeb_mixer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.