ffmpeg-kit icon indicating copy to clipboard operation
ffmpeg-kit copied to clipboard

FFMpegKit crash with xHE-AAC

Open Tolriq opened this issue 2 years ago • 7 comments

Description FFmpegkit crash when trying to use xHE-AAC files (FFProbe for example)

Expected behavior It should not crash the app and just return an error

Current behavior The app crash

12:53:23.995 libc                    app.symfonik.music.player.debug      A  FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x7808cef028)
12:53:23.996 libc                    app.symfonik.music.player.debug      A  Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 12453 (RenderThread), pid 12366 (ic.player.debug)

Strangely there's no dump or anything more in logcat.

To Reproduce Try to use ffprobe on any of the mp4 file from https://www2.iis.fraunhofer.de/AAC/xhe-aac.html

Screenshots If applicable, add screenshots to help explain your problem.

Logs

12:53:23.995 libc                    app.symfonik.music.player.debug      A  FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x7808cef028)
12:53:23.996 libc                    app.symfonik.music.player.debug      A  Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 12453 (RenderThread), pid 12366 (ic.player.debug)

Environment

  • Platform: Android
  • Architecture: arm64-v8a
  • Version: 6.0.2
  • flutter doctor:
  • react-native info:

Other Add any other context about the problem here.

Tolriq avatar Nov 09 '23 11:11 Tolriq

@tanersener So after tons of time lost to try to understand WTF was happening on Android the issue are the few exit(1); still present in fftools_ffprobe.c those trigger the crash. You have removed most of them everywhere so I guess it's just a small forget.

Tolriq avatar Dec 18 '23 10:12 Tolriq

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Feb 17 '24 01:02 github-actions[bot]

Installé it's still to be fixed

Tolriq avatar Feb 17 '24 07:02 Tolriq

ffprobe 6.1.1 (linux, fedora, x86_64) outputs a bunch of stuff but mainly

[aac @ 0x7fbb1200f440] Audio object type 42 is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.

could this throw an error with toyr implementation ?

mathieu-aubin avatar Feb 17 '24 09:02 mathieu-aubin

No this is a bug in ffmpegkit when it encounters those errors it runs exit(1); that triggers the OS crash.

@tanersener knows that since most of the other exit() calls have been removed for this purpose, just 3 leftovers that are reached with those kind of media.

For example https://github.com/arthenica/ffmpeg-kit/blob/main/android/ffmpeg-kit-android-lib/src/main/cpp/fftools_ffprobe.c#L3387

Those must be exit_program to avoid the crash.

Tolriq avatar Feb 17 '24 09:02 Tolriq

Thanks a lot for reporting the bug and providing the fix @Tolriq. The fix is pushed to the development branch now.

tanersener avatar Apr 12 '24 23:04 tanersener