dwbuiten / FFmpeg

mirror of git://git.videolan.org/ffmpeg.git
http://ffmpeg.org
Other
0 stars 1 forks source link

ffserver segfault #3 #34

Closed michaelni closed 8 years ago

michaelni commented 8 years ago

valgrind ./ffserver_g -f tickets/1986/ffserver.conf ./ffmpeg -i rtsp://localhost:8554/h264-cut.mkv

conf file inline at: mkv file is attached at: https://trac.ffmpeg.org/ticket/1986

tickets/1986/ffserver.conf:1: Port option is deprecated. Use HTTPPort instead. tickets/1986/ffserver.conf:3: BindAddress option is deprecated. Use HTTPBindAddress instead. tickets/1986/ffserver.conf:8: NoDaemon option has no effect. You should remove it. Fri Apr 8 15:31:45 2016 Opening feed file 'tickets/1986/h264-cut.mkv' for stream 'h264-cut.mkv' Fri Apr 8 15:31:46 2016 FFserver started. ==12609== Use of uninitialised value of size 8 ==12609== at 0x5E0800: ff_rtp_get_payload_type (rtp.c:106) ==12609== by 0x570C09: ff_sdp_write_media (sdp.c:732) ==12609== by 0x570FDF: av_sdp_create (sdp.c:793) ==12609== by 0x420C6D: prepare_sdp_description (ffserver.c:3003) ==12609== by 0x420F2A: rtsp_cmd_describe (ffserver.c:3057) ==12609== by 0x420829: rtsp_parse_request (ffserver.c:2935) ==12609== by 0x41A971: handle_connection (ffserver.c:1008) ==12609== by 0x41A046: http_server (ffserver.c:777) ==12609== by 0x423733: main (ffserver.c:4027) ==12609== ==12609== Invalid read of size 4 ==12609== at 0x5E0800: ff_rtp_get_payload_type (rtp.c:106) ==12609== by 0x570C09: ff_sdp_write_media (sdp.c:732) ==12609== by 0x570FDF: av_sdp_create (sdp.c:793) ==12609== by 0x420C6D: prepare_sdp_description (ffserver.c:3003) ==12609== by 0x420F2A: rtsp_cmd_describe (ffserver.c:3057) ==12609== by 0x420829: rtsp_parse_request (ffserver.c:2935) ==12609== by 0x41A971: handle_connection (ffserver.c:1008) ==12609== by 0x41A046: http_server (ffserver.c:777) ==12609== by 0x423733: main (ffserver.c:4027) ==12609== Address 0x4 is not stack'd, malloc'd or (recently) free'd ==12609== ==12609== ==12609== Process terminating with default action of signal 11 (SIGSEGV) ==12609== Access not within mapped region at address 0x4 ==12609== at 0x5E0800: ff_rtp_get_payload_type (rtp.c:106) ==12609== by 0x570C09: ff_sdp_write_media (sdp.c:732) ==12609== by 0x570FDF: av_sdp_create (sdp.c:793) ==12609== by 0x420C6D: prepare_sdp_description (ffserver.c:3003) ==12609== by 0x420F2A: rtsp_cmd_describe (ffserver.c:3057) ==12609== by 0x420829: rtsp_parse_request (ffserver.c:2935) ==12609== by 0x41A971: handle_connection (ffserver.c:1008) ==12609== by 0x41A046: http_server (ffserver.c:777) ==12609== by 0x423733: main (ffserver.c:4027) ==12609== If you believe this happened as a result of a stack ==12609== overflow in your program's main thread (unlikely but ==12609== possible), you can try to increase the size of the ==12609== main thread stack using the --main-stacksize= flag. ==12609== The main thread stack size used in this run was 8388608. ==12609== ==12609== HEAP SUMMARY: ==12609== in use at exit: 195,646 bytes in 2,728 blocks ==12609== total heap usage: 3,051 allocs, 323 frees, 3,343,894 bytes allocated ==12609== ==12609== LEAK SUMMARY: ==12609== definitely lost: 0 bytes in 0 blocks ==12609== indirectly lost: 0 bytes in 0 blocks ==12609== possibly lost: 0 bytes in 0 blocks ==12609== still reachable: 195,646 bytes in 2,728 blocks ==12609== suppressed: 0 bytes in 0 blocks ==12609== Rerun with --leak-check=full to see details of leaked memory

ghost commented 8 years ago

We'll leave it to the ffserver maintainer to fix this after merge.

Nevcairiel commented 8 years ago

I cannot test ffserver (or even build for some dependecy reason), but does this help? http://pastebin.com/DCMgH0Va

michaelni commented 8 years ago

segfault is fixed but it seems not to work

valgrind ./ffserver_g -f ~/tickets/1986/ffserver.conf ... /home/michael/tickets/1986/ffserver.conf:1: Port option is deprecated. Use HTTPPort instead. /home/michael/tickets/1986/ffserver.conf:3: BindAddress option is deprecated. Use HTTPBindAddress instead. /home/michael/tickets/1986/ffserver.conf:8: NoDaemon option has no effect. You should remove it. Fri Apr 8 19:25:32 2016 Opening feed file '/home/michael/tickets/1986/h264-cut.mkv' for stream 'h264-cut.mkv' Fri Apr 8 19:25:32 2016 FFserver started. Fri Apr 8 19:25:45 2016 [matroska,webm @ 0x12b40d00]Read error Fri Apr 8 19:25:45 2016 [matroska,webm @ 0x12b40d00]Read error Fri Apr 8 19:25:45 2016 [matroska,webm @ 0x12b40d00]Read error Fri Apr 8 19:25:45 2016 127.0.0.1:13490 - - "PLAY h264-cut.mkv/streamid=0 RTP/UDP" Fri Apr 8 19:25:45 2016 [rtp @ 0x12a10120]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead. Fri Apr 8 19:25:45 2016 [rtp @ 0x12a10120]Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly Fri Apr 8 19:25:45 2016 127.0.0.1 - - [TEARDOWN] "rtsp://localhost:8554/h264-cut.mkv/ RTSP/1.0" 200 756


./ffmpeg -i rtsp://localhost:8554/h264-cut.mkv [tcp @ 0x37a5a20] Connection to tcp://localhost:8554?timeout=0 failed (Connection refused), trying next address Input #0, rtsp, from 'rtsp://localhost:8554/h264-cut.mkv': Metadata: title : No Title Duration: N/A, bitrate: N/A Stream #0:0: Data: none At least one output file must be specified


the previous ffserver and codecpar ffmpeg output looks like this: /home/michael/tickets/1986/ffserver.conf:1: Port option is deprecated, use HTTPPort instead /home/michael/tickets/1986/ffserver.conf:3: BindAddress option is deprecated, use HTTPBindAddress instead /home/michael/tickets/1986/ffserver.conf:8: NoDaemon option has no effect, you should remove it Fri Apr 8 19:29:44 2016 Opening feed file '/home/michael/tickets/1986/h264-cut.mkv' for stream 'h264-cut.mkv' Fri Apr 8 19:29:44 2016 FFserver started. Fri Apr 8 19:29:51 2016 [matroska,webm @ 0x21d3f40]Read error Fri Apr 8 19:29:51 2016 [matroska,webm @ 0x21d3f40]Read error Fri Apr 8 19:29:51 2016 [matroska,webm @ 0x21d3f40]Read error Fri Apr 8 19:29:51 2016 127.0.0.1:21710 - - "PLAY h264-cut.mkv/streamid=0 RTP/UDP" Fri Apr 8 19:29:52 2016 127.0.0.1 - - [TEARDOWN] "rtsp://localhost:8554/h264-cut.mkv/ RTSP/1.0" 200 904


[tcp @ 0x2d56a20] Connection to tcp://localhost:8554?timeout=0 failed (Connection refused), trying next address Input #0, rtsp, from 'rtsp://localhost:8554/h264-cut.mkv': Metadata: title : No Title Duration: N/A, start: 0.160000, bitrate: N/A Stream #0:0: Video: h264 (High), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn At least one output file must be specified

Nevcairiel commented 8 years ago

I don't know how it works at all, so not sure about that, but if it fixes the crash I'm going to apply it at least. Streams should have a valid codecpar.

dwbuiten commented 8 years ago

Fixed,