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 when setting dataToRespond #13

Open
ohthatsjhall opened this issue Jun 14, 2018 · 9 comments
Open

Crash when setting dataToRespond #13

ohthatsjhall opened this issue Jun 14, 2018 · 9 comments
Labels

Comments

@ohthatsjhall
Copy link

We have a live app that sees several crashes on line 170 in the CacePlayerItem.swift file.
I got a EXC_BAD_ACCESS error when trying to set dataToRespond. Any ways around this?

@neekeetab
Copy link
Owner

I couldn't reproduce the crash, unfortunately. Under what circumstances does this happen? Please provide steps to reproduce.

@ohthatsjhall
Copy link
Author

I've only been able to recreate the issue once, although it's happening frequently to our wider user base. The crash occurred when the view the video was playing on was instantiated. As mentioned earlier, the only crash reporting I received was a EXC_BAD_ACCESS on like 170. Thanks for looking into this @neekeetab

@neekeetab
Copy link
Owner

The problem is there's nothing special in line 170 and EXC_BAD_ACCESS doesn't tell much either.
FYI, CachingPlayerItem doesn't work well with large video files because the entire data is stored in RAM. Maybe the crashes you experience are because of you're out of memory at some point.

@vergilw
Copy link

vergilw commented Jan 24, 2019

@neekeetab
i have the same crash, line 158
let dataToRespond = songDataUnwrapped.subdata(in: Range(uncheckedBounds: (currentOffset, currentOffset + bytesToRespond)))

Thread 1: EXC_BAD_ACCESS (code=1, address=0x115be0040)

my video duration less than 60 seconds, it happened few times.
i think it's cause of "uncheckedBounds"
the better way is check this bound

@neekeetab
Copy link
Owner

@vergilw, please give a link to the video that reproduces the crash.

@vergilw
Copy link

vergilw commented Jan 25, 2019

@neekeetab it won't crash every times,
i think the problem is set new URL value to CachingPlayerItem when previous URL is not download finished. it didn't release some object. i'm not very sure

@ealeksandrov
Copy link

ealeksandrov commented Feb 17, 2019

I also have reports for EXC_BAD_ACCESS KERN_INVALID_ADDRESS on same line and it is hard to reproduce. In my case videos are played in collection view and reused while scrolling.

Videos are less than 10 sec. Crashlytics report for says Free Ram = 421.17 MiB.

Maybe it's related to assigning new CachingPlayerItem on cell reuse while old one is still downloading or in some intermediate state.

@neekeetab
Copy link
Owner

Thanks for the detailed description. I'll take a look at this with the reuse case in mind when I have time. If you find the cause, it would be awesome if you could make a PR.
@ealeksandrov

@ealeksandrov
Copy link

Sure I'll let you know if I found more details or concrete fix.

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

4 participants