Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 200670
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: media-video herd <media-video@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Samuli Suominen <ssuominen@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
asm.patch pic fix patch Alexis Ballier 2007-11-28 21:38 0000 2.85 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 200670 depends on: Show dependency tree
Bug 200670 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-11-28 18:05 0000
<snip>

  libtheora.so.0.3.1: (memory/data?) [0xCB76] in (optimized out: previous
theora_decode_init) [0x33A0]
  libtheora.so.0.3.1: (memory/data?) [0xCB80] in (optimized out: previous
theora_decode_init) [0x33A0]
  libtheora.so.0.3.1: (memory/data?) [0xCC30] in (optimized out: previous
theora_decode_init) [0x33A0]
  libtheora.so.0.3.1: (memory/data?) [0xCC3A] in (optimized out: previous
theora_decode_init) [0x33A0]
  libtheora.so.0.3.1: (memory/data?) [0xCD2B] in (optimized out: previous
theora_decode_init) [0x33A0]
  libtheora.so.0.3.1: (memory/data?) [0xCD32] in (optimized out: previous
theora_decode_init) [0x33A0]
  libtheora.so.0.3.1: (memory/data?) [0xCD3F] in (optimized out: previous
theora_decode_init) [0x33A0]
  libtheora.so.0.3.1: (memory/data?) [0xCD46] in (optimized out: previous
theora_decode_init) [0x33A0]
  /usr/lib/libtheora.so.0.3.1

</snip>

media-libs/libtheora-1.0_beta2 has USE pic to work this around for hardened,
but it should be fixed instead.

------- Comment #1 From solar 2007-11-28 18:14:16 0000 -------
For the moment if the problems are limited to x86 then the ebuild should be
changed as follows.

-use pic && myconf="--disable-asm"
+use pic && use x86 && myconf="--disable-asm"

Please don't even think about ever package use masking the pic flag in any
profile. Hopefully we can find a better solution in which we can give 
everybody the best of all worlds.

------- Comment #2 From Diego E. 'Flameeyes' Pettenò 2007-11-28 19:02:59 0000 -------
Well, if the pic USE flag is limited to x86 it makes sense to package.use.mask
it in base/ and then unmask it on x86-based profiles, don't you think so? It
makes no sense for other profiles to ever see that flag, but as we can't hide
it we are left with masking it for the single ebuild involved.

------- Comment #3 From solar 2007-11-28 19:16:21 0000 -------
pic is not limited to x86 in any such way. There is no reason to limit it to
any such profile.. We fix ebuilds at gentoo. Lets continue doing that..

------- Comment #4 From Diego E. 'Flameeyes' Pettenò 2007-11-28 19:26:16 0000 -------
Err when did I say it was limited to x86? I was proposing to let the USE flag
be a no-op for any other profile, because the _textrel_ problem is limited to
x86, no need to get other profiles to care about that USE flag.

------- Comment #5 From solar 2007-11-28 19:53:36 0000 -------
Diego,
I know you want to be helpful and all but in this case, I'm asking you to
please 
let it go. The pic flag has it's uses. We like how it's used. Adding crap to 
profiles vs ebuilds where they belong over complicates the issue and makes 
it harder to find and fix at a later time. If you want to mask it in *BSD
profiles. Then by all means go for it. But please leave base/* hardened/*
default-linux/* selinux/* uclibc/* alone.

------- Comment #6 From Samuli Suominen 2007-11-28 20:37:24 0000 -------
pageexec, could you take a look at this? thanks!

------- Comment #7 From Alexis Ballier 2007-11-28 21:38:59 0000 -------
Created an attachment (id=137278) [details]
pic fix

it's probably possible to also gain one register in their inline asm so that
compiling without -fomit-frame-pointer won't fail.

please someone with real x86 hardware (not just a chroot like me) test this,
and please someone with better experience than me with such fixes (not
difficult to find) review the patch ;)

------- Comment #8 From PaX Team 2007-11-29 00:02:59 0000 -------
just a few comments:

1. textrels are not at all specific to x86, they can happen on any arch. in
practice you see them most on x86 because that's where people write asm code
most of the time *and* not take care of proper PIC.

2. the proposed fix looks correct but i haven't checked the whole environment,
so please make sure that whatever register is used as the PIC base register
(probably ebx) is not used in any way in the rest of the asm() block.

PS: speaking of textrels, would you guys take a look at bug #135326 please?

------- Comment #9 From Alexis Ballier 2007-11-29 11:29:24 0000 -------
(In reply to comment #8)
> 2. the proposed fix looks correct but i haven't checked the whole environment,
> so please make sure that whatever register is used as the PIC base register
> (probably ebx) is not used in any way in the rest of the asm() block.

ebx is not used, but anyway, if it was used and not in the clobber list that
would be a much more serious issue than a textrel imho. And if it was used and
in the clobber list gcc would be ranting a lot, wouldn't it ?


> PS: speaking of textrels, would you guys take a look at bug #135326 please?

yes I was planning to jump on this one very soonish, but I need to find a
moment where I have a few hours free as the patch is huge and I want to review
it and test it entirely before commiting it.

------- Comment #10 From Samuli Suominen 2007-11-29 19:26:54 0000 -------
Unfortunately, I don't have x86 hardware to test this (CC x86?)

------- Comment #11 From PaX Team 2007-12-01 14:08:12 0000 -------
(In reply to comment #9)
> ebx is not used, but anyway, if it was used and not in the clobber list that
> would be a much more serious issue than a textrel imho.

it's just that i saw in the past PIC 'fixes' where instead of getting rid of
ebx, it was simply pushed/popped around the rest of the code. the problem with
this is that it obviously changes the stack pointer which in turn will ruin
gcc's internal tracking logic and manifests in bad asm when you have an "m"
constraint for a variable that happens to be on the stack and is not addressed
via the frame pointer.

> And if it was used and in the clobber list gcc would be ranting a lot, wouldn't it ?

yes.

------- Comment #12 From Dawid Węgliński 2007-12-03 17:15:59 0000 -------
(In reply to comment #7)
> please someone with real x86 hardware (not just a chroot like me) test this,
> and please someone with better experience than me with such fixes (not
> difficult to find) review the patch ;)
> 
Applying fine on my x86, ffmpeg2theora also works fine w/ that.

------- Comment #13 From Alexis Ballier 2007-12-07 20:01:07 0000 -------
applied

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug