Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRASH: MIKMIDIEventIterator can crash with EXC_BAD_ACCESS during MIKMIDISequencer playback #100

Closed
kris2point0 opened this issue Jun 30, 2015 · 1 comment
Labels
Milestone

Comments

@kris2point0
Copy link
Contributor

Setting a MIKMIDISequencer instance's sequence during playback can sometimes result in a crash in MIKMIDIEventIterator.

Thread 12 Crashed:: Dispatch queue: com.mixedinkey.SkyStage.MIKStudioMIDISequencer.0x61800019ce50
0   com.apple.audio.toolbox.AudioToolbox    0x00007fff9b3ef7e8 TrackIterator::Seek(double) + 44
1   com.apple.audio.toolbox.AudioToolbox    0x00007fff9b3ea1ff MusicEventIteratorSeek + 35
2   com.mixedinkey.MIKMIDI          0x000000010435cb4d -[MIKMIDIEventIterator seek:] + 42
3   com.mixedinkey.MIKMIDI          0x0000000104341626 -[MIKMIDITrack private_eventsOfClass:fromTimeStamp:toTimeStamp:] + 89
4   com.mixedinkey.MIKMIDI          0x0000000104356eb3 -[MIKMIDISequencer processSequenceStartingFromMIDITimeStamp:] + 2532
5   libdispatch.dylib               0x00007fff963c6c13 _dispatch_client_callout + 8
6   libdispatch.dylib               0x00007fff963d187e _dispatch_source_latch_and_call + 721
7   libdispatch.dylib               0x00007fff963ca62b _dispatch_source_invoke + 412
8   libdispatch.dylib               0x00007fff963ca154 _dispatch_queue_drain + 571
9   libdispatch.dylib               0x00007fff963cbecc _dispatch_queue_invoke + 202
10  libdispatch.dylib               0x00007fff963c96b7 _dispatch_root_queue_drain + 463
11  libdispatch.dylib               0x00007fff963d7fe4 _dispatch_worker_thread3 + 91
12  libsystem_pthread.dylib         0x00007fff92fbb637 _pthread_wqthread + 729
13  libsystem_pthread.dylib         0x00007fff92fb940d start_wqthread + 13

At this point, creating a new iterator in LLDB and attempting a seek has the same failure.

(lldb) expr MIKMIDIEventIterator *$i2 = [MIKMIDIEventIterator iteratorForTrack:self]
(lldb) po $i2
<MIKMIDIEventIterator: 0x6080000039b0>

(lldb) expr [$i2 seek:11.82]
error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x119ffffe0).
The process has been returned to the state before expression evaluation.

So far, I've only encoutered this in tracks that have 0 events. So for now, I'm going to attempt to workaround the issue in -[MIKMIDITrack private_eventsOfClass:fromTimeStamp:toTimeStamp:] by first checking if there are any events in the track.

kris2point0 added a commit that referenced this issue Jun 30, 2015
… processing queue as needed for improved thread safety. Deprecated MIKMIDIPlayer. Added possible workaround for Issue #100.
@armadsen armadsen modified the milestone: 1.1 Jul 6, 2015
@armadsen
Copy link
Member

This seems to be effectively prevented by the workaround in cb30667. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants