Bug 4340 - ffmpeg : Segmentation fault when streaming RTSP with ffserver (Always)
Summary: ffmpeg : Segmentation fault when streaming RTSP with ffserver (Always)
Status: RESOLVED UPSTREAM
Alias: None
Product: Fedora
Classification: Unclassified
Component: ffmpeg (show other bugs)
Version: 24
Hardware: armhfp GNU/Linux
: P1 major
Assignee: Dominik 'Rathann' Mierzejewski
URL:
Depends on:
Blocks:
 
Reported: 2016-11-18 08:55 CET by Sooman Jeong
Modified: 2016-11-22 09:02 CET (History)
4 users (show)

See Also:
namespace:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sooman Jeong 2016-11-18 08:55:10 CET
Package information : ffmpeg-3.1.5-1.fc24.armv7hnl

When I try to stream a video via ffserver, it always terminate with Setmentation fault due to NULL pointer access.

I run ffserver with following configuration.

#Server configuration
--------------------------------
HTTPPort 8090
HTTPBindAddress 0.0.0.0
RTSPPort 8091
RTSPBindAddress 0.0.0.0
MaxClients 1000
MaxBandwidth 10000
CustomLog -
<Feed feed1.ffm>
File /tmp/feed1.ffm
ACL Allow 127.0.0.1
</Feed>
<Stream test1.mp4>
Feed feed1.ffm
Format rtp
VideoFrameRate 30
VideoBitRate 5000
VideoSize 640x480
VideoQMin 3
VideoQMax 31
NoAudio
NoDefaults
</Stream>

And run ffmpeg in order to send video feed to server as follows.
# ffmpeg -f v4l2 -s 640x480 -r 30 -i /dev/video0 http://localhost:8090/feed1.ffm

Whenever I played this stream on remote PC, ffserver always terminates with Segmentation fault.


#GDB information
Program received signal SIGSEGV, Segmentation fault.
0xb5cf9e38 in memcpy (__len=<optimized out>, __src=<optimized out>,
    __dest=<optimized out>) at /usr/include/bits/string3.h:53
53        return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
(gdb) bt
#0  0xb5cf9e38 in memcpy (__len=<optimized out>, __src=<optimized out>,
    __dest=<optimized out>) at /usr/include/bits/string3.h:53
#1  av_freep (arg=0xc) at libavutil/mem.c:248
#2  0xb6182a86 in codec_parameters_reset (par=par@entry=0x0)
    at libavcodec/utils.c:4022
#3  0xb618876a in avcodec_parameters_from_context (par=0x0, codec=0x7f5f7900)
    at libavcodec/utils.c:4082
#4  0x7f5b9848 in prepare_sdp_description (stream=0x7f5f63c0,
    pbuffer=0xbea2db74, my_ip=...) at ffserver.c:2999
#5  0x7f5ba9e6 in rtsp_cmd_describe (
    url=0xbea2f8c4 "rtsp://12.23.66.28:8091/test1.mp4", c=0x7f600a00)
    at ffserver.c:3059
#6  rtsp_parse_request (c=0x7f600a00) at ffserver.c:2935
#7  0x7f5b2092 in handle_connection (c=0x7f600a00) at ffserver.c:1008
#8  http_server () at ffserver.c:777
#9  main (argc=<optimized out>, argv=<optimized out>) at ffserver.c:4032

Note that previous package version (3.0.4) has no problem to stream with same command.
Since this is critical issue, I'd like to request revert version of this package to previous one.

Thanks.
Comment 1 Nicolas Chauvet 2016-11-18 09:11:45 CET
Thx for reporting this issue.

This is indeed critical for you, but you can still revert back to your previous version. We also wish to have feedbacks earlier in our update proposal process.
So please consider using rpmfusion-free-updates-testing enabled to report back issue earlier if possible.

For now, please try to report upstream, if there is a fix for our current branch, we will consider a backport.
Comment 2 Sooman Jeong 2016-11-18 12:33:58 CET
Thanks for quick response.

Actually, I found same bug report on ffmpeg upstream.
https://trac.ffmpeg.org/ticket/5869

The call stack of the crash is exactly same with mine.
This bug was filed 7 weeks ago, and there's no comment during recent 7 weeks.

And I checked the same crash occurs with latest master tree of ffmpeg, which means
there are no patch to fix this issue for now.
I cannot estimate how long time will it take to fix this bug.
Hence, I'd like to strongly suggest you to rollback the rpm version to 3.0.x.

Thanks.
Comment 3 Nicolas Chauvet 2016-11-18 12:46:35 CET
(In reply to Sooman Jeong from comment #2)
> Thanks for quick response.
> 
> Actually, I found same bug report on ffmpeg upstream.
> https://trac.ffmpeg.org/ticket/5869
> 
> The call stack of the crash is exactly same with mine.
> This bug was filed 7 weeks ago, and there's no comment during recent 7 weeks.
The dev (cehoyos) also has requested which changes as introduced the issue.
It's not enough to say it's between 3.0x and 3.1x you may have to compile ffmpeg and use git bisect to identify the problematic change.

Unfortunately, none will make this work for you.
Comment 4 Sooman Jeong 2016-11-21 01:31:36 CET
> The dev (cehoyos) also has requested which changes as introduced the issue.
> It's not enough to say it's between 3.0x and 3.1x you may have to compile ffmpeg and > use git bisect to identify the problematic change.

From running git bisect, I found that below merge commit cause this issue.

commit 6f69f7a8bf6a0d013985578df2ef42ee6b1c7994
Merge: 60b7518 9200514
Author: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Date:   Sun Apr 10 20:58:15 2016 +0100

    Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
    
    * commit '9200514ad8717c63f82101dc394f4378854325bf':
      lavf: replace AVStream.codec with AVStream.codecpar
    
    This has been a HUGE effort from:
        - Derek Buitenhuis <derek.buitenhuis@gmail.com>
        - Hendrik Leppkes <h.leppkes@gmail.com>
        - wm4 <nfxjfg@googlemail.com>
        - Clément Bœsch <clement@stupeflix.com>
        - James Almer <jamrial@gmail.com>
        - Michael Niedermayer <michael@niedermayer.cc>
        - Rostislav Pehlivanov <atomnuker@gmail.com>

It seems there are some bugs on replacing AVStream.codec with AVStream.codecpar.
Now, is it possible to revert this merge commit on 3.1 branch and make another release version (e.g., 3.1.6)?
Comment 5 Nicolas Chauvet 2016-11-21 10:17:00 CET
(In reply to Sooman Jeong from comment #4)
> > The dev (cehoyos) also has requested which changes as introduced the issue.
> > It's not enough to say it's between 3.0x and 3.1x you may have to compile ffmpeg and > use git bisect to identify the problematic change.
> 
> From running git bisect, I found that below merge commit cause this issue.
...
> It seems there are some bugs on replacing AVStream.codec with
> AVStream.codecpar.
> Now, is it possible to revert this merge commit on 3.1 branch and make
> another release version (e.g., 3.1.6)?

Please ask upstream directly in the bug report. Thx
Comment 6 Sooman Jeong 2016-11-22 01:35:42 CET
Thanks, 
Bug Report for this issue on upstream : https://trac.ffmpeg.org/ticket/5869
Comment 7 Nicolas Chauvet 2016-11-22 09:01:42 CET
(In reply to Sooman Jeong from comment #6)
> Thanks, 
> Bug Report for this issue on upstream : https://trac.ffmpeg.org/ticket/5869

Upstream doesn't follow links, you need to report the information on "their bugtracker"
Comment 8 Nicolas Chauvet 2016-11-22 09:02:40 CET
closing this bug as there is an upstream report.
There is nothing that can be expected from us.