audacity crashed with SIGSEGV in memcpy() on WMA export

Bug #695648 reported by Benjamin Drung
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Audacity
Fix Released
Unknown
audacity (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: audacity

When exporting a file to WMA (version 2), audacity crashes at the end of the file. I can reproduce it with different sound files and on Ubuntu 10.10 (maverick) and Ubuntu 11.04 (natty).

You can use Cellule from Silence [1] as test case.

[1] http://www.jamendo.com/en/download/track/5339

ProblemType: Crash
DistroRelease: Ubuntu 11.04
Package: audacity 1.3.12-8
ProcVersionSignature: Ubuntu 2.6.37-11.25-generic 2.6.37-rc7
Uname: Linux 2.6.37-11-generic x86_64
AlsaCards: Error: command ['cat', '/proc/asound/cards'] failed with exit code 1: cat: /proc/asound/cards: No such file or directory
Architecture: amd64
Date: Thu Dec 30 11:44:45 2010
ExecutablePath: /usr/bin/audacity
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta amd64 (20100318)
ProcCmdline: audacity
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LC_MESSAGES=de_DE.utf8
 LANG=de_DE.UTF-8
 LANGUAGE=de_DE:de:en_GB:en
SegvAnalysis:
 Segfault happened at: 0x7f78bc49abbe <memcpy+30>: movzwl (%rsi),%ecx
 PC (0x7f78bc49abbe) ok
 source "(%rsi)" (0x00000000) not located in a known VMA region (needed readable region)!
 destination "%ecx" ok
SegvReason: reading NULL VMA
Signal: 11
SourcePackage: audacity
StacktraceTop:
 memcpy () at ../sysdeps/x86_64/memcpy.S:78
 put_buffer () from /usr/lib/libavformat.so.52
 ff_put_wav_header () from /usr/lib/libavformat.so.52
 ?? () from /usr/lib/libavformat.so.52
 ?? () from /usr/lib/libavformat.so.52
Title: audacity crashed with SIGSEGV in memcpy()
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
XsessionErrors: (nautilus:1207): GConf-CRITICAL **: gconf_value_free: assertion `value != NULL' failed

Related branches

Revision history for this message
Benjamin Drung (bdrung) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 memcpy () at ../sysdeps/x86_64/memcpy.S:78
 put_be24 (s=0x333f060, val=0)
 ?? ()

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in audacity (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
Benjamin Drung (bdrung)
visibility: private → public
Revision history for this message
Benjamin Drung (bdrung) wrote : Re: audacity crashed with SIGSEGV in memcpy()

<bdrung> siretart: is this a ffmpeg bug?
<siretart> bdrung: I don't think so. the put_* functions are very basic, most probably audacity is trying to write to freed/invalid buffers

Revision history for this message
In , Benjamin Drung (bdrung) wrote :

When exporting a file to WMA (version 2), audacity crashes at the end of the
file. I can reproduce it with different sound files and on Ubuntu 10.10
(maverick) and Ubuntu 11.04 (natty).

You can use Cellule from Silence [1] as test case.

This is probably not a FFmpeg bug, but a bug in audacity. More information can
be found in Launchpad (including stacktrace): https://launchpad.net/bugs/695648

[1] http://www.jamendo.com/en/download/track/5339

Benjamin Drung (bdrung)
summary: - audacity crashed with SIGSEGV in memcpy()
+ audacity crashed with SIGSEGV in memcpy() on WMA export
Changed in audacity (Ubuntu):
status: New → Triaged
Revision history for this message
In , Gale (gale) wrote :

The crashes seem to occur with any 1.3.12 Beta/1.3.13 alpha build of Audacity
and any compatible version of FFmpeg. This seems to be an Audacity-on-Linux bug
to do with the standard export mechanism (using FFmpeg at the command line
either from a terminal and from Audacity's command line encoder works fine).

@Benjamin: We also have issues with incorrect AAC exports and AAC import
crashes (but this may be crashing of Audacity's own faulty AAC exports). It's
known that there is a problem with Audacity's interaction with the native
FFmpeg AAC . encoder. IIRC, LRN said this would be hard to fix. I believe the
older proprietary AAC encoder does not have this problem. Does the
Ubuntu-distributed FFmpeg use the native FFmpeg AAC encoder or the older one?
To use the older encoder I understand you have to compile FFmpeg with
--disable-encoder=aac.

Revision history for this message
In , Benjamin Drung (bdrung) wrote :
Revision history for this message
In , Gale (gale) wrote :

(In reply to comment #2)
> --disable-encoder=aac is only set on ia64
Sorry if it is a silly question, but what does that mean in practice for a
basic Linux user who will not compile FFmpeg themseleves? Does it mean that a
user installing Ubuntu or Debian on ia64 will be using the old aac encoder,
otherwise the native ffmpeg aac encoder? In other words when I export AAC from
Audacity on a i386 machine pointing to the Ubuntu-distributed FFmpeg, I am
using the native FFmpeg encoder?

Revision history for this message
In , Benjamin Drung (bdrung) wrote :

Yes, a user installing Ubuntu or Debian on ia64 will be using the old aac
encoder, otherwise the native ffmpeg aac encoder. Therefore most users (which
tend to either use i386 or amd64) will use the native FFmpeg encoder.

Revision history for this message
In , Leland-audacityteam (leland-audacityteam) wrote :

Created an attachment (id=107)
A possible fix for the crash

Benjamin,

Can you try applying the attached patch and see if it fixes the crash?
Incidentally, the same crash happens on OSX when using a current FFmpeg
version.

Thanks,

Leland

Revision history for this message
In , Benjamin Drung (bdrung) wrote :

After a two hours (yes, hours!) export of the test case (see Description), it
didn't crashed at the end. So yes, your patch fixes this bug.

Revision history for this message
In , Leland-audacityteam (leland-audacityteam) wrote :

(In reply to comment #6)

Geez, how large was the file? Is this a case where you were talking about
exports taking forever?

Leland

Revision history for this message
In , Gale (gale) wrote :

(In reply to comment #7)
> Geez, how large was the file? Is this a case where you were talking about
> exports taking forever?
It's only a 3 min 40 secs file. Which FFmpeg were you using, Benjamin? I'll try
Leland's patch later with the Ubuntu-distributed FFmpeg which is > 0.5, but
definitely there is no speed issue exporting WMA in the Ubuntu packaged
Audacity 1.3.12 - just a crash at the end.

There *is* an issue with slow AAC exports but as I understand it, only if you
use FFmpeg's native encoder. That does not play nicely with Audacity:
http://manual.audacityteam.org/m/index.php?title=FAQ:Installation_and_Plug-Ins#2009

but I don't have enough details to document it ATM.

Revision history for this message
In , Benjamin Drung (bdrung) wrote :

I am using FFmpeg 4:0.6-2ubuntu6 shipped by Ubuntu 10.10 (maverick). I tested
the patch with the audacity Ubuntu package 1.3.12-14ubuntu1 (which includes the
patch from bug #233) and the WMA export took 11 seconds. All exports took
between 6 and 11 seconds and the resulting export were ok, except the AAC
export: The AAC export took around two minutes and the resulting file was too
small and couldn't be play-backed.

Then I tested trunk with the patch from bug #233: All exports were very slow
(MP3 > 1 min, FLAC > 2 min) and the resulting files contained silence. There
must be a regression, but that's unrelated to this bug report.

Revision history for this message
In , Benjamin Drung (bdrung) wrote :

I open bug #311 dealing with the slow export.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package audacity - 1.3.12-15ubuntu1

---------------
audacity (1.3.12-15ubuntu1) natty; urgency=low

  * Merge from Debian unstable. Remaining changes:
    - Build against portSMF.
    - Build against libsbsms.

audacity (1.3.12-15) unstable; urgency=low

  * Fix crash on WMA export (LP: #695648).
 -- Benjamin Drung <email address hidden> Wed, 09 Mar 2011 12:29:45 +0100

Changed in audacity (Ubuntu):
status: Triaged → Fix Released
Changed in audacity:
status: Unknown → Confirmed
Revision history for this message
In , Gale (gale) wrote :

On Ubuntu 10.10 using Ubuntu-distributed FFmpeg, this seems to be fixed by
applying the patch in bug 176 comment 10 which includes the patch attached
here.

Revision history for this message
In , Gale (gale) wrote :

Fixed by patch for bug 176.

Changed in audacity:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.