avconv stops with segmentation fault

Started by orinoco, 2014/05/28, 04:08:33

Previous topic - Next topic

orinoco

Hello,

since a year I use avconv to convert vdr-recordings to mp4-files. Since a week or maybe two I see that avconv sometimes stops the conversion with a segmentation fault.

I found some bugtracking websites dealing with a similiar problem. The solution was to recompile the libav-tools package with different compiler-flags. I'm not sure if this is nessassary for my libav-tools installation:

LANG=c apt-cache policy libav-tools
libav-tools:
  Installed: 6:10.1-1
  Candidate: 6:10.1-1
  Version table:
*** 6:10.1-1 0
        500 http://http.debian.net/debian/ unstable/main amd64 Packages
        100 /var/lib/dpkg/status


Can somebody confirm this behavior? Is the package affected by this compiler-flag issue?

orinoco

It's getting worser.

Now dvbcut stops allways with a segmentation fault right after exporting the current stream. Another program that depends on libav.

I'm clueless. I tested with memtest und mprime to make sure my hardware is okay. No fault during the tests.

I can repeat the dvbcut segmentation fault with my fresh siduction installed notebook.



orinoco

Maybe it helps. This is the last message from avconv before stopping

*** Error in `avconv': realloc(): invalid next size: 0x0000000000d8d730 ***

orinoco

Meanwhile I reinstalled my computer with latest siduction but the problem is not solved. Dvbcut crashes with a segmentation fault while exporting a stream and avconvons crashes with the realloc-message during encoding to mp4.


To make sure, that my hardware is okay, I installed Wheezy on another partition. And it works flawless. In this environment my toolchain dvbcut and avconv works like a charm.


Any help to track down the problem is appreciated.

melmarker

simply wait until libav works as good and stable as ffmpeg - but this will take an certain amout of time, debugging and development - sorry. I'm bitten by this too for a year.
Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. (Benjamin Franklin, November 11, 1755)
Never attribute to malice that which can be adequately explained by stupidity. (Hanlons razor)

orinoco

The latested d-u brings new versions of libav-stuff. I was exited to see if my problems are gone.

orinoco@jake:~$ gdb dvbcut
GNU gdb (Debian 7.7.1-2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from dvbcut...(no debugging symbols found)...done.
(gdb) start
Function "main" not defined.
Make breakpoint pending on future shared library load? (y or [n])
Starting program: /usr/bin/dvbcut
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffdb134700 (LWP 13797)]
Object::connect: No such signal org::freedesktop::UPower::DeviceAdded(QString)
Object::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QString)
Analyzed transport stream, 0 bytes of initial data (IRC=-1)
Using 188-byte packets
PAT: found PMT at pid 132
PMT: found video stream at pid 3101
PMT: found audio stream at pid 3102
PMT: found audio stream at pid 3103
PMT: found audio stream at pid 3106
kfilemodule(13438): couldn't create slave: "Aufruf des Ein-/Ausgabemoduls nicht möglich.
klauncher meldet: Unbekanntes Protokoll ,,".
"
kfilemodule(13438): couldn't create slave: "Aufruf des Ein-/Ausgabemoduls nicht möglich.
klauncher meldet: Unbekanntes Protokoll ,,".
"
kfilemodule(13438): couldn't create slave: "Aufruf des Ein-/Ausgabemoduls nicht möglich.
klauncher meldet: Unbekanntes Protokoll ,,".
"
Max. input bitrate of 12325 kbps detected at 01:43:28.920/00
kfilemodule(13438): couldn't create slave: "Aufruf des Ein-/Ausgabemoduls nicht möglich.
klauncher meldet: Unbekanntes Protokoll ,,".
"
kfilemodule(13438): couldn't create slave: "Aufruf des Ein-/Ausgabemoduls nicht möglich.
klauncher meldet: Unbekanntes Protokoll ,,".
"
kfilemodule(13438): couldn't create slave: "Aufruf des Ein-/Ausgabemoduls nicht möglich.
klauncher meldet: Unbekanntes Protokoll ,,".
"

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff69ab5b1 in av_buffer_unref () from /usr/lib/x86_64-linux-gnu/libavutil.so.53
(gdb) next
Single stepping until exit from function av_buffer_unref,
which has no line number information.
[Thread 0x7fffdb134700 (LWP 13797) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)


In the evening I will test avconv too, but I don't expect any positive result. It's really annoying.

der_bud

A probably matching bugreport (regarding dvbcut and av_buffer_unref segfaulting) could be this one: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=753347
Note the private repo with a patched dvbcut in Message #10 (but be aware of "NO support when using 3rd party repos", you know that ;))
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.

orinoco

#7
@der_bud


Thank you very much for the link. It work's very well.


During the weekend I had time to test avconv. The problem stays the same.


orinoco@jake:~/Temp/$ gdb avconv
GNU gdb (Debian 7.7.1-2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from avconv...(no debugging symbols found)...done.
(gdb) r -y -i "video.m2v" -i "audio.mp2" -aspect 16:9 -r 25 -threads auto -strict experimental -c:v libx264 -preset veryslow -tune film -crf 23 -c:a aac -aq 5 result.mp4
Starting program: /usr/bin/avconv
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
avconv version 10.2-6:10.2-2, Copyright (c) 2000-2014 the Libav developers
  built on Jul 20 2014 19:01:23 with gcc 4.9 (Debian 4.9.1-1)
[mpegvideo @ 0x653a80] max_analyze_duration reached
[mpegvideo @ 0x653a80] Estimating duration from bitrate, this may be inaccurate                                                     
Input #0, mpegvideo, from 'video.m2v':
  Duration: 00:27:01.12, bitrate: 7855 kb/s
    Stream #0.0: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 64:45 DAR 16:9], 7856 kb/s, 25 fps, 25 tbn, 50 tbc
[mp3 @ 0x658900] max_analyze_duration reached
[mp3 @ 0x658900] Estimating duration from bitrate, this may be inaccurate                                                           
Guessed Channel Layout for  Input Stream #1.0 : stereo                                                                             
Input #1, mp3, from 'audio.mp2':
  Duration: 00:29:36.26, start: 0.000000, bitrate: 192 kb/s
    Stream #1.0: Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s
[New Thread 0x7fffe869e700 (LWP 4995)]
[New Thread 0x7fffe7e9d700 (LWP 4996)]
[New Thread 0x7fffe769c700 (LWP 4997)]
[New Thread 0x7fffe6e9b700 (LWP 4998)]
[New Thread 0x7fffe669a700 (LWP 4999)]
[New Thread 0x7fffe5e99700 (LWP 5000)]
[New Thread 0x7fffe5698700 (LWP 5001)]
[New Thread 0x7fffe4e97700 (LWP 5002)]
[New Thread 0x7fffe4696700 (LWP 5003)]
[New Thread 0x7fffe3e95700 (LWP 5004)]
[New Thread 0x7fffe3694700 (LWP 5005)]
[New Thread 0x7fffe2e93700 (LWP 5006)]
[New Thread 0x7fffe2692700 (LWP 5007)]
[New Thread 0x7fffe1e91700 (LWP 5008)]
[libx264 @ 0x69b0c0] using SAR=64/45
[libx264 @ 0x69b0c0] using cpu capabilities: MMX2 SSE2Fast LZCNT
[New Thread 0x7fffe1690700 (LWP 5009)]
[New Thread 0x7fffe0e8f700 (LWP 5010)]
[New Thread 0x7fffe068e700 (LWP 5011)]
[New Thread 0x7fffdfe8d700 (LWP 5012)]
[New Thread 0x7fffdf68c700 (LWP 5014)]
[New Thread 0x7fffdee8b700 (LWP 5015)]
[New Thread 0x7fffde68a700 (LWP 5016)]
[New Thread 0x7fffdde89700 (LWP 5017)]
[New Thread 0x7fffdd688700 (LWP 5018)]
[New Thread 0x7fffd9222700 (LWP 5019)]
[libx264 @ 0x69b0c0] profile High, level 4.0
[libx264 @ 0x69b0c0] 264 - core 142 r2431 a5831aa - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=16 deblock=1:-1:-1 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.15 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-3 threads=9 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=8 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[New Thread 0x7fffd8a21700 (LWP 5020)]
[New Thread 0x7fffd8220700 (LWP 5021)]
[New Thread 0x7fffd7a1f700 (LWP 5022)]
[New Thread 0x7fffd721e700 (LWP 5023)]
[New Thread 0x7fffd6a1d700 (LWP 5024)]
[New Thread 0x7fffd621c700 (LWP 5025)]
[New Thread 0x7fffd5a1b700 (LWP 5026)]
Output #0, mp4, to 'result.mp4':
  Metadata:
    title           :
    encoder         : Lavf55.12.0
    Stream #0.0: Video: libx264, yuv420p, 720x576 [PAR 64:45 DAR 16:9], q=-1--1, 25 tbn, 25 tbc
    Stream #0.1: Audio: aac, 48000 Hz, stereo, fltp, 200 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> libx264)
  Stream #1:0 -> #0:1 (mp2 -> aac)
Press ctrl-c to stop encoding
[New Thread 0x7fffd521a700 (LWP 5027)]
[New Thread 0x7fffd4a19700 (LWP 5028)]
*** Error in `/usr/bin/avconv': realloc(): invalid next size: 0x00000000006903b0 ***


Program received signal SIGABRT, Aborted.
0x00007ffff5309407 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) next
Single stepping until exit from function raise,
which has no line number information.
[Thread 0x7fffd721e700 (LWP 5023) exited]
[Thread 0x7fffd7a1f700 (LWP 5022) exited]
[Thread 0x7fffd5a1b700 (LWP 5026) exited]
[Thread 0x7fffd8a21700 (LWP 5020) exited]
[Thread 0x7fffd6a1d700 (LWP 5024) exited]
[Thread 0x7fffdee8b700 (LWP 5015) exited]
[Thread 0x7fffdfe8d700 (LWP 5012) exited]
[Thread 0x7fffe068e700 (LWP 5011) exited]
[Thread 0x7fffe0e8f700 (LWP 5010) exited]
[Thread 0x7fffdde89700 (LWP 5017) exited]
[Thread 0x7fffe1e91700 (LWP 5008) exited]
[Thread 0x7fffd521a700 (LWP 5027) exited]
[Thread 0x7fffe2692700 (LWP 5007) exited]
[Thread 0x7fffe3694700 (LWP 5005) exited]
[Thread 0x7fffe3e95700 (LWP 5004) exited]
[Thread 0x7fffd621c700 (LWP 5025) exited]
[Thread 0x7fffdf68c700 (LWP 5014) exited]
[Thread 0x7fffdd688700 (LWP 5018) exited]
[Thread 0x7fffe4e97700 (LWP 5002) exited]
[Thread 0x7fffe5698700 (LWP 5001) exited]
[Thread 0x7fffde68a700 (LWP 5016) exited]
[Thread 0x7fffd9222700 (LWP 5019) exited]
[Thread 0x7fffe5e99700 (LWP 5000) exited]
[Thread 0x7fffe6e9b700 (LWP 4998) exited]
[Thread 0x7fffe769c700 (LWP 4997) exited]
[Thread 0x7fffe7e9d700 (LWP 4996) exited]
[Thread 0x7ffff7fad900 (LWP 4987) exited]
[Thread 0x7fffd8220700 (LWP 5021) exited]
[Thread 0x7fffe2e93700 (LWP 5006) exited]
[Thread 0x7fffd4a19700 (LWP 5028) exited]
[Thread 0x7fffe4696700 (LWP 5003) exited]
[Thread 0x7fffe669a700 (LWP 4999) exited]
[Thread 0x7fffe869e700 (LWP 4995) exited]


Program terminated with signal SIGABRT, Aborted.
The program no longer exists.
(gdb)

orinoco

Quote from: melmarker on 2014/07/12, 12:43:55
simply wait until libav works as good and stable as ffmpeg - but this will take an certain amout of time, debugging and development - sorry. I'm bitten by this too for a year.

Better. ffmpeg is back and guess what? My encoding problems are gone. *Shaka*