Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 638382 - sys-devel/gcc-6.4.0 relocation errors when using FEATURES="userpriv usersandbox" and ptrace_scope == 2
Summary: sys-devel/gcc-6.4.0 relocation errors when using FEATURES="userpriv usersandb...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Highest blocker
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-21 19:14 UTC by Herbert Wantesh
Modified: 2017-12-11 15:53 UTC (History)
1 user (show)

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 Herbert Wantesh 2017-11-21 19:14:37 UTC
after upgrading to gcc 4.6.0 and recompiling @world and @system i get this error when trying to start libreoffice

/usr/lib64/libreoffice/program/soffice.bin: relocation error: /usr/lib64/libreoffice/program/libmergedlo.so: symbol _ZSt11__once_call, version GLIBCXX_3.4.11 not defined in file libstdc++.so.6 with link time reference


i think i repackage is needed to get this relocation error fixed.

Reproducible: Always
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2017-11-27 00:57:28 UTC
If the RH bug is a pointer, then this is a weird interaction from rebuilding gcc against a newer glibc...
Comment 2 Herbert Wantesh 2017-12-03 11:40:09 UTC
recompiling gcc fixed the error
Comment 3 Herbert Wantesh 2017-12-03 14:41:51 UTC
okay i found out what is causing this:

i use /proc/sys/kernel/yama/ptrace_scope with tthe value "2"

2 - admin-only attach: only processes with CAP_SYS_PTRACE may use ptrace
    with PTRACE_ATTACH, or through children calling PTRACE_TRACEME.

and i use FEATURES="userfetch userpriv usersandbox" so it is not possible to use ptrace. but when i compile gcc i get errors like this when ptrace_scope == 2

checking whether the target supports thread-local storage...  * /tmp/tmerge/portage/sys-apps/sandbox-2.10-r4/work/sandbox-2.10/libsandbox/trace.c:_do_ptrace():74: failure (Operation not permitted):
 * ISE:_do_ptrace: ptrace(PTRACE_TRACEME, ..., 0x0000000000000000, 0x0000000000000000): Operation not permitted

i noticed the failures also sometimes when compiling other apps and some of them brake when compiling with ptrace_scope == 2
Comment 4 Herbert Wantesh 2017-12-03 14:43:54 UTC
okay i found out what is causing this:

i use /proc/sys/kernel/yama/ptrace_scope with tthe value "2"

2 - admin-only attach: only processes with CAP_SYS_PTRACE may use ptrace
    with PTRACE_ATTACH, or through children calling PTRACE_TRACEME.

and i use FEATURES="userfetch userpriv usersandbox" so it is not possible to use ptrace. but when i compile gcc i get errors like this when ptrace_scope == 2

checking whether the target supports thread-local storage...  * /tmp/tmerge/portage/sys-apps/sandbox-2.10-r4/work/sandbox-2.10/libsandbox/trace.c:_do_ptrace():74: failure (Operation not permitted):
 * ISE:_do_ptrace: ptrace(PTRACE_TRACEME, ..., 0x0000000000000000, 0x0000000000000000): Operation not permitted

this happens a lot of times:

# grep -i ptrace emerge.output|wc -l
56


i noticed the failures also sometimes when compiling other apps and some of them brake when compiling with ptrace_scope == 2 and FEATURES="userpriv usersandbox"
Comment 5 Herbert Wantesh 2017-12-03 14:46:31 UTC
okay i found out what is causing this:

i use /proc/sys/kernel/yama/ptrace_scope with tthe value "2"

2 - admin-only attach: only processes with CAP_SYS_PTRACE may use ptrace
    with PTRACE_ATTACH, or through children calling PTRACE_TRACEME.

and i use FEATURES="userfetch userpriv usersandbox" so it is not possible to use ptrace. but when i compile gcc i get errors like this when ptrace_scope == 2

checking whether the target supports thread-local storage...  * /tmp/tmerge/portage/sys-apps/sandbox-2.10-r4/work/sandbox-2.10/libsandbox/trace.c:_do_ptrace():74: failure (Operation not permitted):
 * ISE:_do_ptrace: ptrace(PTRACE_TRACEME, ..., 0x0000000000000000, 0x0000000000000000): Operation not permitted

this happens a lot of times:

# grep -i ptrace emerge.output|wc -l
56


i noticed the failures also sometimes when compiling other apps and some of them brake when compiling with ptrace_scope == 2 and FEATURES="userpriv usersandbox"

compiling gcc with ptrace_scope set to 0 solves the relocation error for libreoffice-bin

i think the user should at least get a warining when compiling gcc with FEATURES="userpriv usersandbox" and ptrace_scope == 2
Comment 6 Herbert Wantesh 2017-12-03 14:47:52 UTC
sorry for the reposts - please ignore Comment 3 & 4
Comment 7 Herbert Wantesh 2017-12-03 14:50:41 UTC
can someone please assign this to the portage and gcc people?
Comment 8 Herbert Wantesh 2017-12-11 15:53:14 UTC
closing this bug and opened a new bug #640698 as this bug is connected to the wrong component