Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 459218 - >=x11-wm/xpra-0.8.4: Segmentation fault on client connect caused by "old-libav.patch" applied for media-video/ffmpeg
Summary: >=x11-wm/xpra-0.8.4: Segmentation fault on client connect caused by "old-liba...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michael Weber (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-25 22:07 UTC by Oliver Freyermuth
Modified: 2013-05-15 06:39 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Freyermuth 2013-02-25 22:07:44 UTC
In recent ebuilds of x11-wm/xpra, the patch "old-libav.patch" is applied unless a new version of libav is installed to fix the bug described here: 
https://www.xpra.org/trac/ticket/244
However, this patch is also applied if libav is not installed at all, e.g. if using media-video/ffmpeg! 

If the patch is applied in such a case, this causes the segmentation violation described in the original bug report upstream to appear with ffmpeg. 

I have reproduced this segmentation fault with =media-video/ffmpeg-0.10.3 and =media-video/ffmpeg-1.1.3 here. 
Editing the ebuild so the patch is not applied at all fixes the situation for me, but I am not sure about the correct syntax: The patch should only be applied for old libav-versions, but not for any version of media-video/ffmpeg. 

Reproducible: Always

Steps to Reproduce:
1. emerge >=xpra-0.8.4 with ffmpeg installed, so old-libav.patch is applied
2. connect to xpra-server and open a window
3. experience segmentation fault
Comment 1 Oliver Freyermuth 2013-02-25 22:17:22 UTC
Actually, I found the gentoo bugreport which introduced this change, for reference: 
  https://bugs.gentoo.org/show_bug.cgi?id=458808
If I read the report correctly, the patch had only been tested against old versions of libav and no version of ffmpeg yet.
Comment 2 Oliver Freyermuth 2013-02-25 22:49:20 UTC
I have now tested several versions of media-video/ffmpeg with and without the patch and here are my final results: 

=media-video/ffmpeg-0.10.3 (stable in tree): 
  - does only compile with patch applied
  - segmentation fault on client connect (if x264 is used)
  => It appears >=xpra-0.8.4 with x264 is incompatible with media-video/ffmpeg-0.10, at least in my setup. Maybe someone else can confirm? 

=media-video/ffmpeg-1.0.4: 
  - does compile with and without patch applied
  - segmentation fault on client connect if patch was applied
  - Works fine if patch was not applied. 

=media-video/ffmpeg-1.1.3: 
  same situation as for =media-video/ffmpeg-1.0.4

Conclusion: Patch should not be applied for >=media-video/ffmpeg-1.0
Comment 3 Michael Weber (RETIRED) gentoo-dev 2013-02-26 08:23:15 UTC
Thanks for the report.
Comment 4 Michael Weber (RETIRED) gentoo-dev 2013-02-26 08:59:29 UTC
Did you test if this situation applies to vpx, too? It's the other codec/useflag depending on virtual/ffmpeg.


michael@x xpra % cvs diff xpra-0.8.6.ebuild
Index: xpra-0.8.6.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/x11-wm/xpra/xpra-0.8.6.ebuild,v
retrieving revision 1.1
diff -u -B -r1.1 xpra-0.8.6.ebuild
--- xpra-0.8.6.ebuild   25 Feb 2013 06:39:39 -0000      1.1
+++ xpra-0.8.6.ebuild   26 Feb 2013 08:34:42 -0000
@@ -17,6 +17,7 @@
 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
 IUSE="+clipboard +rencode server vpx webp x264"

+# x264/old-libav.path situation see bug 459218
 COMMON_DEPEND="dev-python/pygobject:2
        dev-python/pygtk:2
        x11-libs/libX11
@@ -29,6 +30,7 @@
                virtual/ffmpeg )
        webp? ( media-libs/libwebp )
        x264? ( media-libs/x264
+               || ( >=media-video/ffmpeg-1.0.4 media-video/libav )
                virtual/ffmpeg )"
 
 RDEPEND="${COMMON_DEPEND}
@@ -49,8 +51,12 @@
 python_prepare_all() {
        epatch "${FILESDIR}"/${PN}-0.7.1-ignore-gentoo-no-compile.patch
        epatch "${FILESDIR}"/${PN}-0.8.0-prefix.patch
-       if ! has_version ">=media-video/libav-9" ; then
-               epatch patches/old-libav.patch
+
+       #assuming ffmpeg and libav mutual exclusive installs
+       if has_version "media-video/libav" ; then
+               if ! has_version ">=media-video/libav-9" ; then
+                       epatch patches/old-libav.patch
+               fi
        fi
        
        use clipboard || epatch patches/disable-clipboard.patch
Comment 5 Oliver Freyermuth 2013-02-26 09:59:37 UTC
Thanks for the quick reply! 
I just tested vpx with =media-video/ffmpeg-0.10.3 (with patch applied so it compiles), and I do NOT get the segmentation fault on client connect which I got for x264. 
This means users of =media-video/ffmpeg-0.10.3 can still use the new xpra if they use vpx instead of x264. 

Seeing that vpx works, I think the patch should also be applied for old ffmpeg (<1.0) to fix compilation errors, apart from that, your patch looks perfect :).
Comment 6 Oliver Freyermuth 2013-03-01 16:29:32 UTC
Upstream has recently updated old-libav.patch: 
https://www.xpra.org/trac/changeset/2824/xpra
From the looks of it, this should also fix the remaining segmentation fault which occurs on connection using x264 and media-video/ffmpeg-0.10, but I currently do not have the time to confirm this myself.
Comment 7 Michael Weber (RETIRED) gentoo-dev 2013-05-15 06:39:01 UTC
This version of old-libav.patch is included in 0.8.8.