Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 354073 - www-plugins/adobe-flash sound is broken with glibc-2.13
Summary: www-plugins/adobe-flash sound is broken with glibc-2.13
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Jim Ramsay (lack) (RETIRED)
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard:
Keywords:
: 354395 355599 (view as bug list)
Depends on:
Blocks: glibc-2.13
  Show dependency tree
 
Reported: 2011-02-08 09:36 UTC by Peter Leugner
Modified: 2011-03-15 14:52 UTC (History)
19 users (show)

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


Attachments
"workaround" (foo.patch,1.90 KB, patch)
2011-02-11 16:23 UTC, Samuli Suominen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Leugner 2011-02-08 09:36:14 UTC
A change in the way glibc handles memcpy breaks sound in the 64bit flash plugin from Adobe. The sound is distorted and crackles. Apparently this is a bug in the flash player according to https://bugzilla.redhat.com/show_bug.cgi?id=638477

Since you can't patch the flash plugin, maybe you can patch glibc until adobe fixes the problem, which could take months. Linus Torvalds posted a possible patch in the redhat bug.

Unfortunately it is not possible or recomended to downgrade glibc.

Reproducible: Always

Steps to Reproduce:
Comment 1 Rodolphe Rocca 2011-02-08 09:57:46 UTC
Actually you _can_ patch the flash plugin. See attachements to the link you gave.
Comment 2 tman 2011-02-08 10:54:57 UTC
i can confirm this problem. i hope there is a solution soon. :(
Comment 3 Peter Leugner 2011-02-08 12:34:51 UTC
Thanks Rodolphe, I didn't see the patch script for the binary flash player. I'll try this out tonight. It would be great if the ebuild for flash could apply this automatically if a 64bit version is installed and glibc is 2.13.
Comment 4 Peter Leugner 2011-02-08 19:43:16 UTC
I can confirm the instructions to patch the binary at https://bugzilla.redhat.com/show_bug.cgi?id=638477#c117 fixed it for me. In addition the the steps described there I had to do a
chmod 655 /opt/Adobe/flash-player/libflashplayer.so
otherwise firefox wouldn't load the plugin. Works fine now.
Comment 5 peng shao 2011-02-09 04:52:55 UTC

Thanks for reporting. This is 
(In reply to comment #4)
> I can confirm the instructions to patch the binary at
> https://bugzilla.redhat.com/show_bug.cgi?id=638477#c117 fixed it for me. In
> addition the the steps described there I had to do a
> chmod 655 /opt/Adobe/flash-player/libflashplayer.so
> otherwise firefox wouldn't load the plugin. Works fine now.
> 

This works for me, too. Thanks for the reporting. 
Comment 6 Alexander Brüning 2011-02-10 23:07:59 UTC
Didn't work for me, the modified plugin didn't load (no error messages and yes, the permissions were right). Linus workaround from the same Redhat bug worked however, after using an absolute path in LD_PRELOAD: https://bugzilla.redhat.com/show_bug.cgi?id=638477#c38
Comment 7 Sebastian Pipping gentoo-dev 2011-02-11 13:21:42 UTC
*** Bug 354395 has been marked as a duplicate of this bug. ***
Comment 8 Jim Ramsay (lack) (RETIRED) gentoo-dev 2011-02-11 15:45:24 UTC
Unfortunately I don't think we (as in "the ebuild") is legally allowed to patch the flash plugin.  We are bound by their license to not mirror or alter their binary.

The LD_PRELOAD idea may be the right thing to do, I'll see if I can come up with some way to roll this in to the ebuild...

Patches welcome, if anyone out there gets to it before I do.
Comment 9 Jim Ramsay (lack) (RETIRED) gentoo-dev 2011-02-11 16:06:40 UTC
On the other hand, patching glibc to alias memcpy to memmove may also be a good solution, adding toolchain team for their opinion on this.

The Redhat bug in the URL has a bunch of nice explanations from Linus Torvalds on why he thinks patching glibc would be an acceptable workaround, for example: https://bugzilla.redhat.com/show_bug.cgi?id=638477#c129

@toolchain: What do you think - Would you be willing to patch glibc-2.13?
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2011-02-11 16:23:13 UTC
Created attachment 262133 [details, diff]
"workaround"
Comment 11 Matt Turner gentoo-dev 2011-02-11 16:34:06 UTC
(In reply to comment #8)
> Unfortunately I don't think we (as in "the ebuild") is legally allowed to patch
> the flash plugin.  We are bound by their license to not mirror or alter their
> binary.

"We're" not, as far as I can tell. The user is altering the binary.

(In reply to comment #9)
> On the other hand, patching glibc to alias memcpy to memmove may also be a good
> solution, adding toolchain team for their opinion on this.

While this might work, this really sounds like a terrible idea. glibc made a change which stayed within the spec, and because some poorly written (proprietary) application used the wrong function (Really, this is C 101) we're going to patch glibc?

Flash fucking sucks. Please don't do anything of this magnitude to work-around this universally known fact.

Since flash blows, I say patching the libflashplayer.so library is the best work-around until they fix their crap.
Comment 12 Rafał Mużyło 2011-02-11 18:48:40 UTC
I'd say that in that Fedora bug, most interesting part is not the https://bugzilla.redhat.com/show_bug.cgi?id=638477#c117 but
https://bugzilla.redhat.com/show_bug.cgi?id=638477#c122
especially that some people there claim that flash works with this even better than before and https://bugzilla.redhat.com/show_bug.cgi?id=638477#c170 claims it's usable for 32bits too.
Comment 13 SpanKY gentoo-dev 2011-02-11 18:54:36 UTC
glibc isnt changing.  patching the binary isnt a problem like Matt says.  just put it behind USE=bindist.  same exact situation as binary drivers like nvidia.
Comment 14 Fabian Büttner 2011-02-15 10:16:24 UTC
I experienced the same problem, would never have guessed it to have something to do with the glibc.

I managed to work around the crackles by installing the 32 bit version only on my amd64 multilib system. (e.g. last.fm and youtube work in chromium now flawlessly, prior to this i had crackles on last.fm, but not on youtube)

On the other hand in opera there is now no flash available at all.

regards,
fabian
Comment 15 Richard Li 2011-02-17 10:12:59 UTC
If I recall, most new bugs that come with glibc-2.13 are related to the new multiarch feature, by which run-time CPU detection is used to have memory and string functions take advantage of new SIMD instructions if possible. Unfortunately some packages (Flash, Skype, etc.) don't work with some of those new functions.

So IMO, toolchain may consider adding an IUSE "multiarch" to glibc, so that users can disable the "multiarch" feature. (configure --disable-multiarch)

This way, users who have upgraded to 2.13 and wish to use adobe-flash can just rebuild glibc with USE=-multiarch, without having to downgrade.
Comment 16 Ulrich Müller gentoo-dev 2011-02-17 10:58:33 UTC
(In reply to comment #15)
> If I recall, most new bugs that come with glibc-2.13 are related to the new
> multiarch feature, by which run-time CPU detection is used to have memory
> and string functions take advantage of new SIMD instructions if possible.

memcpy(3p) explicitly says: "If copying takes place between objects that overlap, the behavior is undefined." So, if an application breaks because it has relied on an undefined implementation detail, then it seems very clear to me that it's _not_ glibc that is to blame for it.

Comment 17 Richard Li 2011-02-17 12:18:49 UTC
(In reply to comment #16)
> memcpy(3p) explicitly says: "If copying takes place between objects that
> overlap, the behavior is undefined." So, if an application breaks because it
> has relied on an undefined implementation detail, then it seems very clear to
> me that it's _not_ glibc that is to blame for it.

I was not blaming glibc. Sure it is Adobe that should fix the bug. I was simply giving a possible workaround for this problem. After all, glibc has been providing "--enable-multi-arch" and "--disable-multi-arch" for some time. Even without these bugs it doesn't seem to be a bad idea to add an USE for it.
Comment 18 Jim Ramsay (lack) (RETIRED) gentoo-dev 2011-02-17 20:45:05 UTC
(In reply to comment #11)
> (In reply to comment #8)
> > Unfortunately I don't think we (as in "the ebuild") is legally allowed to patch
> > the flash plugin.  We are bound by their license to not mirror or alter their
> > binary.
> 
> "We're" not, as far as I can tell. The user is altering the binary.

A good point, that.  I suppose we're not *distributing* an altered binary.

Okay, so I've set up a new ebuild to patch the 64bit version, please give it a try and report back here with success/failure.

  www-plugins/adobe-flash-10.2.152.27_p201011173-r2
Comment 19 Florian Klink 2011-02-18 00:24:58 UTC
at least here:

Portage 2.1.9.39 (default/linux/amd64/10.0, gcc-4.4.5, glibc-2.13-r0, 2.6.38-rc4 x86_64)

www-plugins/adobe-flash-10.2.152.27_p201011173-r2 fixed the sound problem with flash videos without having to use the LD_PRELOAD workaround. Great job :-)

Let's hope adobe will fix this in their next version...
Comment 20 Chí-Thanh Christopher Nguyễn gentoo-dev 2011-02-18 04:51:50 UTC
adobe-flash-10.2.152.27_p201011173-r2 doesn't set RESTRICT="bindist" as comment 13 suggested. The redistribution of modified versions is not permitted by the license.
Comment 21 Fabian Büttner 2011-02-18 09:06:15 UTC
(In reply to comment #18)
> Okay, so I've set up a new ebuild to patch the 64bit version, please give it a
> try and report back here with success/failure.

thank you for the fix :)

Comment 22 Marc Joliet 2011-02-18 12:55:39 UTC
memcpy-to-memmove.sh doesn't work with /bin/sh -> dash, it fails with

>>> Compiling source in /var/tmp/portage/www-plugins/adobe-flash-10.2.152.27_p201011173-r2/work ...
trap: 20: ERR: bad trap

It's easily fixed by changing line 130 of the ebuild from

	sh "${FILESDIR}/memcpy-to-memmove.sh" libflashplayer.so \

to

	bash "${FILESDIR}/memcpy-to-memmove.sh" libflashplayer.so \

However, since I don't use glibc-2.13, I can only say that the Flash plugin seems to run as before.
Comment 23 Martin Väth 2011-02-19 10:04:21 UTC
(In reply to comment #22)
>         bash "${FILESDIR}/memcpy-to-memmove.sh" libflashplayer.so

bash is also needed here for other reasons:
The script contains several bashisms (e.g. echo -n and near the end an
echo -ne which will badly break without errors with dash).

Comment 24 Jim Ramsay (lack) (RETIRED) gentoo-dev 2011-02-21 15:02:53 UTC
(In reply to comment #22)
>         bash "${FILESDIR}/memcpy-to-memmove.sh" libflashplayer.so \

Good catch, thanks :)

Fixed in -r2
Comment 25 Jim Ramsay (lack) (RETIRED) gentoo-dev 2011-02-22 13:34:23 UTC
*** Bug 355599 has been marked as a duplicate of this bug. ***
Comment 26 Jim Ramsay (lack) (RETIRED) gentoo-dev 2011-03-15 14:33:05 UTC
No complaints since my -r2 bump, considering this fixed.