Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

[iOS] arm64 devices crash on ff_hscale_8_to_15_neon function with EXC_BAD_ACCESS #328

Closed
tanersener opened this issue Jan 25, 2020 · 7 comments

Comments

@tanersener
Copy link
Owner

tanersener commented Jan 25, 2020

FFmpeg operations fail with EXC_BAD_ACCESS on ff_hscale_8_to_15_neon function.

Screenshot 2020-01-25 at 09 31 22

All iOS devices with arm64 architecture (probably arm64e as well), running v4.3.1 and v4.3.1.LTS releases, are affected from this.

The crash is caused by ffmpeg commit bd831912712e32b8e78d409bfa7ea7e668ce4b42.

@tanersener
Copy link
Owner Author

This issue is fixed using the previous version of libswscale/aarch64/hscale.S file.

@alexcohn
Copy link
Contributor

does this problem apply to Android at all?

@tanersener
Copy link
Owner Author

I'm not sure. Unfortunately, I couldn't test it. I don't have a working arm64 Android device right now. So I'm using the same workaround for Android as well.

@alexcohn
Copy link
Contributor

Have you got a test case to prove it? I have some arm64 here to run such test. Also, the device is rather old, so if it works there, it will also work on more advanced devices.

@tanersener
Copy link
Owner Author

Yes, I do. It is pretty easy actually.

On iOS, it is possible to reproduce it using the test-application. If I test "mp4" encoding under the "Video" tab, library crashes with EXC_BAD_ACCESS.

I think the same scenario can be tested using the Android test app. Both Android/iOS applications use the same commands for encoding. So if the same bug is there, it will crash there too.

It'd be great if you can test this.

@alexcohn
Copy link
Contributor

If I test "mp4" encoding under the "Video" tab, library crashes with EXC_BAD_ACCESS.

I tested it on my Android arm64 device (BV-6000) and it a) works correctly, and b) I proved that this ff_hscale_8_to_15_neon function is actually called (an artificial div by 0 caused the expected crash).

So, I propose to mark this patch iOS only. After all, the claim on https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/bd831912712e32b8e78d409bfa7ea7e668ce4b42 is that this gives 25% improvement, which is not something one can dismiss lightheartedly.

@tanersener
Copy link
Owner Author

tanersener commented Mar 31, 2020

Thanks for testing this case. Yes, we can mark this patch iOS only. I will update android-ffmpeg.sh and remove the patch. This change will be included in the next Main release.

alexcohn added a commit to alexcohn/mobile-ffmpeg that referenced this issue May 11, 2020
also, avoid patching the src tree for issue tanersener#328
alexcohn added a commit to alexcohn/mobile-ffmpeg that referenced this issue May 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants