← Back to team overview

desktop-packages team mailing list archive

[Bug 1518456] [NEW] avconv and ffmpeg keep crashing on segmentation fault because of pulseaudio

 

Public bug reported:

Hi, in spite of the course of years, and that several people have
reported this random error, it keeps happening both in avconv and
ffmpeg, in DIFFERENT versions of Ubuntu, DIFFERENT versions of both
avconv and ffmpeg, DIFFERENT computers (I'll give you my details at the
end, though).

I suggest that both avconv  and ffmpeg should be MORE VERBOSE IN
SITUATIONS LIKE THE NEXT ONE, and try to manage exceptions so we can all
contribute to problems like the following:

SEGMENTATION FAULT IN THIS COMMAND:
 avconv -f alsa -ar 22050 -i default   some_output.mp3

Or the same:
 avconv -f alsa -ar 22050 -i default  -ac 1 -acodec adpcm_swf consec_1.mp3
 avconv -f alsa -ar 22050 -i default  -ac 1 consec_1.mp3
 avconv -f alsa -ar 22050 -i default consec_1.mp3
 avconv -f alsa -i default consec_1.mp3
-----------

THE WAY TO STOP AND TEMPORARILY FIX the instantaneous "segmentation fault", was to do:
pulseaudio --kill
pulseaudio --start
---------------

It can be hard for developers of both packages to reproduce this error,
but it is STILL real, and it will NOT disappear "accidentally with the
next version", as some comments have suggested in other similar reports
of similar bugs, and even in the .crash file that mentions libraries
that have nothing to do with the avconv or ffmpeg program.


You will find in the next URL the output and command of the program avconv:
http://investigacionyprogramacion.com/solicitudes/bugs_avconv_segmentation_fault//initial_messages.txt
I show one command there, ALTHOUGH IT OCCURS WITH SEVERAL OTHER COMMANDS BESIDES THE ONE I SHOW IN THIS URL,  AS SHOWN BELOW IN THE SECTION OF "REFERENCES", IN THIS POST.

In the above URL the expected behavior was, instead of "segmentation fault", the following message that occurs normally:
--------------------                                                                                                                                           
[alsa @ 0x23faea0] capture with some ALSA plugins, especially dsnoop, may hang.
Segmentation fault (core dumped)

[alsa @ 0x1bd6ea0] All info found    --->THIS LINE SHOULD HAVE FOLLOWED, instead of "segmentation fault"
[alsa @ 0x1bd6ea0] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for  Input Stream #0.0 : stereo 
-------------------------

The output of the very same command, when it worked, after restarting pulseaudio:
http://investigacionyprogramacion.com/solicitudes/bugs_avconv_segmentation_fault//messages_when_successful.txt


You will find in the next URL the core-dumped file, as found in /var/crash/ ; THERE you will fin a more complex command, involving also video grabbing, but in this case I was able to isolate the problem to only an audio problem. However, I insist on making avconv/ffmpeg more verbose and cautious for these exceptions, and a more helpful dumping for these cases. Pulseaudio needs revision also; grab in mind that skype sometimes "plays around" with the sound settings in the systems. Another thing you guys could do, if you are so kind, could be to internally compare "video and sound settings the last time avconv/ffmpeg worked, compared to now", maybe it might help, and of course, a far better logging of errors than depending on the things being recorded in /var/crash, such as this file:

http://investigacionyprogramacion.com/solicitudes/bugs_avconv_segmentation_fault//_usr_bin_avconv.1000.crash


----------------------------------------------
FINAL NOTE:
-----------------------------------------------
As I've mentioned, this bug is NOT a problem only of current Ubuntu version, nor avconv or ffmpeg only. It has been there FOR YEARS, and repetitively it occurs over and over, although in a random fashion. Despite it's hard-to-reproduce behavior, there are patterns: it happens MORE frequently when we have a long user-session in Ubuntu, and SOMETIMES when we restart, it disappears; other times it disappears when we close a RAM-demanding software such as the web-browsers (we all know that web-browsers have the problem of being very RAM consuming); other times it is reduced by reducing the framerate of the video being captured, or the audiorate being captured. In all these actions the pattern is: to demand less CPU and RAM, it MIGHT REDUCE (never eliminate for sure) the frequency of the problem. For your diagnose, you might consider if it is  racing condition of the speed of writing in the hard disk, and also taking into account the possibility of controlling the memory used by libraries of both programs. I've seen this behavior in several versions of both FFMPEG and AVCONV since at least 2012 to 2015. It won't disappear magically, as suggested in some forums. 

Only if we all penetrate in the problem we will be able to help this
awesome set of software to be more reliable. I suggest to escalate this
issue to one of the most importance, no matter its difficulty to
reproduce the problem.


----------------------------------------------------
My details [please look the FINAL NOTE]

lsb_release -rd
Description:    Ubuntu 14.10
Release:        14.10

You will allso find useful some details:
It happens both with CPU of more than 2 GHz and 880MHz.
And it happens in 2Gigabyte RAM.

Some of the packages in which the behavior has been detected:
*avconv version 11-6:11-1, Copyright (c) 2000-2014 the Libav developers
  built on Sep 26 2014 14:36:31 with gcc 4.9.1 (Ubuntu 4.9.1-15ubuntu1)

*ffmpeg version 2.5 Copyright (c) 2000-2014 the FFmpeg developers
  built on Dec 13 2014 10:21:59 with gcc 4.9.1 (Ubuntu 4.9.1-16ubuntu6)

And also in versions of a few years ago, this problem just won't disappear on its own:
*avconv version 0.8.4-6:0.8.4-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
built on Nov  6 2012 16:51:11 with gcc 4.7.2

*ffmpeg version 0.8.4-6:0.8.4-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
built on Nov  6 2012 16:51:11 with gcc 4.7.2


What I expected to happen:


-------------------------------------
REFERENCES SECTION:
[1] https://bugs.launchpad.net/ubuntu/+source/libav/+bug/1290051   
Notice in [1] they report a similar crash in GNOME, I've seen this one in KDE. In [1] they report it with MP4 format involved; however, I've seen it in several other formats both in MP4 (video codec h.264) and FLV (video in flv, yuv420p), and also with several audio codecs (aac and mp3, for example).

** Affects: libav (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: alsa avconv ffmpeg libav pulseaudio

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to libav in Ubuntu.
https://bugs.launchpad.net/bugs/1518456

Title:
  avconv and ffmpeg keep crashing on segmentation fault because of
  pulseaudio

Status in libav package in Ubuntu:
  New

Bug description:
  Hi, in spite of the course of years, and that several people have
  reported this random error, it keeps happening both in avconv and
  ffmpeg, in DIFFERENT versions of Ubuntu, DIFFERENT versions of both
  avconv and ffmpeg, DIFFERENT computers (I'll give you my details at
  the end, though).

  I suggest that both avconv  and ffmpeg should be MORE VERBOSE IN
  SITUATIONS LIKE THE NEXT ONE, and try to manage exceptions so we can
  all contribute to problems like the following:

  SEGMENTATION FAULT IN THIS COMMAND:
   avconv -f alsa -ar 22050 -i default   some_output.mp3

  Or the same:
   avconv -f alsa -ar 22050 -i default  -ac 1 -acodec adpcm_swf consec_1.mp3
   avconv -f alsa -ar 22050 -i default  -ac 1 consec_1.mp3
   avconv -f alsa -ar 22050 -i default consec_1.mp3
   avconv -f alsa -i default consec_1.mp3
  -----------

  THE WAY TO STOP AND TEMPORARILY FIX the instantaneous "segmentation fault", was to do:
  pulseaudio --kill
  pulseaudio --start
  ---------------

  It can be hard for developers of both packages to reproduce this
  error, but it is STILL real, and it will NOT disappear "accidentally
  with the next version", as some comments have suggested in other
  similar reports of similar bugs, and even in the .crash file that
  mentions libraries that have nothing to do with the avconv or ffmpeg
  program.

  
  You will find in the next URL the output and command of the program avconv:
  http://investigacionyprogramacion.com/solicitudes/bugs_avconv_segmentation_fault//initial_messages.txt
  I show one command there, ALTHOUGH IT OCCURS WITH SEVERAL OTHER COMMANDS BESIDES THE ONE I SHOW IN THIS URL,  AS SHOWN BELOW IN THE SECTION OF "REFERENCES", IN THIS POST.

  In the above URL the expected behavior was, instead of "segmentation fault", the following message that occurs normally:
  --------------------                                                                                                                                           
  [alsa @ 0x23faea0] capture with some ALSA plugins, especially dsnoop, may hang.
  Segmentation fault (core dumped)

  [alsa @ 0x1bd6ea0] All info found    --->THIS LINE SHOULD HAVE FOLLOWED, instead of "segmentation fault"
  [alsa @ 0x1bd6ea0] Estimating duration from bitrate, this may be inaccurate
  Guessed Channel Layout for  Input Stream #0.0 : stereo 
  -------------------------

  The output of the very same command, when it worked, after restarting pulseaudio:
  http://investigacionyprogramacion.com/solicitudes/bugs_avconv_segmentation_fault//messages_when_successful.txt

  
  You will find in the next URL the core-dumped file, as found in /var/crash/ ; THERE you will fin a more complex command, involving also video grabbing, but in this case I was able to isolate the problem to only an audio problem. However, I insist on making avconv/ffmpeg more verbose and cautious for these exceptions, and a more helpful dumping for these cases. Pulseaudio needs revision also; grab in mind that skype sometimes "plays around" with the sound settings in the systems. Another thing you guys could do, if you are so kind, could be to internally compare "video and sound settings the last time avconv/ffmpeg worked, compared to now", maybe it might help, and of course, a far better logging of errors than depending on the things being recorded in /var/crash, such as this file:

  http://investigacionyprogramacion.com/solicitudes/bugs_avconv_segmentation_fault//_usr_bin_avconv.1000.crash


  ----------------------------------------------
  FINAL NOTE:
  -----------------------------------------------
  As I've mentioned, this bug is NOT a problem only of current Ubuntu version, nor avconv or ffmpeg only. It has been there FOR YEARS, and repetitively it occurs over and over, although in a random fashion. Despite it's hard-to-reproduce behavior, there are patterns: it happens MORE frequently when we have a long user-session in Ubuntu, and SOMETIMES when we restart, it disappears; other times it disappears when we close a RAM-demanding software such as the web-browsers (we all know that web-browsers have the problem of being very RAM consuming); other times it is reduced by reducing the framerate of the video being captured, or the audiorate being captured. In all these actions the pattern is: to demand less CPU and RAM, it MIGHT REDUCE (never eliminate for sure) the frequency of the problem. For your diagnose, you might consider if it is  racing condition of the speed of writing in the hard disk, and also taking into account the possibility of controlling the memory used by libraries of both programs. I've seen this behavior in several versions of both FFMPEG and AVCONV since at least 2012 to 2015. It won't disappear magically, as suggested in some forums. 

  Only if we all penetrate in the problem we will be able to help this
  awesome set of software to be more reliable. I suggest to escalate
  this issue to one of the most importance, no matter its difficulty to
  reproduce the problem.

  
  ----------------------------------------------------
  My details [please look the FINAL NOTE]

  lsb_release -rd
  Description:    Ubuntu 14.10
  Release:        14.10

  You will allso find useful some details:
  It happens both with CPU of more than 2 GHz and 880MHz.
  And it happens in 2Gigabyte RAM.

  Some of the packages in which the behavior has been detected:
  *avconv version 11-6:11-1, Copyright (c) 2000-2014 the Libav developers
    built on Sep 26 2014 14:36:31 with gcc 4.9.1 (Ubuntu 4.9.1-15ubuntu1)

  *ffmpeg version 2.5 Copyright (c) 2000-2014 the FFmpeg developers
    built on Dec 13 2014 10:21:59 with gcc 4.9.1 (Ubuntu 4.9.1-16ubuntu6)

  And also in versions of a few years ago, this problem just won't disappear on its own:
  *avconv version 0.8.4-6:0.8.4-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Nov  6 2012 16:51:11 with gcc 4.7.2

  *ffmpeg version 0.8.4-6:0.8.4-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Nov  6 2012 16:51:11 with gcc 4.7.2

  
  What I expected to happen:


  -------------------------------------
  REFERENCES SECTION:
  [1] https://bugs.launchpad.net/ubuntu/+source/libav/+bug/1290051   
  Notice in [1] they report a similar crash in GNOME, I've seen this one in KDE. In [1] they report it with MP4 format involved; however, I've seen it in several other formats both in MP4 (video codec h.264) and FLV (video in flv, yuv420p), and also with several audio codecs (aac and mp3, for example).

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libav/+bug/1518456/+subscriptions


Follow ups