Miscompilation with gcc 4.8 (segfault in x264_cqm_init)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| x264 (Ubuntu) |
High
|
Andrew Starr-Bochicchio | ||
| Saucy |
High
|
Andrew Starr-Bochicchio |
Bug Description
SRU Justification:
[Impact]
* A segfault in libx264-123 has caused major regressions in vlc, kazam, avidemux, and avconv among others. Nearly any program that encodes video in H264 is probably affected.
[Test Case]
* As this impacts many packages, there are a number of possible test cases. A simple one is to use kazam, the screen recording app:
1) Install the kazam package.
2) Run kazam
3) Make sure "file > preferences > screencast > record with" is set to H264/MP4
4) Attempt to record a screencast.
With 2:0.123.
[Regression Potential]
* There is little chance of regression. In order to make the most minimal change possible, the package is just simply built with -fno-aggressive
[Other Info]
This had not been rebuilt with gcc 4.8 until one day before release when a rebuilt was triggered to fix the arm64 build.
http://
"GCC now uses a more aggressive analysis to derive an upper bound for the number of iterations of loops using constraints imposed by language standards. This may cause non-conforming programs to no longer work as expected, such as SPEC CPU 2006 464.h264ref and 416.gamess. A new option, -fno-aggressive
The fix has already been uploaded to trusty.
-------
Original bug:
Vlc crashes when encoding h264:
Thread 9 (Thread 0x7fffd9712700 (LWP 3034)):
#0 __memcmp_sse2 () at ../sysdeps/
#1 0x00007fffc9ec9d9e in x264_cqm_init () from /usr/lib/
#2 0x00007fffc9f34374 in x264_encoder_
#3 0x00007fffca1fef34 in Open (p_this=
#4 0x00007ffff795ed00 in vlc_module_load (p_this=
psz_
probe=
#5 0x00007ffff795f1a4 in module_need (obj=obj@
strict=
#6 0x00007fffe8ce8a34 in transcode_video_new (p_stream=
#7 0x00007fffe8ce9c28 in transcode_video_add (p_stream=
id=
#8 0x00007fffe8ce54a8 in Add (p_stream=
#9 0x00007ffff797f64f in sout_InputNew (p_sout=
at stream_
#10 0x00007ffff791b6e6 in DecoderProcessSout (p_block=0x0, p_dec=0x7fffe05
#11 DecoderProcess (p_dec=
#12 0x00007ffff791bde4 in DecoderThread (p_data=
#13 0x00007ffff76c8f6e in start_thread (arg=0x7fffd971
#14 0x00007ffff71ef9cd in clone () at ../sysdeps/
http://
Configure x264 with "--extra-
Also seems that problem solved in trunk - http://
Maarten Baert (maarten-baert) wrote : | #2 |
I can confirm this. It affects anything that uses libx264, not just VLC but also avconv (the command line tool) and any program that encodes video with libavcodec (i.e. most video editors and screencasting software).
The backtrace in avconv is mostly the same:
#0 __memcmp_ssse3 () at ../sysdeps/
#1 0x00007ffff3012d9e in x264_cqm_init () from /usr/lib/
#2 0x00007ffff307d374 in x264_encoder_
#3 0x00007ffff693736c in ?? () from /usr/lib/
#4 0x00007ffff6cc25f5 in avcodec_open2 () from /usr/lib/
#5 0x00000000004051aa in ?? ()
#6 0x00007ffff59aede5 in __libc_start_main (main=0x404c10, argc=12, ubp_av=
fini=<optimized out>, rtld_fini=
#7 0x0000000000407983 in ?? ()
3vi1 (launchpad-net-eternaldusk) wrote : | #3 |
I can confirm both the problem and the workaround (--extra-
Doug McMahon (mc3man) wrote : Re: [Bug 1241772] Re: Miscompilation with gcc 4.8 (segfault in x264_cqm_init) | #4 |
On 10/19/2013 10:13 PM, 3vi1 wrote:
> I can confirm both the problem and the workaround (--extra-
> aggressive-
>
You all could also just use a newer version of x264, the current is a
bit stale, from late april 2013
(same goes for libav which is even older
Maarten Baert (maarten-baert) wrote : | #5 |
@Doug: x264 can't be updated without recompiling or even updating libav as well, AFAIK.
I've added a patched version of x264 to my PPA:
https:/
Normally I wouldn't mess with official packages, but since the official one is completely broken, I can't possibly make it worse, right? :) It's the original package from Ubuntu with the upstream patch applied to it.
For those who want to try it (at your own risk):
sudo add-apt-repository ppa:maarten-
sudo apt-get update
sudo apt-get upgrade
Dave Gilbert (ubuntu-treblig) wrote : | #6 |
Maarten: Do you have a pointer to some discussion about that patch? Is this really a gcc optimisation bug or is vlc doing something that's not legal/safe but didn't happen to trigger on older gcc?
David Newman (drdrnewman) wrote : | #7 |
This affects vlc, avidemux, and command line use of avconv. All produce segfaults on my 64-bit Kubuntu 13.10 upgraded computer. It affects all ways in which avconv uses libx264.
Maarten Baert (maarten-baert) wrote : | #8 |
I couldn't find any info either. As far as I understand, x264 was doing something that wasn't standard-compliant (array overreads), and the GCC optimization aggressive-
It may be possible to verify this with Valgrind, but I think the version of Valgrind in Ubuntu doesn't support all the instructions that x264 uses yet, so this is requires recompilation without assembly optimizations.
Dave Gilbert (ubuntu-treblig) wrote : | #9 |
Triaged: Upstream fix found
High: Affecting multiple common packages making them unusable.
Changed in x264 (Ubuntu): | |
importance: | Undecided → High |
status: | Confirmed → Triaged |
The attachment "Upstream patch (backported)" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]
tags: | added: patch |
Torsten Römer (dode) wrote : | #11 |
Rebuilding the libx264-
Daniel T Chen (crimsun) wrote : | #12 |
In light of this being an SRU candidate for 13.10, I recommend we simply compile using -fno-aggressive
Changed in x264 (Ubuntu Saucy): | |
status: | New → Triaged |
importance: | Undecided → High |
Andrew Starr-Bochicchio has pointed out that his bug also affects kazam:
https:/
Changed in x264 (Ubuntu): | |
status: | Triaged → In Progress |
assignee: | nobody → Andrew Starr-Bochicchio (andrewsomething) |
Changed in x264 (Ubuntu Saucy): | |
status: | Triaged → In Progress |
assignee: | nobody → Andrew Starr-Bochicchio (andrewsomething) |
description: | updated |
Adam Pryor (adam-pryor-1992) wrote : | #15 |
I can confirm that Maarten Baert's ppa has resolved the issue I was having with x264 on 13.10. Kazam works fine now and mp4 playback is also working. I have had no negative side-effects so far, but I'll be sure to report back if I find any problems.
Klaus Kettner (klaus-kettner) wrote : | #16 |
I can confirm that Maarten Baert's ppa has resolved my problems with avconv on the command-line. Tnx dude!
Hello Alex, or anyone else affected,
Accepted x264 into saucy-proposed. The package will build now and be available at http://
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-
Further information regarding the verification process can be found at https:/
Changed in x264 (Ubuntu Saucy): | |
status: | In Progress → Fix Committed |
tags: | added: verification-needed |
Launchpad Janitor (janitor) wrote : | #18 |
This bug was fixed in the package x264 - 2:0.123.
---------------
x264 (2:0.123.
* Compile using -fno-aggressive
segfault caused by changes in gcc 4.8 (LP: #1241772).
-- Andrew Starr-Bochicchio <email address hidden> Tue, 22 Oct 2013 12:22:07 -0400
Changed in x264 (Ubuntu): | |
status: | In Progress → Fix Released |
John D (johndcarmack) wrote : | #19 |
I tried following the directions in the EnableProposed link, but the aptitude program complains there are no packages for saucy-proposed. Using apt-get specifically worked, though? At any rate, I finally got it installed and no more segfault.
Miklos Juhasz (mjuhasz) wrote : | #20 |
The proposed package resolves this bug for me as well.
tags: |
added: verification-done removed: verification-needed |
enrico (eliboni) wrote : | #21 |
fixed for me as well.
asgard2 (kamp000x) wrote : | #22 |
proposed sources with apt-get are also working for me
libx264-123 from saucy-proposed fixed the bug for me as well. It is not yet in the main saucy repository where the segfault still happens. What does it take to move the package over from proposed?
Scott Kitterman (kitterman) wrote : Re: [Bug 1241772] Re: Miscompilation with gcc 4.8 (segfault in x264_cqm_init) | #24 |
It needs a week in -proposed for regression testing.
Adam Pryor (adam-pryor-1992) wrote : | #25 |
Just activated the -proposed updates and installed them. Everything works fine, as it did with Maarten Baert's ppa, and I'm seeing no regressions at all so far.
Pieter Hintjens (ph-imatix) wrote : | #26 |
Fixed for me too... Maarten, thank you.
korgman (korgie) wrote : | #27 |
I have installed x86 binary: http://
and I am fine.
Launchpad Janitor (janitor) wrote : | #28 |
This bug was fixed in the package x264 - 2:0.123.
---------------
x264 (2:0.123.
* Compile using -fno-aggressive
segfault caused by changes in gcc 4.8 (LP: #1241772).
-- Andrew Starr-Bochicchio <email address hidden> Tue, 22 Oct 2013 12:22:07 -0400
Changed in x264 (Ubuntu Saucy): | |
status: | Fix Committed → Fix Released |
The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.
Status changed to 'Confirmed' because the bug affects multiple users.