This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 0.161 elfutils test are failing on Linux Arch


On Wed, 2015-01-14 at 11:51 -0800, Anatol Pomozov wrote:
> > > [anatol(a)arch tests]$ cat run-deleted.sh.log
> > > PID 22079 - process
> > > TID 22079:
> > >
> > /home/anatol/sources/core-arch/elfutils/trunk/src/elfutils-0.161/src/stack:
> > > dwfl_thread_getframes tid 22079: Operation not permitted
> > >
> > /home/anatol/sources/core-arch/elfutils/trunk/src/elfutils-0.161/src/stack:
> > > Couldn't show any frames.
> > >
> > >
> > > Is it a known issue with 0.161?
> >
> > Not a know issue.
> >
> > The first error message isn't very helpful. But the second might
> > indicate some ptrace operation or reading /proc/pid/mem is not
> > permitted. Both tests rely on being able to attach to and read from the
> > process memory to get the ELF image (the first for the vdso, the second
> > for the deleted.so).
> >
> > There have been selinux setting that prevented any such operation. Maybe
> > Arch linux enables something like that?
> >
> 
> No, my kernel (3.18.2)  does not have SELinux enabled. Here is kernel
> config file https://gist.github.com/anatol/d4da6afda94d479ca142

You do seem to have yama and alternate selinux security module enabled
it seems. Make sure it doesn't deny ptrace/proc/mem.
Probably /proc/sys/kernel/yama/ptrace_scope should be set to zero.

> How to run a single test?
> 
> [anatol(a)arch tests]$ ./run-deleted.sh
> ./run-deleted.sh: line 18: /backtrace-subr.sh: No such file or directory
> ./run-deleted.sh: line 20: tempfiles: command not found
> cp: cannot stat ‘/deleted’: No such file or directory
> cp: cannot stat ‘/deleted-lib.so’: No such file or directory
> ./run-deleted.sh: line 28: testrun: command not found
> ./run-deleted.sh: line 31: tempfiles: command not found
> ./run-deleted.sh: line 36: testrun: command not found
> kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or
> kill -l [sigspec]
> ./run-deleted.sh: line 40: check_native_unsupported: command not found
> 
> does not look right. I would like like to run/gdb the command that fails.

It is mostly a simple shell testcase. But with some convenience macros.
In your build dir create a directory. Copy deleted and deleted-lib.so
from the build tests dir into this temp dir. change the pwd to this temp
dir. Run the deleted program and note its pid. rm deleted-lib.so. Then
run the src/stack program from your build dir on the pid. And that under
gdb if you want to debug using the LD_LIBRARY_PATH set to the just build
libraries.

$ mkdir temp
$ cd temp
$ cp ../tests/deleted ../tests/deleted-lib.so .
$ ./deleted
2285
$ rm deleted-lib.so
$ cd ..
$ LD_LIBRARY_PATH=backends:libelf:libdw gdb --args src/stack -v -p 2285
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-51.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /opt/local/build/elfutils-obj/src/stack...done.
(gdb) r
Starting program: /opt/local/build/elfutils-obj/src/stack -v -p 2285
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
PID 2285 - process
TID 2285:
#0  0x00007ff551b254c0     __nanosleep - /usr/lib64/libc-2.17.so
    ../sysdeps/unix/syscall-template.S:81
#1  0x00007ff551b25374 - 1 __sleep - /usr/lib64/libc-2.17.so
    ../sysdeps/unix/sysv/linux/sleep.c:137
#2  0x00007ff551e296d6 - 1 libfunc - /opt/local/build/elfutils-obj/temp/deleted-lib.so (deleted)
#3  0x0000000000400938 - 1 main - /opt/local/build/elfutils-obj/temp/deleted
    /home/mark/src/elfutils/tests/deleted.c:45
#4  0x00007ff551a89af5 - 1 __libc_start_main - /usr/lib64/libc-2.17.so
    /usr/src/debug/glibc-2.17-c758a686/csu/libc-start.c:274
#5  0x0000000000400799 - 1 _start - /opt/local/build/elfutils-obj/temp/deleted
[Inferior 1 (process 2382) exited normally]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]