diff --git a/.devtoolset-6-strace.metadata b/.devtoolset-6-strace.metadata new file mode 100644 index 0000000..9f0e96b --- /dev/null +++ b/.devtoolset-6-strace.metadata @@ -0,0 +1 @@ +3138a70950fb84ef5fd5c801e992404777f164ec SOURCES/strace-4.12.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4048f0b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/strace-4.12.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/strace-4.12-chown.patch b/SOURCES/strace-4.12-chown.patch new file mode 100644 index 0000000..35b94cd --- /dev/null +++ b/SOURCES/strace-4.12-chown.patch @@ -0,0 +1,30 @@ +commit 58d0ee2ea5499cf532a03bed39187b1934b06a07 +Author: Dmitry V. Levin +Date: Tue Jul 26 09:58:37 2016 +0000 + + tests: fix chown.test + + * tests/chown.test: Fix the value specified for strace -a parameter. + + Reported-by: Yun-Chih Chen + +diff --git a/tests/chown.test b/tests/chown.test +index 1a94c32..eb356ce 100755 +--- a/tests/chown.test ++++ b/tests/chown.test +@@ -3,4 +3,4 @@ + # Check chown syscall decoding. + + . "${srcdir=.}/init.sh" +-run_strace_match_diff -a29 ++run_strace_match_diff -a28 +diff --git a/tests/chown.test b/tests/chown.test +index 1a94c32..eb356ce 100755 +--- a/tests-m32/chown.test ++++ b/tests-m32/chown.test +@@ -3,4 +3,4 @@ + # Check chown syscall decoding. + + . "${srcdir=.}/init.sh" +-run_strace_match_diff -a29 ++run_strace_match_diff -a28 diff --git a/SOURCES/strace-4.12-vhangup.patch b/SOURCES/strace-4.12-vhangup.patch new file mode 100644 index 0000000..278e0d5 --- /dev/null +++ b/SOURCES/strace-4.12-vhangup.patch @@ -0,0 +1,59 @@ +commit cb44289ee3fd1482d3b8551d2e3b4568eb57e114 +Author: Dmitry V. Levin +Date: Tue Jul 26 10:20:24 2016 +0000 + + tests: fix vhangup.test + + * tests/vhangup.c (main): Fix expected output for the case when + the calling process has CAP_SYS_TTY_CONFIG capability. + + Reported-by: Yun-Chih Chen + +diff --git a/tests/vhangup.c b/tests/vhangup.c +index ba90319..468f334 100644 +--- a/tests/vhangup.c ++++ b/tests/vhangup.c +@@ -13,7 +13,18 @@ main(void) + perror_msg_and_skip("setsid"); + + long rc = syscall(__NR_vhangup); +- printf("vhangup() = %ld %s (%m)\n", rc, errno2name()); ++ ++ /* ++ * On setsid() success, the new session has no controlling terminal, ++ * therefore a subsequent vhangup() has nothing to hangup. ++ * ++ * The system call, however, returns 0 iff the calling process ++ * has CAP_SYS_TTY_CONFIG capability. ++ */ ++ if (rc) ++ printf("vhangup() = %ld %s (%m)\n", rc, errno2name()); ++ else ++ puts("vhangup() = 0"); + + puts("+++ exited with 0 +++"); + return 0; +diff --git a/tests/vhangup.c b/tests/vhangup.c +index ba90319..468f334 100644 +--- a/tests-m32/vhangup.c ++++ b/tests-m32/vhangup.c +@@ -13,7 +13,18 @@ main(void) + perror_msg_and_skip("setsid"); + + long rc = syscall(__NR_vhangup); +- printf("vhangup() = %ld %s (%m)\n", rc, errno2name()); ++ ++ /* ++ * On setsid() success, the new session has no controlling terminal, ++ * therefore a subsequent vhangup() has nothing to hangup. ++ * ++ * The system call, however, returns 0 iff the calling process ++ * has CAP_SYS_TTY_CONFIG capability. ++ */ ++ if (rc) ++ printf("vhangup() = %ld %s (%m)\n", rc, errno2name()); ++ else ++ puts("vhangup() = 0"); + + puts("+++ exited with 0 +++"); + return 0; diff --git a/SOURCES/strace-no-net-tests.patch b/SOURCES/strace-no-net-tests.patch new file mode 100644 index 0000000..8152249 --- /dev/null +++ b/SOURCES/strace-no-net-tests.patch @@ -0,0 +1,98 @@ +Only in b: count.c.orig +Only in b: count.c.rej +diff -rup a/tests/Makefile.am b/tests/Makefile.am +--- a/tests/Makefile.am 2016-05-28 15:31:50.000000000 -0400 ++++ b/tests/Makefile.am 2016-07-22 17:03:00.957064111 -0400 +@@ -492,12 +492,6 @@ DECODER_TESTS = \ + mq.test \ + munlockall.test \ + nanosleep.test \ +- net-icmp_filter.test \ +- net-y-unix.test \ +- net-yy-inet.test \ +- net-yy-netlink.test \ +- net-yy-unix.test \ +- net.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ +diff -rup a/tests/Makefile.in b/tests/Makefile.in +--- a/tests/Makefile.in 2016-05-31 07:35:59.000000000 -0400 ++++ b/tests/Makefile.in 2016-07-22 17:03:05.215079250 -0400 +@@ -2001,12 +2001,6 @@ DECODER_TESTS = \ + mq.test \ + munlockall.test \ + nanosleep.test \ +- net-icmp_filter.test \ +- net-y-unix.test \ +- net-yy-inet.test \ +- net-yy-netlink.test \ +- net-yy-unix.test \ +- net.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ +diff -rup a/tests-m32/Makefile.am b/tests-m32/Makefile.am +--- a/tests-m32/Makefile.am 2016-05-31 07:35:28.000000000 -0400 ++++ b/tests-m32/Makefile.am 2016-07-22 17:02:36.756977946 -0400 +@@ -492,12 +492,6 @@ DECODER_TESTS = \ + mq.test \ + munlockall.test \ + nanosleep.test \ +- net-icmp_filter.test \ +- net-y-unix.test \ +- net-yy-inet.test \ +- net-yy-netlink.test \ +- net-yy-unix.test \ +- net.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ +diff -rup a/tests-m32/Makefile.in b/tests-m32/Makefile.in +--- a/tests-m32/Makefile.in 2016-05-31 07:35:58.000000000 -0400 ++++ b/tests-m32/Makefile.in 2016-07-22 17:02:44.747006419 -0400 +@@ -2001,12 +2001,6 @@ DECODER_TESTS = \ + mq.test \ + munlockall.test \ + nanosleep.test \ +- net-icmp_filter.test \ +- net-y-unix.test \ +- net-yy-inet.test \ +- net-yy-netlink.test \ +- net-yy-unix.test \ +- net.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ +diff -rup a/tests-mx32/Makefile.am b/tests-mx32/Makefile.am +--- a/tests-mx32/Makefile.am 2016-05-31 07:35:29.000000000 -0400 ++++ b/tests-mx32/Makefile.am 2016-07-22 17:02:50.878028251 -0400 +@@ -492,12 +492,6 @@ DECODER_TESTS = \ + mq.test \ + munlockall.test \ + nanosleep.test \ +- net-icmp_filter.test \ +- net-y-unix.test \ +- net-yy-inet.test \ +- net-yy-netlink.test \ +- net-yy-unix.test \ +- net.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ +diff -rup a/tests-mx32/Makefile.in b/tests-mx32/Makefile.in +--- a/tests-mx32/Makefile.in 2016-05-31 07:35:58.000000000 -0400 ++++ b/tests-mx32/Makefile.in 2016-07-22 17:02:56.451048084 -0400 +@@ -2001,12 +2001,6 @@ DECODER_TESTS = \ + mq.test \ + munlockall.test \ + nanosleep.test \ +- net-icmp_filter.test \ +- net-y-unix.test \ +- net-yy-inet.test \ +- net-yy-netlink.test \ +- net-yy-unix.test \ +- net.test \ + newfstatat.test \ + nsyscalls.test \ + old_mmap.test \ diff --git a/SOURCES/strace-no-setgid-rhel6.patch b/SOURCES/strace-no-setgid-rhel6.patch new file mode 100644 index 0000000..e8f2abd --- /dev/null +++ b/SOURCES/strace-no-setgid-rhel6.patch @@ -0,0 +1,44 @@ +diff -rup a/tests/Makefile.am b/tests/Makefile.am +--- a/tests/Makefile.am 2016-08-22 23:14:27.000000000 -0400 ++++ b/tests/Makefile.am 2016-08-22 23:19:32.038554367 -0400 +@@ -551,9 +551,7 @@ DECODER_TESTS = \ + setfsgid32.test \ + setfsuid.test \ + setfsuid32.test \ +- setgid.test \ + setgid32.test \ +- setgroups.test \ + setgroups32.test \ + sethostname.test \ + setregid.test \ +@@ -564,7 +562,6 @@ DECODER_TESTS = \ + setresuid32.test \ + setreuid.test \ + setreuid32.test \ +- setuid.test \ + setuid32.test \ + shmxt.test \ + sigaction.test \ +Only in b/tests: Makefile.am~ +diff -rup a/tests/Makefile.in b/tests/Makefile.in +--- a/tests/Makefile.in 2016-08-22 23:14:27.000000000 -0400 ++++ b/tests/Makefile.in 2016-08-22 23:19:44.907609861 -0400 +@@ -2060,9 +2060,7 @@ DECODER_TESTS = \ + setfsgid32.test \ + setfsuid.test \ + setfsuid32.test \ +- setgid.test \ + setgid32.test \ +- setgroups.test \ + setgroups32.test \ + sethostname.test \ + setregid.test \ +@@ -2073,7 +2071,6 @@ DECODER_TESTS = \ + setresuid32.test \ + setreuid.test \ + setreuid32.test \ +- setuid.test \ + setuid32.test \ + shmxt.test \ + sigaction.test \ +Only in b/tests: Makefile.in~ diff --git a/SOURCES/strace-no-uio-tests.patch b/SOURCES/strace-no-uio-tests.patch new file mode 100644 index 0000000..7d8963b --- /dev/null +++ b/SOURCES/strace-no-uio-tests.patch @@ -0,0 +1,66 @@ +diff -rup a/tests/Makefile.am b/tests/Makefile.am +--- a/tests/Makefile.am 2016-07-22 17:03:00.000000000 -0400 ++++ b/tests/Makefile.am 2016-07-22 17:12:48.577093495 -0400 +@@ -594,7 +594,6 @@ DECODER_TESTS = \ + times.test \ + truncate.test \ + truncate64.test \ +- uio.test \ + umask.test \ + umount.test \ + umount2.test \ +diff -rup a/tests/Makefile.in b/tests/Makefile.in +--- a/tests/Makefile.in 2016-07-22 17:03:05.000000000 -0400 ++++ b/tests/Makefile.in 2016-07-22 17:12:57.945124915 -0400 +@@ -2103,7 +2103,6 @@ DECODER_TESTS = \ + times.test \ + truncate.test \ + truncate64.test \ +- uio.test \ + umask.test \ + umount.test \ + umount2.test \ +diff -rup a/tests-m32/Makefile.am b/tests-m32/Makefile.am +--- a/tests-m32/Makefile.am 2016-07-22 17:02:36.000000000 -0400 ++++ b/tests-m32/Makefile.am 2016-07-22 17:12:09.252961282 -0400 +@@ -594,7 +594,6 @@ DECODER_TESTS = \ + times.test \ + truncate.test \ + truncate64.test \ +- uio.test \ + umask.test \ + umount.test \ + umount2.test \ +diff -rup a/tests-m32/Makefile.in b/tests-m32/Makefile.in +--- a/tests-m32/Makefile.in 2016-07-22 17:02:44.000000000 -0400 ++++ b/tests-m32/Makefile.in 2016-07-22 17:12:22.068004420 -0400 +@@ -2103,7 +2103,6 @@ DECODER_TESTS = \ + times.test \ + truncate.test \ + truncate64.test \ +- uio.test \ + umask.test \ + umount.test \ + umount2.test \ +diff -rup a/tests-mx32/Makefile.am b/tests-mx32/Makefile.am +--- a/tests-mx32/Makefile.am 2016-07-22 17:02:50.000000000 -0400 ++++ b/tests-mx32/Makefile.am 2016-07-22 17:12:31.110034827 -0400 +@@ -594,7 +594,6 @@ DECODER_TESTS = \ + times.test \ + truncate.test \ + truncate64.test \ +- uio.test \ + umask.test \ + umount.test \ + umount2.test \ +diff -rup a/tests-mx32/Makefile.in b/tests-mx32/Makefile.in +--- a/tests-mx32/Makefile.in 2016-07-22 17:02:56.000000000 -0400 ++++ b/tests-mx32/Makefile.in 2016-07-22 17:12:38.169058548 -0400 +@@ -2103,7 +2103,6 @@ DECODER_TESTS = \ + times.test \ + truncate.test \ + truncate64.test \ +- uio.test \ + umask.test \ + umount.test \ + umount2.test \ diff --git a/SOURCES/strace-rh851457.patch b/SOURCES/strace-rh851457.patch new file mode 100644 index 0000000..d5f49d0 --- /dev/null +++ b/SOURCES/strace-rh851457.patch @@ -0,0 +1,241 @@ +diff -Nrup a/defs.h b/defs.h +--- a/defs.h 2016-05-29 20:29:14.000000000 -0400 ++++ b/defs.h 2016-07-22 16:52:17.891092163 -0400 +@@ -294,6 +294,9 @@ struct tcb { + int pid; /* If 0, this tcb is free */ + int qual_flg; /* qual_flags[scno] or DEFAULT_QUAL_FLAGS + RAW */ + int u_error; /* Error code */ ++ int wait_status; /* Status from last wait() */ ++ struct tcb *next_need_service; ++ /* Linked list of tracees found by wait()s */ + long scno; /* System call number */ + long u_arg[MAX_ARGS]; /* System call arguments */ + #if defined(LINUX_MIPSN32) || defined(X32) +diff -Nrup a/strace.c b/strace.c +--- a/strace.c 2016-05-26 11:34:28.000000000 -0400 ++++ b/strace.c 2016-07-22 16:52:17.895092175 -0400 +@@ -2095,17 +2095,40 @@ startup_tcb(struct tcb *tcp) + } + } + ++static int remembered_pid; ++static int remembered_status; ++ + /* Returns true iff the main trace loop has to continue. */ + static bool + trace(void) + { + int pid; ++ struct tcb *tcp; ++ struct tcb *found_tcps; ++ struct tcb **nextp; ++ struct tcb *next; ++ int wnohang = 0; ++ ++ if (remembered_pid) { ++ pid = remembered_pid; ++ remembered_pid = 0; ++ if (debug_flag) ++ fprintf(stderr, " [remembered wait(%#x) = %u]\n", ++ remembered_status, pid); ++ tcp = pid2tcb(pid); /* can't be NULL */ ++ tcp->wait_status = remembered_status; ++ tcp->next_need_service = NULL; ++ found_tcps = tcp; ++ goto process_saved_tcbs; ++ } ++ ++ nextp = &found_tcps; ++ found_tcps = NULL; ++ ++ while (1) { /* RH 851457 - collect tcbs */ + int wait_errno; + int status; +- bool stopped; +- unsigned int sig; + unsigned int event; +- struct tcb *tcp; + struct rusage ru; + + if (interrupted) +@@ -2134,14 +2157,24 @@ trace(void) + + if (interactive) + sigprocmask(SIG_SETMASK, &empty_set, NULL); +- pid = wait4(-1, &status, __WALL, (cflag ? &ru : NULL)); ++ pid = wait4(-1, &status, __WALL | wnohang, (cflag ? &ru : NULL)); + wait_errno = errno; + if (interactive) + sigprocmask(SIG_BLOCK, &blocked_set, NULL); + ++ if (pid <= 0 && wnohang) { ++ /* We had at least one successful ++ * wait() before. We waited ++ * with WNOHANG second time. ++ * Stop collecting more tracees, ++ * process what we already have. ++ */ ++ break; /* out of collect tcbs */ ++ } ++ + if (pid < 0) { + if (wait_errno == EINTR) +- return true; ++ break; /* out of collect tcbs */ + if (nprocs == 0 && wait_errno == ECHILD) + return false; + /* +@@ -2155,7 +2188,7 @@ trace(void) + if (pid == popen_pid) { + if (!WIFSTOPPED(status)) + popen_pid = 0; +- return true; ++ break; /* out of collect tcbs */ + } + + if (debug_flag) +@@ -2167,14 +2200,9 @@ trace(void) + if (!tcp) { + tcp = maybe_allocate_tcb(pid, status); + if (!tcp) +- return true; ++ break; /* out of collect tcbs */ + } + +- if (WIFSTOPPED(status)) +- get_regs(pid); +- else +- clear_regs(); +- + event = (unsigned int) status >> 16; + + if (event == PTRACE_EVENT_EXEC) { +@@ -2198,29 +2226,86 @@ trace(void) + + if (detach_on_execve && !skip_one_b_execve) { + detach(tcp); /* do "-b execve" thingy */ +- return true; ++ break; /* out of collect tcbs */ + } + skip_one_b_execve = 0; + } + +- /* Set current output file */ +- current_tcp = tcp; +- + if (cflag) { + tv_sub(&tcp->dtime, &ru.ru_stime, &tcp->stime); + tcp->stime = ru.ru_stime; + } + ++ /* If we waited and got a stopped task notification, ++ * subsequent wait may return the same pid again, for example, ++ * with SIGKILL notification. SIGKILL kills even stopped tasks. ++ * We must not add it to the list ++ * (one task can't be inserted twice in the list). ++ */ ++ { ++ struct tcb *f = found_tcps; ++ while (f) { ++ if (f == tcp) { ++ remembered_pid = pid; ++ remembered_status = status; ++ goto process_saved_tcbs; ++ } ++ f = f->next_need_service; ++ } ++ } ++ /* It is important to not invert the order of tasks ++ * to process. For one, alloc_tcb() above picks newly forked ++ * threads in some order, processing of them and their parent ++ * should be in the same order, otherwise bad things happen ++ * (misinterpreted SIGSTOPs and such). ++ */ ++ tcp->wait_status = status; ++ *nextp = tcp; ++ nextp = &tcp->next_need_service; ++ *nextp = NULL; ++ wnohang = WNOHANG; ++ ++ } /* RH 851457 - collect tcbs */ ++ ++process_saved_tcbs: ++ ++ for (tcp = found_tcps; ++ tcp; ++ tcp = next) { /* RH 851457 - process tcbs */ ++ int status; ++ bool stopped; ++ unsigned int sig; ++ unsigned int event; ++ ++ /* If the child exits, the TCP will get dropped and ++ thus we can't use it to find the next TCP needing ++ service. So we save the next TCP needing service ++ and used the saved value when the loop iterates. */ ++ next = tcp->next_need_service; ++ ++ status = tcp->wait_status; ++ pid = tcp->pid; ++ ++ event = ((unsigned)status >> 16); ++ ++ if (WIFSTOPPED(status)) ++ get_regs(pid); ++ else ++ clear_regs(); ++ ++ /* Set current output file */ ++ current_tcp = tcp; ++ + if (WIFSIGNALED(status)) { + print_signalled(tcp, pid, status); + droptcb(tcp); +- return true; ++ continue; /* processing tcbs */ + } + + if (WIFEXITED(status)) { + print_exited(tcp, pid, status); + droptcb(tcp); +- return true; ++ continue; /* processing tcbs */ + } + + if (!WIFSTOPPED(status)) { +@@ -2230,7 +2315,7 @@ trace(void) + */ + error_msg("pid %u not stopped!", pid); + droptcb(tcp); +- return true; ++ continue; /* processing tcbs */ + } + + /* Is this the very first time we see this tracee stopped? */ +@@ -2308,7 +2393,7 @@ show_stopsig: + exit_code = 1; + return false; + } +- return true; ++ continue; /* processing tcbs */ + } + /* We don't have PTRACE_LISTEN support... */ + goto restart_tracee; +@@ -2334,7 +2419,7 @@ show_stopsig: + * we can let this process to report its death to us + * normally, via WIFEXITED or WIFSIGNALED wait status. + */ +- return true; ++ continue; /* processing tcbs */ + } + + restart_tracee_with_sig_0: +@@ -2347,6 +2432,8 @@ restart_tracee: + return false; + } + ++ } /* RH 851457 - process tcbs */ ++ + return true; + } + diff --git a/SOURCES/strace-rh921550.patch b/SOURCES/strace-rh921550.patch new file mode 100644 index 0000000..fcd107f --- /dev/null +++ b/SOURCES/strace-rh921550.patch @@ -0,0 +1,18 @@ +diff -rup a/mem.c b/mem.c +--- a/mem.c 2016-05-16 19:47:34.000000000 -0400 ++++ b/mem.c 2016-07-22 17:15:03.874544654 -0400 +@@ -207,6 +207,13 @@ SYS_FUNC(mremap) + return RVAL_DECODED | RVAL_HEX; + } + ++#ifndef MADV_DONTDUMP ++#define MADV_DONTDUMP 16 ++#endif ++#ifndef MADV_DODUMP ++#define MADV_DODUMP 17 ++#endif ++ + #include "xlat/madvise_cmds.h" + + SYS_FUNC(madvise) +Only in b: mem.c.orig diff --git a/SOURCES/strace-rh948577.patch b/SOURCES/strace-rh948577.patch new file mode 100644 index 0000000..7b6268e --- /dev/null +++ b/SOURCES/strace-rh948577.patch @@ -0,0 +1,46 @@ +diff -Nrup a/Makefile.am b/Makefile.am +--- a/Makefile.am 2016-07-22 16:46:33.000000000 -0400 ++++ b/Makefile.am 2016-07-22 16:49:00.260462649 -0400 +@@ -37,7 +37,7 @@ endif + SUBDIRS = tests $(TESTS_M32) $(TESTS_MX32) + + bin_PROGRAMS = strace +-man_MANS = strace.1 ++man_MANS = strace.1 strace-log-merge.1 + bin_SCRIPTS = strace-graph strace-log-merge + + OS = linux +diff -Nrup a/Makefile.in b/Makefile.in +--- a/Makefile.in 2016-07-22 16:46:33.000000000 -0400 ++++ b/Makefile.in 2016-07-22 16:49:00.267462671 -0400 +@@ -610,7 +610,7 @@ top_srcdir = @top_srcdir@ + @HAVE_M32_RUNTIME_TRUE@TESTS_M32 = tests-m32 + @HAVE_MX32_RUNTIME_TRUE@TESTS_MX32 = tests-mx32 + SUBDIRS = tests $(TESTS_M32) $(TESTS_MX32) +-man_MANS = strace.1 ++man_MANS = strace.1 strace-log-merge.1 + bin_SCRIPTS = strace-graph strace-log-merge + OS = linux + # ARCH is `i386', `m68k', `sparc', etc. +diff -Nrup a/strace-log-merge.1 b/strace-log-merge.1 +--- a/strace-log-merge.1 1969-12-31 19:00:00.000000000 -0500 ++++ b/strace-log-merge.1 2016-07-22 16:49:00.268462674 -0400 +@@ -0,0 +1,18 @@ ++.TH strace-log-merge 1 "15 April 2013" ".1" "strace-log-merge" ++.SH NAME ++strace-log-merge ++.SH SYNOPSIS ++strace-log-merge STRACE_LOG ++.SH DESCRIPTION ++strace-log-merge finds all STRACE_LOG.PID files, adds PID prefix to every line, ++the combines and sorts them, and prints the result to standard output. ++ ++It is assumed that STRACE_LOGs were produced by strace with the -tt[t] ++option which prints timestamps (otherwise worting won't do any good). ++ ++.SH OPTIONS ++--help Show help ++ ++.SH SEE ALSO ++.SH BUGS ++ diff --git a/SOURCES/strace-rpmbuild-m64.patch b/SOURCES/strace-rpmbuild-m64.patch new file mode 100644 index 0000000..cfd6ee2 --- /dev/null +++ b/SOURCES/strace-rpmbuild-m64.patch @@ -0,0 +1,28 @@ +diff -rup a/configure b/configure +--- a/configure 2016-05-31 07:35:55.000000000 -0400 ++++ b/configure 2016-08-25 18:50:02.732609963 -0400 +@@ -2585,6 +2585,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ++CFLAGS=`echo "" "$CFLAGS" | sed 's/ -m64 / /g'` ++CXXFLAGS=`echo "" "$CXXFLAGS" | sed 's/ -m64 / /g'` ++ ++ + ac_aux_dir= + for ac_dir in . "$srcdir"/.; do + if test -f "$ac_dir/install-sh"; then +diff -rup a/configure.ac b/configure.ac +--- a/configure.ac 2016-05-26 10:44:13.000000000 -0400 ++++ b/configure.ac 2016-08-25 18:49:37.072638055 -0400 +@@ -33,6 +33,10 @@ AC_PREREQ(2.57) + AC_INIT([strace], + m4_esyscmd([./git-version-gen .tarball-version]), + [strace-devel@lists.sourceforge.net]) ++ ++CFLAGS=`echo "" "$CFLAGS" | sed 's/ -m64 / /g'` ++CXXFLAGS=`echo "" "$CXXFLAGS" | sed 's/ -m64 / /g'` ++ + AC_CONFIG_SRCDIR([strace.c]) + AC_CONFIG_AUX_DIR([.]) + AC_CONFIG_HEADERS([config.h]) diff --git a/SOURCES/strace-strict-aliasing.patch b/SOURCES/strace-strict-aliasing.patch new file mode 100644 index 0000000..ce1246b --- /dev/null +++ b/SOURCES/strace-strict-aliasing.patch @@ -0,0 +1,24 @@ +diff -rup a/Makefile.am b/Makefile.am +--- a/Makefile.am 2016-05-28 06:29:30.000000000 -0400 ++++ b/Makefile.am 2016-07-22 16:46:33.499983037 -0400 +@@ -45,7 +45,7 @@ OS = linux + ARCH = @arch@ + + ACLOCAL_AMFLAGS = -I m4 +-AM_CFLAGS = $(WARN_CFLAGS) ++AM_CFLAGS = $(WARN_CFLAGS) -fno-strict-aliasing + AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \ + -I$(srcdir)/$(OS)/$(ARCH) \ + -I$(builddir)/$(OS) \ +diff -rup a/Makefile.in b/Makefile.in +--- a/Makefile.in 2016-05-31 07:35:57.000000000 -0400 ++++ b/Makefile.in 2016-07-22 16:46:33.509983070 -0400 +@@ -616,7 +616,7 @@ OS = linux + # ARCH is `i386', `m68k', `sparc', etc. + ARCH = @arch@ + ACLOCAL_AMFLAGS = -I m4 +-AM_CFLAGS = $(WARN_CFLAGS) ++AM_CFLAGS = $(WARN_CFLAGS) -fno-strict-aliasing + AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \ + -I$(srcdir)/$(OS)/$(ARCH) \ + -I$(builddir)/$(OS) \ diff --git a/SPECS/strace.spec b/SPECS/strace.spec new file mode 100644 index 0000000..c4c9a3f --- /dev/null +++ b/SPECS/strace.spec @@ -0,0 +1,156 @@ +%{?scl:%{?scl_package:%scl_package strace}} + +Summary: Tracks and displays system calls associated with a running process +Name: %{?scl_prefix}strace +Version: 4.12 +Release: 3%{?dist} +License: BSD +Group: Development/Debuggers +URL: http://sourceforge.net/projects/strace/ +# The upstream source really comes in .xz format. Unfortunately +# DTS builds using .xz seem to want to use /opt/rh/<...>/xz rather +# than the one in /usr/bin. Using the .gz extension seems to avoid +# this problem. This should be fixed at some point. +Source: http://downloads.sourceforge.net/strace/strace-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%define alternatives_cmd %{!?scl:%{_sbindir}}%{?scl:%{_root_sbindir}}/alternatives +%define alternatives_cmdline %{alternatives_cmd}%{?scl: --altdir %{_sysconfdir}/alternatives --admindir %{_scl_root}/var/lib/alternatives} + +BuildRequires: libacl-devel, time +%{?scl:Requires:%scl_runtime} + +Patch1000: strace-strict-aliasing.patch +Patch1001: strace-rh948577.patch +Patch1002: strace-rh851457.patch +Patch1005: strace-no-net-tests.patch +Patch1007: strace-no-uio-tests.patch + +# Hack as the RHEL 6 used for DTS is too old and doesn't define MADV_DODUMP +# and MADV_DONTDUMP. +Patch2000: strace-rh921550.patch + +Patch2001: strace-4.12-vhangup.patch +Patch2002: strace-4.12-chown.patch + +Patch3000: strace-no-setgid-rhel6.patch +Patch3001: strace-rpmbuild-m64.patch + +# In the past we had a separate strace64 package, these days the +# stndard 64 bit build provides that functionality. For tracing +# 32 bit applications on ppc and s390 we still have strace32 +Obsoletes: strace64 + +%define strace32_arches ppc s390 + +%description +The strace program intercepts and records the system calls called and +received by a running process. Strace can print a record of each +system call, its arguments and its return value. Strace is useful for +diagnosing problems and debugging, as well as for instructional +purposes. + +Install strace if you need a tool to track the system calls made and +received by a process. + +%ifarch %{strace32_arches} +%package -n strace32 +Summary: Tracks and displays system calls associated with a running process. +Group: Development/Debuggers + +%description -n strace32 +The strace program intercepts and records the system calls called and +received by a running process. Strace can print a record of each +system call, its arguments and its return value. Strace is useful for +diagnosing problems and debugging, as well as for instructional +purposes. + +Install strace if you need a tool to track the system calls made and +received by a process. + +This package provides the `strace32' program to trace 32-bit processes on +64-bit IBM P and Z series platforms. +%endif + +%prep +%setup -q -n strace-%{version} +%patch1000 -p1 +%patch1001 -p1 +%patch1002 -p1 +%patch1005 -p1 +%patch1007 -p1 +%patch2000 -p1 +%patch2001 -p1 +%patch2002 -p1 +%if 0%{?rhel} == 6 +%patch3000 -p1 +%endif +%patch3001 -p1 + +%build +%configure +make %{?_smp_mflags} + +%install +rm -rf %{buildroot} +make DESTDIR=%{buildroot} install + +# remove unpackaged files from the buildroot +rm -f %{buildroot}%{_bindir}/strace-graph + +%define copy64 ln +%if 0%{?rhel} +%if 0%{?rhel} < 6 +%endif +%define copy64 cp -p +%endif + +%ifarch %{strace32_arches} +%{copy64} %{buildroot}%{_bindir}/strace %{buildroot}%{_bindir}/strace32 +%endif + +%check +# Temporary until we dig deeper into the failures +%ifnarch s390x ppc64 +make -k check +%endif + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%doc CREDITS ChangeLog ChangeLog-CVS COPYING NEWS README +%{_bindir}/strace +%{_bindir}/strace-log-merge +%{_mandir}/man1/* + +%ifarch %{strace32_arches} +%files -n strace32 +%defattr(-,root,root) +%{_bindir}/strace32 +%endif + +%changelog +* Fri Aug 12 2016 DJ Delorie - 4.12-3 +- Merge upstream patches for vhangup and chown +- Skip some tests on older kernels (RHEL 6) +- Remove -m64 that rpm macros adds +- Duplicate vhangup/chown patch for -m32 also. + +* Wed Jul 27 2016 Jeff Law - 4.12-2 +- Disable testing on s390x and ppc64 until we can determine + root causes of their failures. + +* Thu Jul 21 2016 DJ Delorie - 4.12-1 +- Rebase to fc24's 4.12 + +* Wed Aug 5 2015 DJ Delorie - 4.10-2 +- Add --re-interval to caps tests also + +* Fri Jul 17 2015 DJ Delorie - 4.10-1 +- Rebase to fc23's 4.10 + +* Wed May 21 2014 Jeff Law - 4.8-8 +- Import from RHEL 7 and build +