SEGV when using VMAF filter.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SEGV when using VMAF filter.

Kevin Wheatley
Hi,

I've just built a version of ffmpeg n4.0
from ace829cb45cff530b8a0aed6adf18f329d7a98f6 linked against libvmaf
ba5356cb41cf3b19ca0bb108bd8e86e9da402f94.

I notice when running commands similar to the examples in the FFmpeg
documentation:

ffmpeg -i test2.mov -i test3.mov -lavfi libvmaf -f null -

I get a segment fault:

(gdb) bt
#0  0x0000003eb4e08213 in pthread_join () from /lib64/libpthread.so.0
#1  0x000000000041a8cb in uninit () at libavfilter/vf_libvmaf.c:320
#2  0x00000000004c62f3 in avfilter_free () at libavfilter/avfilter.c:771
#3  0x00000000004c121c in avfilter_graph_free () at
libavfilter/avfiltergraph.c:126
#4  0x000000000049cd9c in init_complex_filtergraph ()
#5  0x0000000000499193 in ffmpeg_parse_options () at fftools/ffmpeg_opt.c:2046
#6  0x000000000048e078 in main () at fftools/ffmpeg.c:4788

looking at the code it looks like it is attempting to pthread_join()
before the vmaf_thread, has actually been created. This is backed up
by a quick and dirty hack, (if I check the variable is not NULL), I
can successfully run the filter with no problems, I'm not familiar
with the requirements for setting up filters in the code so I can't
say much more than that.

I note that a similar report was made
https://trac.ffmpeg.org/ticket/6865 but that was closed.

I'm happy to provide a patch if somebody could comment on the
appropriate method/pattern of behavior for creating and releasing
resources during the filte rgraph initialisation steps.

Thanks

Kevin

P.S. my quick hack.

diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c
index 42c6b66..e3eb182 100644
--- a/libavfilter/vf_libvmaf.c
+++ b/libavfilter/vf_libvmaf.c
@@ -317,7 +317,8 @@ static av_cold void uninit(AVFilterContext *ctx)
     pthread_cond_signal(&s->cond);
     pthread_mutex_unlock(&s->lock);

-    pthread_join(s->vmaf_thread, NULL);
+    if (s->vmaf_thread)
+      pthread_join(s->vmaf_thread, NULL);

     av_frame_free(&s->gref);
     av_frame_free(&s->gmain);
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: SEGV when using VMAF filter.

Carl Eugen Hoyos-2
2018-04-30 16:33 GMT+02:00, Kevin Wheatley <[hidden email]>:

> I note that a similar report was made
> https://trac.ffmpeg.org/ticket/6865 but that was closed.

Looks like ticket #6866 (which should have been easier
to find).

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: SEGV when using VMAF filter.

Kevin Wheatley


Sent on the go...

> On 30 Apr 2018, at 18:58, Carl Eugen Hoyos <[hidden email]> wrote:
>
> 2018-04-30 16:33 GMT+02:00, Kevin Wheatley <[hidden email]>:
>
>> I note that a similar report was made
>> https://trac.ffmpeg.org/ticket/6865 but that was closed.
>
> Looks like ticket #6866 (which should have been easier
> to find).

Indeed, I guess my search term found the other, which was enough for me to start unpicking the issue.

I've submitted a more correct patch to the dev list for comments.

Thanks

Kevin
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".