pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/53319: text relocations fixes for multimedia/mplayer others
The following reply was made to PR pkg/53319; it has been noted by GNATS.
From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: o.vd.linden%quicknet.nl@localhost
Cc: gnats-bugs%netbsd.org@localhost, tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: pkg/53319: text relocations fixes for multimedia/mplayer others
Date: Tue, 14 Aug 2018 11:03:20 +0900
> > How did you enable x86 asm in ffmpeg3 from pkgsrc-2018Q2?
>
> Compiled and installed ffmpeg3 on Mar 19 2018 using the
> -current pkgsrc from that timestamp with a -current system
> from that timestamp when the noasm option wasn't
> around in the Makefile.
Well, it would be better to see exact reproducible procedure
with some specific release versions/binaries and misc settings.
> > mplayer doesn't start if it's enabled as the following:
>
> It does for me, with -current.
>
> However, I noticed your mplayer is compiled with gcc 5.5.0.
> Mine is compiled with gcc 6.4.0. No idea if that's the
> reason for you getting the "Cannot write-enable text segment"
> error messages.
No idea, but if it works even with "text relocations" warnings,
I think it is a bug, or environment specific settings. (see below)
> > Anyway, there are strong complaints about text relocations:
> > http://mail-index.netbsd.org/pkgsrc-bugs/2018/04/28/msg063868.html
> > http://mail-index.netbsd.org/pkgsrc-bugs/2018/04/28/msg063878.html
> > http://mail-index.netbsd.org/pkgsrc-bugs/2018/04/28/msg063881.html
> >
> > That was the reason why I filed this PR to disable them completely.
>
> If disabling i386 assembler code fixes the
> "Cannot write-enable text segment: Permission denied" errors, fine.
> But, I have yet to see any such message and the text reloction
> messages don't bother me that much. I'd love to see a more subtle
> way to fix this.
Do you still get text relocations warnings with pkgsrc-2018Q2 binaries?
Or do you just think the old version (around Mar 19?) of ffmpeg3
is fine because it doesn't cause errors but only warnings?
> Question still remains why am I only getting the text relocation
> warning messages and no error message whatsoever ? Is it due
> to gcc 6.4 vs gcc 5.5 and its handling of FORTIFY_SOURCE ?
The "text relocations" warned by ld.elf_so are actually deprecated,
as mentioned in this message:
http://mail-index.netbsd.org/pkgsrc-bugs/2018/04/28/msg063878.html
It looks the relocations require a write permission during
dynamic linking by ld.elf_so:
https://nxr.netbsd.org/xref/src/libexec/ld.elf_so/reloc.c?a=true&r=1.112#188
I guess the result of the mprotect(2) depends on sysctl(3) settings:
> security.pax.mprotect.enabled = 1
> security.pax.mprotect.global = 1
Maybe you omitted "options PAX_MPROTECT=1" from conf/GENERIC
https://nxr.netbsd.org/xref/src/sys/arch/i386/conf/GENERIC?r=1.1188#1536
in your own kernel config?
---
mirage# pkg_add -U work.i386/.packages/ffmpeg3-3.4.2nb6.tgz
ffmpeg3-3.4.2nb6: copying /usr/pkg/share/examples/ffmpeg3/ffserver.conf to /usr/pkg/etc/ffserver.conf
mirage# mplayer
/usr/pkg/lib/ffmpeg3/libswscale.so.4: text relocations
/usr/pkg/lib/ffmpeg3/libswscale.so.4: Cannot write-enable text segment: Permission denied
mirage# sysctl -w security.pax.mprotect.enabled=0
security.pax.mprotect.enabled: 1 -> 0
mirage# mplayer
/usr/pkg/lib/ffmpeg3/libswscale.so.4: text relocations
/usr/pkg/lib/ffmpeg3/libswresample.so.2: text relocations
/usr/pkg/lib/ffmpeg3/libavcodec.so.57: text relocations
/usr/pkg/lib/ffmpeg3/libavutil.so.55: text relocations
/usr/pkg/lib/ffmpeg3/libpostproc.so.54: text relocations
MPlayer 1.3.0-5.5.0 (C) 2000-2016 MPlayer Team
224 audio & 451 video codecs
Usage: mplayer [options] [url|path/]filename
Basic options: (complete list in the man page)
-vo <drv> select video output driver ('-vo help' for a list)
-ao <drv> select audio output driver ('-ao help' for a list)
vcd://<trackno> play (S)VCD (Super Video CD) track (raw device, no mount)
dvd://<titleno> play DVD title from device instead of plain file
-alang/-slang select DVD audio/subtitle language (by 2-char country code)
-ss <position> seek to given (seconds or hh:mm:ss) position
-nosound do not play sound
-fs fullscreen playback (or -vm, -zoom, details in the man page)
-x <x> -y <y> set display resolution (for use with -vm or -zoom)
-sub <file> specify subtitle file to use (also see -subfps, -subdelay)
-playlist <file> specify playlist file
-vid x -aid y select video (x) and audio (y) stream to play
-fps x -srate y change video (x fps) and audio (y Hz) rate
-pp <quality> enable postprocessing filter (details in the man page)
-framedrop enable frame dropping (for slow machines)
Basic keys: (complete list in the man page, also check input.conf)
<- or -> seek backward/forward 10 seconds
down or up seek backward/forward 1 minute
pgdown or pgup seek backward/forward 10 minutes
< or > step backward/forward in playlist
p or SPACE pause movie (press any key to continue)
q or ESC stop playing and quit program
+ or - adjust audio delay by +/- 0.1 second
o cycle OSD mode: none / seekbar / seekbar + timer
* or / increase or decrease PCM volume
x or z adjust subtitle delay by +/- 0.1 second
r or t adjust subtitle position up/down, also see -vf expand
* * * SEE THE MAN PAGE FOR DETAILS, FURTHER (ADVANCED) OPTIONS AND KEYS * * *
mirage#
---
Even if the binaries work with warnings by disabiling security stuff,
it will never be accepted by other developers.
To solve the text relocations, you have to rewrite all ancient asm code
to support PIE, as done is this xvid patch:
https://bugs.gentoo.org/90287
Thanks,
---
Izumi Tsutsui
Home |
Main Index |
Thread Index |
Old Index