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 : AVAudioPlayer(AVAudioPlayerPriv) finishedPlaying: #1561

Closed
CheemaAneet opened this issue Jul 17, 2018 · 4 comments
Closed

Crash : AVAudioPlayer(AVAudioPlayerPriv) finishedPlaying: #1561

CheemaAneet opened this issue Jul 17, 2018 · 4 comments

Comments

@CheemaAneet
Copy link

**Mapbox Navigation SDK version:**0.18.1

This seems to be a dup of #1160 and seems to be occuring if the NavigationViewController is closed while a navigation session is underway and a voice instruction is being played at that time. Although not consistently reproducible(coz most times the same sequence of steps don't end up causing this), but I have seen this atleast twice in recent times.

Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x1834fc910 objc_msgSend + 16
1 AVFAudio 0x189c814f4 -[AVAudioPlayer(AVAudioPlayerPriv) finishedPlaying:] + 92
2 Foundation 0x184d7a0ec __NSThreadPerformPerform + 340
3 CoreFoundation 0x1842d7404 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24
4 CoreFoundation 0x1842d6c2c __CFRunLoopDoSources0 + 276
5 CoreFoundation 0x1842d479c __CFRunLoopRun + 1204
6 CoreFoundation 0x1841f4da8 CFRunLoopRunSpecific + 552
7 GraphicsServices 0x1861d9020 GSEventRunModal + 100
8 UIKit 0x18e211758 UIApplicationMain + 236
9 RelayHealth 0x10502b508 main (main.m:16)
10 libdyld.dylib 0x183c85fc0 start + 4

@CheemaAneet
Copy link
Author

Any thoughts on whats causing this ?

@bsudekum
Copy link
Contributor

bsudekum commented Jul 19, 2018

All I can find is https://stackoverflow.com/a/15325328/1522419 but I'm not really convinced nilling out the delegate should be necessary.

Update: it might be worth trying. Hard to know though if it's working if we can't reproduce.

@mapbox/navigation-ios anyone have any thoughts here? @CheemaAneet how often are you seeing the crash? I've really only seen this crash happen once.

@CheemaAneet
Copy link
Author

CheemaAneet commented Jul 20, 2018

@bsudekum Yeah I know its a weird one to reproduce, this happened to us twice in a very short space of time and never after that. I am not sure of the steps exactly, all I know is that I tried to close the nav controller while a voice instruction was being played and this happened.

I believe there's some weird scenario thats causing the AVPlayer notification to be sent to an already deallocated instance even though you are cleaning up the observers as i can see, I can only say cleaning up the delegate seems to be your best bet in this case.

@akitchen
Copy link
Contributor

Note that the audio player’s delegate is declared with assign in Objective-C. Therefore a dangling pointer is quite likely, although I haven’t read the crash report since I’m currently on mobile. I would recommend setting it to nil when tearing down.

https://developer.apple.com/documentation/avfoundation/avaudioplayer/1387134-delegate?changes=_5&language=objc

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

No branches or pull requests

3 participants