heroku-buildpack-ffmpeg-latest icon indicating copy to clipboard operation
heroku-buildpack-ffmpeg-latest copied to clipboard

Can segfault on heroku-22

Open jrochkind opened this issue 1 year ago • 0 comments

Hi, on the heroku-22 stack, using ffmpeg/ffprobe via this buildpack, operations that access input over a URL can cause a segfault.

Here are some example commands you could run in a heroku run bash to cause a segfault on heroku-22

ffprobe https://scih-data-dev.s3.amazonaws.com/test_video/SampleVideo_360x240_1mb.mp4

ffmpeg -i https://scih-data-dev.s3.amazonaws.com/test_video/SampleVideo_360x240_1mb.mp4 converted.ogg

According to a heroku staff person commenting on a public issue on an official heroku buildpack that also provides ffmpeg (and also currently segfaults), which you can see here:

This is not specific to Heroku-22; there are several reports on several of these third-party builds of FFMPEG (which the buildpack you mentioned uses) of segfaults with Ubuntu 22.04 in other environments, e.g. GitHub Actions.

The cause is the static linking of glibc - this can break DNS lookups via NSS, which is still used via dlopen() internally unless --enable-static-nss is used, but all of this static linking comes with a ton of pitfalls, which is why the new builds in this PR use dynamic linking.

So this might be hard to resolve.

But if this is a known problem in general with the static builds of ffmpeg and ubuntu 22.... I wonder if the upstream provider of static builds of ffmpeg is aware/working on it, if perhaps there are new static builds available which work better on ubuntu 22?

Or, I'm not sure if it's feasible to try to provide a ffmpeg buildpack using dynamic builds.

Anyway, I'm filing this to, at the least, leave a record of these problems for anyone else who may encounter them.

jrochkind avatar Mar 01 '23 16:03 jrochkind