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

file descriptor leak #35

Closed
andrew-ld opened this issue Apr 27, 2021 · 5 comments
Closed

file descriptor leak #35

andrew-ld opened this issue Apr 27, 2021 · 5 comments
Assignees
Labels
android Affect Android platform bug Something isn't working fixed-in-v4.5 Fixed in release v4.5 library Affects the library v4.4 Affects v4.4 release

Comments

@andrew-ld
Copy link

andrew-ld commented Apr 27, 2021

Expected behavior
file should be closed

Current behavior
dont close files after command execution

To Reproduce
compile and install a debuggable application that use ffmpegkit

ex:
FFmpegKit.executeAsync("-hide_banner -y -f s16le -ar 16000 -i $pcmPath -ac 1 -c:a libvorbis -f ogg $oggPath")

now:
adb shell
run-as [package name]
lsof | grep [package name]

you will see that the input and output files remain open after command execution

Screenshots
Screenshot from 2021-04-27 15-05-29

^^leaked file descriptor

Environment

  • Platform: Android
  • Architecture: all
  • Version: 4.4 lts
  • Source branch: last commit (tanersener@46afc3f)
  • Android Studio version: 4.1.3
  • Android NDK version: 21.4.7075529
@tanersener tanersener added the needs-analysis We don't know that this is. It must be investigated further label Apr 27, 2021
@andrew-ld
Copy link
Author

@tanersener the same application using mobile-ffmpeg instead of ffmpegkit does not have this problem

@tanersener tanersener added the android Affect Android platform label Apr 27, 2021
@tanersener
Copy link
Collaborator

In ffmpeg-kit we have a native saf protocol implementation. That implementation changes how files are opened and closed. There might be a problem there. But, it must be analysed first. And lsof doesn't work on all devices. So, it is not an easy case to test.

@andrew-ld
Copy link
Author

you should run lsof using the user of the app using run-as

@tanersener tanersener self-assigned this Apr 28, 2021
@tanersener tanersener added bug Something isn't working and removed needs-analysis We don't know that this is. It must be investigated further labels Apr 28, 2021
@tanersener
Copy link
Collaborator

Thanks for reporting this issue. My tests confirm that there is a problem there. input and output files are not closed after the execution completes.

This issue originates from Scoped Stored PR of mobile-ffmpeg. I guess we missed this during the review. I'll look into this but it will take time to fix it.

@tanersener tanersener added v4.4 Affects v4.4 release LTS Affects LTS releases labels Apr 28, 2021
@tanersener
Copy link
Collaborator

Fixed in development.

@tanersener tanersener added this to To do in FFmpegKit 21.07 GA Release via automation Apr 30, 2021
@tanersener tanersener moved this from To do to Done in FFmpegKit 21.07 GA Release Apr 30, 2021
@tanersener tanersener added library Affects the library fixed-on-development Fixed on the development branch. Not released yet. and removed LTS Affects LTS releases labels May 1, 2021
@arthenica arthenica deleted a comment from github-actions bot Aug 31, 2021
@arthenica arthenica deleted a comment from github-actions bot Aug 31, 2021
@tanersener tanersener added fixed-in-v4.5 Fixed in release v4.5 and removed fixed-on-development Fixed on the development branch. Not released yet. labels Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Affect Android platform bug Something isn't working fixed-in-v4.5 Fixed in release v4.5 library Affects the library v4.4 Affects v4.4 release
Projects
No open projects
Development

No branches or pull requests

2 participants