Hide Forgot
This also happens on RHEL 7.3. So clone this bug. +++ This bug was initially created as a clone of Bug #1389219 +++ Description of problem: Segmentation fault (core dumped) if trace-cmd snapshot after trace-cmd start -p wakeup Version-Release number of selected component (if applicable): Fedora Rawhide x86_64 [root@nec-em13 ~]# uname -r 4.9.0-0.rc1.git4.1.fc26.x86_64 [root@nec-em13 ~]# dnf info trace-cmd Last metadata expiration check: 0:06:30 ago on Thu Oct 27 04:21:22 2016 EDT. Installed Packages Name : trace-cmd Version : 2.6 Release : 2.fc26 Arch : x86_64 Size : 485 k Source : trace-cmd-2.6-2.fc26.src.rpm How reproducible: Always Steps to Reproduce: 1.Start a new machine with Fedora Rawhide 2.# trace-cmd start -p wakeup 3.# trace-cmd snapshot -s Actual results: [root@nec-em13 ~]# trace-cmd snapshot -s trace-cmd: Device or resource busy Segmentation fault (core dumped) Expected results: Success without error. Or return an error (instead of segmentation fault) if this is not supported. Additional info:
strace information on RHEL 7.3 like the following [root@ibm-x3550m3-03 ~]# strace trace-cmd snapshot -s execve("/usr/bin/trace-cmd", ["trace-cmd", "snapshot", "-s"], [/* 38 vars */]) = 0 brk(0) = 0x10d6000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7efdd7a5a000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=37368, ...}) = 0 mmap(NULL, 37368, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7efdd7a50000 close(3) = 0 open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\16\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=19776, ...}) = 0 mmap(NULL, 2109744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7efdd7638000 mprotect(0x7efdd763a000, 2097152, PROT_NONE) = 0 mmap(0x7efdd783a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7efdd783a000 close(3) = 0 open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\34\2\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=2118128, ...}) = 0 mmap(NULL, 3932672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7efdd7277000 mprotect(0x7efdd742d000, 2097152, PROT_NONE) = 0 mmap(0x7efdd762d000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b6000) = 0x7efdd762d000 mmap(0x7efdd7633000, 16896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7efdd7633000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7efdd7a4f000 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7efdd7a4d000 arch_prctl(ARCH_SET_FS, 0x7efdd7a4d740) = 0 mprotect(0x7efdd762d000, 16384, PROT_READ) = 0 mprotect(0x7efdd783a000, 4096, PROT_READ) = 0 mprotect(0x65b000, 4096, PROT_READ) = 0 mprotect(0x7efdd7a5b000, 4096, PROT_READ) = 0 munmap(0x7efdd7a50000, 37368) = 0 brk(0) = 0x10d6000 brk(0x10f7000) = 0x10f7000 brk(0) = 0x10f7000 open("/proc/mounts", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7efdd7a59000 read(3, "rootfs / rootfs rw 0 0\nsysfs /sy"..., 1024) = 1024 read(3, " 0 0\ncgroup /sys/fs/cgroup/memor"..., 1024) = 1024 read(3, "lbfs rw,seclabel,relatime 0 0\nsu"..., 1024) = 376 read(3, "", 1024) = 0 read(3, "", 1024) = 0 close(3) = 0 munmap(0x7efdd7a59000, 4096) = 0 stat("/sys/kernel/tracing", 0x7ffdf68b4870) = -1 ENOENT (No such file or directory) stat("/sys/kernel/debug/tracing/snapshot", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 open("/sys/kernel/debug/tracing/snapshot", O_WRONLY) = 3 write(3, "1", 1) = -1 EBUSY (Device or resource busy) dup(2) = 4 fcntl(4, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE) fstat(4, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7efdd7a59000 write(4, "trace-cmd: Device or resource bu"..., 35trace-cmd: Device or resource busy ) = 35 close(4) = 0 munmap(0x7efdd7a59000, 4096) = 0 write(2, " ", 2 ) = 2 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x1} --- +++ killed by SIGSEGV +++ Segmentation fault
Created attachment 1265011 [details] trace-cmd: Fix segmentation fault in trace-snapshot
Patch was also sent upstream (lkml and to the trace-cmd maintainer Steve Rostedt)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2219