Crash in [@ coreaudio_sys_utils::dispatch::create_closure_and_executor::closure_executer]
Categories
(Core :: Audio/Video: cubeb, defect, P2)
Tracking
()
People
(Reporter: gsvelto, Assigned: chunmin)
References
(Blocks 1 open bug)
Details
(Keywords: crash)
Crash Data
This bug is for crash report bp-bb120d14-8edd-482b-94de-9eae20191109.
Top 10 frames of crashing thread:
0 XUL gkrust_shared::panic_hook mfbt/Assertions.h:332
1 XUL core::ops::function::Fn::call src/libcore/ops/function.rs:69
2 XUL std::panicking::rust_panic_with_hook src/libstd/panicking.rs:481
3 XUL std::panicking::begin_panic src/libstd/panicking.rs:411
4 XUL coreaudio_sys_utils::dispatch::create_closure_and_executor::closure_executer media/libcubeb/cubeb-coreaudio-rs/coreaudio-sys-utils/src/dispatch.rs:59
5 @0x7fff6644cdb7
6 @0x7fff66461216
7 @0x7fff66454165
8 @0x7fff66461f0c
9 @0x7fff66465d20
The raw crash reason is !self.core_stream_data.input_unit.is_null() || !self.core_stream_data.output_unit.is_null()
| Assignee | ||
Comment 1•6 years ago
•
|
||
I don't know the reason why the assertion is hit.
-
reinitcan be called, so one ofself.core_stream_data.input_unitandself.core_stream_data.output_unitis notnullwhen the cubeb stream was initialized. Otherwisereinit_asyncwouldn't be fired inaudiounit_input_callbackoraudiounit_property_listener_callback.audiounit_input_callbackwould be fire whenself.core_stream_data.input_unitis not null.audiounit_property_listener_callbackwould be fired when one or both ofself.core_stream_data.input_unitandself.core_stream_data.output_unitare set. -
Since
!self.core_stream_data.input_unit.is_null() || !self.core_stream_data.output_unit.is_null()wastrueat first (by 1), hitting that assertion means theCoreStreamData::closewas called before the assertion is hit.self.core_stream_data.input_unitandself.core_stream_data.output_unitwould only be reset tonullinCoreStreamData::close. -
The
CoreStreamData::closecan be fired from two places -
destroy_pendingwould betruebeforecloseis called.- If
destroy_pendingistrue, thenreinitwouldn't be executed. - In addition,
destroy_internalandreinitwould be run in the same task queue - By above,
reinitwouldn't be executed afterdestroyis called, so the assertion won't be hit if destroy task was executed.
-
- the
audiounit_property_listener_callbackwould be unregistered byuninstall_device_changed_callbackanduninstall_system_changed_callback. That is,reinitwouldn't be called fromaudiounit_property_listener_callbackanymore when devices are changed. - The active
AudioUnitwould be stopped inreinitat first, and wouldn't be started again since stream reinitializarion fails, soaudiounit_input_callbackwouldn't be called ifreinitfails. Soreinit_asyncwouldn't be fired inaudiounit_input_callbackifreinitfails. - By above, if
reinitfails, thenreinitwouldn't be called again, so the assertion won't be hit if previousreinitfailed.
- the
The above analysis is based on the code flow that should be run. Maybe the task dispatcher doesn't work in an expected way so something went wrong. I have no idea now.
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 2•5 years ago
|
||
There is a UAF found in cubeb-coreaudio-rs #48, which is possibly caused by doing stream-reinitialization after the stream is being destroyed.
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 3•5 years ago
|
||
No more crash in one month. Feel free to reopen it if the problem reappears.
Description
•