diff --git a/.devtoolset-8-strace.metadata b/.devtoolset-8-strace.metadata new file mode 100644 index 0000000..f4ff447 --- /dev/null +++ b/.devtoolset-8-strace.metadata @@ -0,0 +1 @@ +09a8c9638fd02622157af9d744ad7c7f991c75df SOURCES/strace-4.24.tar.xz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ff7544b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/strace-4.24.tar.xz 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-provide-O_TMPFILE-fallback-definition.patch b/SOURCES/strace-provide-O_TMPFILE-fallback-definition.patch new file mode 100644 index 0000000..275e23e --- /dev/null +++ b/SOURCES/strace-provide-O_TMPFILE-fallback-definition.patch @@ -0,0 +1,19 @@ +Some buildroots provide version of kernel-headers package that do not yet +contains O_TMPFILE definition. Since (looks like) there were none discrepancies +in O_TMPFILE definition in RHEL, work that around by providing a fallback +definition of O_TMPFILE. +Index: strace-4.24/open.c +=================================================================== +--- strace-4.24.orig/open.c 2018-08-09 01:27:06.000000000 +0200 ++++ strace-4.24/open.c 2018-08-23 13:17:20.666260200 +0200 +@@ -48,6 +48,10 @@ + # endif + #endif + ++#ifndef O_TMPFILE ++# define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) ++#endif ++ + #include "xlat/open_access_modes.h" + #include "xlat/open_mode_flags.h" + diff --git a/SOURCES/strace-rhbz1610774-0000-strace.c-introduce-struct-tcb_wait_data.patch b/SOURCES/strace-rhbz1610774-0000-strace.c-introduce-struct-tcb_wait_data.patch new file mode 100644 index 0000000..3e8aaeb --- /dev/null +++ b/SOURCES/strace-rhbz1610774-0000-strace.c-introduce-struct-tcb_wait_data.patch @@ -0,0 +1,291 @@ +From 14ae61f37b7c4ec236f011ab5c5866b43f6766b4 Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Tue, 14 Aug 2018 13:43:34 +0000 +Subject: [PATCH] strace.c: introduce struct tcb_wait_data + +Introduce a new structure to pass information between next_event(), +restart_delayed_tcb(), and dispatch_event(). + +This is going to be used by a subsequent change of next_event(). + +* strace.c (struct tcb_wait_data): New type. +(next_event): Remove parameters, return a pointer +to const struct tcb_wait_data. Return NULL instead of TE_BREAK. +(dispatch_event): Replace all parameters with a pointer +to const struct tcb_wait_data, obtain the trace event, siginfo, +and status from its fields. +(restart_delayed_tcb): Add local struct tcb_wait_data variable +with te field set to TE_RESTART, pass it to dispatch_event(). +(main): Remove status and si variables, update next_event() +and dispatch_event() invocations. + +Co-Authored-by: Eugene Syromyatnikov +--- + strace.c | 107 ++++++++++++++++++++++++++++++++++++++++----------------------- + 1 file changed, 69 insertions(+), 38 deletions(-) + +diff --git a/strace.c b/strace.c +index cd04b98..6d70d20 100644 +--- a/strace.c ++++ b/strace.c +@@ -158,6 +158,12 @@ static bool open_append; + struct tcb *printing_tcp; + static struct tcb *current_tcp; + ++struct tcb_wait_data { ++ enum trace_event te; /**< Event passed to dispatch_event() */ ++ int status; /**< status, returned by wait4() */ ++ siginfo_t si; /**< siginfo, returned by PTRACE_GETSIGINFO */ ++}; ++ + static struct tcb **tcbtab; + static unsigned int nprocs; + static size_t tcbtabsize; +@@ -2226,16 +2232,19 @@ print_event_exit(struct tcb *tcp) + line_ended(); + } + +-static enum trace_event +-next_event(int *pstatus, siginfo_t *si) ++static const struct tcb_wait_data * ++next_event(void) + { ++ static struct tcb_wait_data wait_data; ++ + int pid; + int status; + struct tcb *tcp; ++ struct tcb_wait_data *wd = &wait_data; + struct rusage ru; + + if (interrupted) +- return TE_BREAK; ++ return NULL; + + /* + * Used to exit simply when nprocs hits zero, but in this testcase: +@@ -2255,7 +2264,7 @@ next_event(int *pstatus, siginfo_t *si) + * on exit. Oh well... + */ + if (nprocs == 0) +- return TE_BREAK; ++ return NULL; + } + + const bool unblock_delay_timer = is_delay_timer_armed(); +@@ -2278,7 +2287,7 @@ next_event(int *pstatus, siginfo_t *si) + * then the system call will be interrupted and + * the expiration will be handled by the signal handler. + */ +- pid = wait4(-1, pstatus, __WALL, (cflag ? &ru : NULL)); ++ pid = wait4(-1, &status, __WALL, (cflag ? &ru : NULL)); + const int wait_errno = errno; + + /* +@@ -2292,14 +2301,16 @@ next_event(int *pstatus, siginfo_t *si) + sigprocmask(SIG_BLOCK, &timer_set, NULL); + + if (restart_failed) +- return TE_BREAK; ++ return NULL; + } + + if (pid < 0) { +- if (wait_errno == EINTR) +- return TE_NEXT; ++ if (wait_errno == EINTR) { ++ wd->te = TE_NEXT; ++ return wd; ++ } + if (nprocs == 0 && wait_errno == ECHILD) +- return TE_BREAK; ++ return NULL; + /* + * If nprocs > 0, ECHILD is not expected, + * treat it as any other error here: +@@ -2308,12 +2319,13 @@ next_event(int *pstatus, siginfo_t *si) + perror_msg_and_die("wait4(__WALL)"); + } + +- status = *pstatus; ++ wd->status = status; + + if (pid == popen_pid) { + if (!WIFSTOPPED(status)) + popen_pid = 0; +- return TE_NEXT; ++ wd->te = TE_NEXT; ++ return wd; + } + + if (debug_flag) +@@ -2324,8 +2336,10 @@ next_event(int *pstatus, siginfo_t *si) + + if (!tcp) { + tcp = maybe_allocate_tcb(pid, status); +- if (!tcp) +- return TE_NEXT; ++ if (!tcp) { ++ wd->te = TE_NEXT; ++ return wd; ++ } + } + + clear_regs(tcp); +@@ -2342,11 +2356,15 @@ next_event(int *pstatus, siginfo_t *si) + tcp->stime = stime; + } + +- if (WIFSIGNALED(status)) +- return TE_SIGNALLED; ++ if (WIFSIGNALED(status)) { ++ wd->te = TE_SIGNALLED; ++ return wd; ++ } + +- if (WIFEXITED(status)) +- return TE_EXITED; ++ if (WIFEXITED(status)) { ++ wd->te = TE_EXITED; ++ return wd; ++ } + + /* + * As WCONTINUED flag has not been specified to wait4, +@@ -2373,19 +2391,19 @@ next_event(int *pstatus, siginfo_t *si) + if (sig == SIGSTOP && (tcp->flags & TCB_IGNORE_ONE_SIGSTOP)) { + debug_func_msg("ignored SIGSTOP on pid %d", tcp->pid); + tcp->flags &= ~TCB_IGNORE_ONE_SIGSTOP; +- return TE_RESTART; ++ wd->te = TE_RESTART; + } else if (sig == syscall_trap_sig) { +- return TE_SYSCALL_STOP; ++ wd->te = TE_SYSCALL_STOP; + } else { +- *si = (siginfo_t) {}; ++ memset(&wd->si, 0, sizeof(wd->si)); + /* + * True if tracee is stopped by signal + * (as opposed to "tracee received signal"). + * TODO: shouldn't we check for errno == EINVAL too? + * We can get ESRCH instead, you know... + */ +- bool stopped = ptrace(PTRACE_GETSIGINFO, pid, 0, si) < 0; +- return stopped ? TE_GROUP_STOP : TE_SIGNAL_DELIVERY_STOP; ++ bool stopped = ptrace(PTRACE_GETSIGINFO, pid, 0, &wd->si) < 0; ++ wd->te = stopped ? TE_GROUP_STOP : TE_SIGNAL_DELIVERY_STOP; + } + break; + case PTRACE_EVENT_STOP: +@@ -2398,16 +2416,23 @@ next_event(int *pstatus, siginfo_t *si) + case SIGTSTP: + case SIGTTIN: + case SIGTTOU: +- return TE_GROUP_STOP; ++ wd->te = TE_GROUP_STOP; ++ break; ++ default: ++ wd->te = TE_RESTART; + } +- return TE_RESTART; ++ break; + case PTRACE_EVENT_EXEC: +- return TE_STOP_BEFORE_EXECVE; ++ wd->te = TE_STOP_BEFORE_EXECVE; ++ break; + case PTRACE_EVENT_EXIT: +- return TE_STOP_BEFORE_EXIT; ++ wd->te = TE_STOP_BEFORE_EXIT; ++ break; + default: +- return TE_RESTART; ++ wd->te = TE_RESTART; + } ++ ++ return wd; + } + + static int +@@ -2436,12 +2461,18 @@ trace_syscall(struct tcb *tcp, unsigned int *sig) + + /* Returns true iff the main trace loop has to continue. */ + static bool +-dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si) ++dispatch_event(const struct tcb_wait_data *wd) + { + unsigned int restart_op = PTRACE_SYSCALL; + unsigned int restart_sig = 0; ++ enum trace_event te = wd ? wd->te : TE_BREAK; ++ /* ++ * Copy wd->status to a non-const variable to workaround glibc bugs ++ * around union wait fixed by glibc commit glibc-2.24~391 ++ */ ++ int status = wd ? wd->status : 0; + +- switch (ret) { ++ switch (te) { + case TE_BREAK: + return false; + +@@ -2469,17 +2500,17 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si) + break; + + case TE_SIGNAL_DELIVERY_STOP: +- restart_sig = WSTOPSIG(*pstatus); +- print_stopped(current_tcp, si, restart_sig); ++ restart_sig = WSTOPSIG(status); ++ print_stopped(current_tcp, &wd->si, restart_sig); + break; + + case TE_SIGNALLED: +- print_signalled(current_tcp, current_tcp->pid, *pstatus); ++ print_signalled(current_tcp, current_tcp->pid, status); + droptcb(current_tcp); + return true; + + case TE_GROUP_STOP: +- restart_sig = WSTOPSIG(*pstatus); ++ restart_sig = WSTOPSIG(status); + print_stopped(current_tcp, NULL, restart_sig); + if (use_seize) { + /* +@@ -2494,7 +2525,7 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si) + break; + + case TE_EXITED: +- print_exited(current_tcp, current_tcp->pid, *pstatus); ++ print_exited(current_tcp, current_tcp->pid, status); + droptcb(current_tcp); + return true; + +@@ -2577,13 +2608,15 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si) + static bool + restart_delayed_tcb(struct tcb *const tcp) + { ++ const struct tcb_wait_data wd = { .te = TE_RESTART }; ++ + debug_func_msg("pid %d", tcp->pid); + + tcp->flags &= ~TCB_DELAYED; + + struct tcb *const prev_tcp = current_tcp; + current_tcp = tcp; +- bool ret = dispatch_event(TE_RESTART, NULL, NULL); ++ bool ret = dispatch_event(&wd); + current_tcp = prev_tcp; + + return ret; +@@ -2694,9 +2727,7 @@ main(int argc, char *argv[]) + + exit_code = !nprocs; + +- int status; +- siginfo_t si; +- while (dispatch_event(next_event(&status, &si), &status, &si)) ++ while (dispatch_event(next_event())) + ; + terminate(); + } +-- +2.1.4 + diff --git a/SOURCES/strace-rhbz1610774-0001-tests-check-tracing-of-looping-threads.patch b/SOURCES/strace-rhbz1610774-0001-tests-check-tracing-of-looping-threads.patch new file mode 100644 index 0000000..c684cda --- /dev/null +++ b/SOURCES/strace-rhbz1610774-0001-tests-check-tracing-of-looping-threads.patch @@ -0,0 +1,299 @@ +From 1e497a53b82bae846618e3b9064d6c4a63024aea Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Wed, 4 Jul 2018 02:11:27 +0000 +Subject: [PATCH 1/3] tests: check tracing of looping threads + +* test/many_looping_threads.c: Remove. +* test/.gitignore: Remove many_looping_threads. +* test/Makefile (PROGS): Likewise. +(many_looping_threads): Remove. +* tests/looping_threads.c: New file. +* tests/looping_threads.test: New test. +* tests/.gitignore: Add looping_threads. +* tests/Makefile.am (check_PROGRAMS): Likewise. +(looping_threads_LDADD): New variable. +(MISC_TESTS, XFAIL_TESTS): Add looping_threads.test. +--- + test/.gitignore | 1 - + test/Makefile | 5 +- + test/many_looping_threads.c | 49 -------------------- + tests/.gitignore | 1 + + tests/Makefile.am | 6 ++- + tests/looping_threads.c | 110 ++++++++++++++++++++++++++++++++++++++++++++ + tests/looping_threads.test | 37 +++++++++++++++ + 7 files changed, 154 insertions(+), 55 deletions(-) + delete mode 100644 test/many_looping_threads.c + create mode 100644 tests/looping_threads.c + create mode 100755 tests/looping_threads.test + +Index: strace-4.24/tests/Makefile.am +=================================================================== +--- strace-4.24.orig/tests/Makefile.am 2018-09-12 23:52:54.858953939 +0200 ++++ strace-4.24/tests/Makefile.am 2018-09-13 00:44:12.638097032 +0200 +@@ -127,6 +127,7 @@ + ksysent \ + list_sigaction_signum \ + localtime \ ++ looping_threads \ + mmsg-silent \ + mmsg_name-v \ + msg_control-v \ +@@ -190,6 +191,7 @@ + fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 + ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 + localtime_LDADD = $(clock_LIBS) $(LDADD) ++looping_threads_LDADD = -lpthread $(LDADD) + lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 + mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 + mmap64_Xabbrev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +@@ -321,6 +323,7 @@ + interactive_block.test \ + ksysent.test \ + localtime.test \ ++ looping_threads.test \ + opipe.test \ + options-syntax.test \ + pc.test \ +@@ -364,7 +367,8 @@ + XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS) + XFAIL_TESTS_x86_64 = int_0x80.gen.test + XFAIL_TESTS_x32 = int_0x80.gen.test +-XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) ++XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) \ ++ looping_threads.test + + TEST_LOG_COMPILER = env + AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \ +Index: strace-4.24/tests/looping_threads.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-4.24/tests/looping_threads.c 2018-09-12 23:53:31.739527473 +0200 +@@ -0,0 +1,110 @@ ++/* ++ * Check tracing of looping threads. ++ * ++ * Copyright (c) 2009-2018 The strace developers. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include "tests.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static void * ++thread(void *arg) ++{ ++ for (;;) ++ getuid(); ++ return arg; ++} ++ ++int ++main(int ac, const char *av[]) ++{ ++ assert(ac == 3); ++ ++ int timeout = atoi(av[1]); ++ assert(timeout > 0); ++ ++ int num_threads = atoi(av[2]); ++ assert(num_threads > 0); ++ ++ /* Create a new process group. */ ++ if (setpgid(0, 0)) ++ perror_msg_and_fail("setpgid"); ++ ++ /* ++ * When the main process terminates, the process group becomes orphaned. ++ * If any member of the orphaned process group is stopped, then ++ * a SIGHUP signal followed by a SIGCONT signal is sent to each process ++ * in the orphaned process group. ++ * Create a process in a stopped state to activate this behaviour. ++ */ ++ pid_t stopped = fork(); ++ if (stopped < 0) ++ perror_msg_and_fail("fork"); ++ if (!stopped) { ++ raise(SIGSTOP); ++ _exit(0); ++ } ++ ++ const sigset_t set = {}; ++ const struct sigaction act = { .sa_handler = SIG_DFL }; ++ if (sigaction(SIGALRM, &act, NULL)) ++ perror_msg_and_fail("sigaction"); ++ if (sigprocmask(SIG_SETMASK, &set, NULL)) ++ perror_msg_and_fail("sigprocmask"); ++ alarm(timeout); ++ ++ /* ++ * Create all threads in a subprocess, this guarantees that ++ * their tracer will not be their parent. ++ */ ++ pid_t pid = fork(); ++ if (pid < 0) ++ perror_msg_and_fail("fork"); ++ if (!pid) { ++ for (int i = 0; i < num_threads; i++) { ++ pthread_t t; ++ if ((errno = pthread_create(&t, NULL, thread, NULL))) ++ perror_msg_and_fail("pthread_create #%d", i); ++ } ++ ++ /* This terminates all threads. */ ++ _exit(0); ++ } ++ ++ int s; ++ if (waitpid(pid, &s, 0) != pid) ++ perror_msg_and_fail("waitpid"); ++ ++ assert(WIFEXITED(s)); ++ return WEXITSTATUS(s); ++} +Index: strace-4.24/tests/looping_threads.test +new file mode 0755 +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-4.24/tests/looping_threads.test 2018-09-12 23:53:31.740527461 +0200 +@@ -0,0 +1,37 @@ ++#!/bin/sh ++# ++# Check tracing of looping threads. ++# ++# Copyright (c) 2009-2018 The strace developers. ++# All rights reserved. ++# ++# Redistribution and use in source and binary forms, with or without ++# modification, are permitted provided that the following conditions ++# are met: ++# 1. Redistributions of source code must retain the above copyright ++# notice, this list of conditions and the following disclaimer. ++# 2. Redistributions in binary form must reproduce the above copyright ++# notice, this list of conditions and the following disclaimer in the ++# documentation and/or other materials provided with the distribution. ++# 3. The name of the author may not be used to endorse or promote products ++# derived from this software without specific prior written permission. ++# ++# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ ++. "${srcdir=.}/init.sh" ++ ++check_prog nproc ++timeout="$(($TIMEOUT_DURATION/10))" ++nproc="$((64+$timeout+$(nproc)))" ++ ++run_prog "../$NAME" "$timeout" "$nproc" ++run_strace -f -qq -enone -esignal=none $args +Index: strace-4.24/tests/Makefile.in +=================================================================== +--- strace-4.24.orig/tests/Makefile.in 2018-08-14 02:44:39.000000000 +0200 ++++ strace-4.24/tests/Makefile.in 2018-09-13 00:51:18.191618128 +0200 +@@ -155,7 +155,7 @@ + ioctl_perf-success$(EXEEXT) ioctl_rtc-v$(EXEEXT) \ + is_linux_mips_n64$(EXEEXT) ksysent$(EXEEXT) \ + list_sigaction_signum$(EXEEXT) localtime$(EXEEXT) \ +- mmsg-silent$(EXEEXT) mmsg_name-v$(EXEEXT) \ ++ looping_threads$(EXEEXT) mmsg-silent$(EXEEXT) mmsg_name-v$(EXEEXT) \ + msg_control-v$(EXEEXT) net-accept-connect$(EXEEXT) \ + net-tpacket_stats-success$(EXEEXT) netlink_inet_diag$(EXEEXT) \ + netlink_netlink_diag$(EXEEXT) netlink_unix_diag$(EXEEXT) \ +@@ -1221,6 +1221,9 @@ + lookup_dcookie_OBJECTS = lookup_dcookie.$(OBJEXT) + lookup_dcookie_LDADD = $(LDADD) + lookup_dcookie_DEPENDENCIES = libtests.a ++looping_threads_SOURCES = looping_threads.c ++looping_threads_OBJECTS = looping_threads.$(OBJEXT) ++looping_threads_DEPENDENCIES = $(LDADD) + lseek_SOURCES = lseek.c + lseek_OBJECTS = lseek.$(OBJEXT) + lseek_LDADD = $(LDADD) +@@ -2743,7 +2746,7 @@ + kexec_file_load.c kexec_load.c keyctl.c keyctl-Xabbrev.c \ + keyctl-Xraw.c keyctl-Xverbose.c kill.c ksysent.c lchown.c \ + lchown32.c link.c linkat.c list_sigaction_signum.c llseek.c \ +- localtime.c lookup_dcookie.c lseek.c lstat.c lstat64.c \ ++ localtime.c lookup_dcookie.c looping_threads.c lseek.c lstat.c lstat64.c \ + madvise.c mbind.c membarrier.c memfd_create.c migrate_pages.c \ + mincore.c mkdir.c mkdirat.c mknod.c mknodat.c mlock.c mlock2.c \ + mlockall.c mmap.c mmap-Xabbrev.c mmap-Xraw.c mmap-Xverbose.c \ +@@ -2888,7 +2891,7 @@ + kexec_file_load.c kexec_load.c keyctl.c keyctl-Xabbrev.c \ + keyctl-Xraw.c keyctl-Xverbose.c kill.c ksysent.c lchown.c \ + lchown32.c link.c linkat.c list_sigaction_signum.c llseek.c \ +- localtime.c lookup_dcookie.c lseek.c lstat.c lstat64.c \ ++ localtime.c lookup_dcookie.c looping_threads.c lseek.c lstat.c lstat64.c \ + madvise.c mbind.c membarrier.c memfd_create.c migrate_pages.c \ + mincore.c mkdir.c mkdirat.c mknod.c mknodat.c mlock.c mlock2.c \ + mlockall.c mmap.c mmap-Xabbrev.c mmap-Xraw.c mmap-Xverbose.c \ +@@ -3911,6 +3914,7 @@ + fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 + ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 + localtime_LDADD = $(clock_LIBS) $(LDADD) ++looping_threads_LDADD = -lpthread $(LDADD) + lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 + mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 + mmap64_Xabbrev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +@@ -4229,6 +4233,7 @@ + interactive_block.test \ + ksysent.test \ + localtime.test \ ++ looping_threads.test \ + opipe.test \ + options-syntax.test \ + pc.test \ +@@ -5226,6 +5231,10 @@ + @rm -f lookup_dcookie$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lookup_dcookie_OBJECTS) $(lookup_dcookie_LDADD) $(LIBS) + ++looping_threads$(EXEEXT): $(looping_threads_OBJECTS) $(looping_threads_DEPENDENCIES) $(EXTRA_looping_threads_DEPENDENCIES) ++ @rm -f looping_threads$(EXEEXT) ++ $(AM_V_CCLD)$(LINK) $(looping_threads_OBJECTS) $(looping_threads_LDADD) $(LIBS) ++ + lseek$(EXEEXT): $(lseek_OBJECTS) $(lseek_DEPENDENCIES) $(EXTRA_lseek_DEPENDENCIES) + @rm -f lseek$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(lseek_OBJECTS) $(lseek_LDADD) $(LIBS) +@@ -6890,6 +6899,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/llseek.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localtime.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup_dcookie.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/looping_threads.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat64-lstat64.Po@am__quote@ diff --git a/SOURCES/strace-rhbz1610774-0002-Add-a-generic-list-implementation.patch b/SOURCES/strace-rhbz1610774-0002-Add-a-generic-list-implementation.patch new file mode 100644 index 0000000..2d3bbab --- /dev/null +++ b/SOURCES/strace-rhbz1610774-0002-Add-a-generic-list-implementation.patch @@ -0,0 +1,213 @@ +From a5855e84f17181167754caa26280161cd786a386 Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Sun, 11 Sep 2016 12:11:45 +0300 +Subject: [PATCH 2/3] Add a generic list implementation + +Similar to one used in the Linux kernel. + +* macros.h (cast_ptr, containerof): New macros. +* list.h: New file. +* Makefile.am (strace_SOURCES): Add it. +--- + Makefile.am | 1 + + list.h | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + macros.h | 9 ++++ + 3 files changed, 147 insertions(+) + create mode 100644 list.h + +Index: strace-4.24/Makefile.am +=================================================================== +--- strace-4.24.orig/Makefile.am 2018-09-13 00:07:30.798555060 +0200 ++++ strace-4.24/Makefile.am 2018-09-13 00:42:10.058675213 +0200 +@@ -185,6 +185,7 @@ + linux/asm_stat.h \ + linux/x32/asm_stat.h \ + linux/x86_64/asm_stat.h \ ++ list.h \ + listen.c \ + lookup_dcookie.c \ + loop.c \ +Index: strace-4.24/list.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-4.24/list.h 2018-09-13 00:42:10.059675201 +0200 +@@ -0,0 +1,137 @@ ++/* ++ * Some simple implementation of a list similar to one used in the kernel. ++ * ++ * Copyright (c) 2016-2018 The strace developers. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef STRACE_LIST_H ++#define STRACE_LIST_H ++ ++#include "macros.h" ++ ++struct list_item { ++ struct list_item *prev; ++ struct list_item *next; ++}; ++ ++#define EMPTY_LIST(l_) struct list_item l_ = { &l_, &l_ } ++ ++static inline void ++list_init(struct list_item *l) ++{ ++ l->prev = l; ++ l->next = l; ++} ++ ++static inline bool ++list_is_empty(struct list_item *l) ++{ ++ return (l->next == l) && (l->prev == l); ++} ++ ++#define list_elem(var, type, field) containerof((var), type, field) ++ ++#define list_head(head, type, field) \ ++ (list_is_empty(head) ? NULL : list_elem((head)->next, type, field)) ++#define list_tail(head, type, field) \ ++ (list_is_empty(head) ? NULL : list_elem((head)->prev, type, field)) ++ ++#define list_next(val, field) \ ++ list_elem((val)->field.next, typeof(*(val)), field) ++#define list_prev(val, field) \ ++ list_elem((val)->field.prev, typeof(*(val)), field) ++ ++static inline void ++list_insert(struct list_item *head, struct list_item *item) ++{ ++ item->next = head->next; ++ item->prev = head; ++ head->next->prev = item; ++ head->next = item; ++} ++ ++static inline void ++list_append(struct list_item *head, struct list_item *item) ++{ ++ item->next = head; ++ item->prev = head->prev; ++ head->prev->next = item; ++ head->prev = item; ++} ++ ++static inline void ++list_remove(struct list_item *item) ++{ ++ if (!item->next || !item->prev) ++ return; ++ ++ item->prev->next = item->next; ++ item->next->prev = item->prev; ++ item->next = item->prev = NULL; ++} ++ ++static inline struct list_item * ++list_remove_tail(struct list_item *head) ++{ ++ struct list_item *t = list_is_empty(head) ? NULL : head->prev; ++ ++ if (t) ++ list_remove(t); ++ ++ return t; ++} ++ ++static inline struct list_item * ++list_remove_head(struct list_item *head) ++{ ++ struct list_item *h = list_is_empty(head) ? NULL : head->next; ++ ++ if (h) ++ list_remove(h); ++ ++ return h; ++} ++ ++static inline void ++list_replace(struct list_item *old, struct list_item *new) ++{ ++ new->next = old->next; ++ new->prev = old->prev; ++ old->prev->next = new; ++ old->next->prev = new; ++ old->next = old->prev = NULL; ++} ++ ++#define list_foreach(var_, head_, field_) \ ++ for (var_ = list_elem((head_)->next, typeof(*var_), field_); \ ++ &(var_->field_) != (head_); var_ = list_next(var_, field_)) ++ ++#define list_foreach_safe(var_, head_, field_, _tmp) \ ++ for (var_ = list_elem((head_)->next, typeof(*var_), field_), \ ++ _tmp = list_elem((var_)->field_.next, typeof(*var_), field_); \ ++ &var_->field_ != head_; var_ = _tmp, _tmp = list_next(_tmp, field_)) ++ ++#endif /* !STRACE_LIST_H */ +Index: strace-4.24/macros.h +=================================================================== +--- strace-4.24.orig/macros.h 2018-09-13 00:07:30.798555060 +0200 ++++ strace-4.24/macros.h 2018-09-13 00:42:10.059675201 +0200 +@@ -53,6 +53,15 @@ + (offsetof(type_, member_) + sizeof(((type_ *)0)->member_)) + #endif + ++#ifndef cast_ptr ++# define cast_ptr(type, var) ((type) (uintptr_t) (const volatile void *) (var)) ++#endif ++ ++#ifndef containerof ++# define containerof(x, s, m) \ ++ cast_ptr(s *, (const volatile char *) (x) - offsetof(s, m)) ++#endif ++ + static inline bool + is_filled(const char *ptr, char fill, size_t size) + { +Index: strace-4.24/Makefile.in +=================================================================== +--- strace-4.24.orig/Makefile.in 2018-08-14 02:44:37.000000000 +0200 ++++ strace-4.24/Makefile.in 2018-09-13 00:45:21.266213460 +0200 +@@ -340,7 +340,7 @@ + ipc_sem.c ipc_shm.c ipc_shmctl.c kcmp.c kernel_types.h kexec.c \ + keyctl.c keyctl_kdf_params.h kvm.c largefile_wrappers.h ldt.c \ + link.c linux/asm_stat.h linux/x32/asm_stat.h \ +- linux/x86_64/asm_stat.h listen.c lookup_dcookie.c loop.c \ ++ linux/x86_64/asm_stat.h list.h listen.c lookup_dcookie.c loop.c \ + lseek.c macros.h mem.c membarrier.c memfd_create.c mknod.c \ + mmap_notify.c mmap_notify.h mmsghdr.c mount.c mpers_type.h \ + mq.c msghdr.c msghdr.h mtd.c native_defs.h negated_errno.h \ +@@ -1357,7 +1357,7 @@ + ipc_shmctl.c kcmp.c kernel_types.h kexec.c keyctl.c \ + keyctl_kdf_params.h kvm.c largefile_wrappers.h ldt.c link.c \ + linux/asm_stat.h linux/x32/asm_stat.h linux/x86_64/asm_stat.h \ +- listen.c lookup_dcookie.c loop.c lseek.c macros.h mem.c \ ++ list.h listen.c lookup_dcookie.c loop.c lseek.c macros.h mem.c \ + membarrier.c memfd_create.c mknod.c mmap_notify.c \ + mmap_notify.h mmsghdr.c mount.c mpers_type.h mq.c msghdr.c \ + msghdr.h mtd.c native_defs.h negated_errno.h net.c netlink.c \ diff --git a/SOURCES/strace-rhbz1610774-0003-Implement-queueing-of-threads-before-dispatching-the.patch b/SOURCES/strace-rhbz1610774-0003-Implement-queueing-of-threads-before-dispatching-the.patch new file mode 100644 index 0000000..c420be8 --- /dev/null +++ b/SOURCES/strace-rhbz1610774-0003-Implement-queueing-of-threads-before-dispatching-the.patch @@ -0,0 +1,491 @@ +From c527f21b7528e14b13d2be13acf5c42359e94021 Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Wed, 8 Aug 2018 21:41:39 +0200 +Subject: [PATCH 3/3] Implement queueing of threads before dispatching them + +It is possible that some tracees call a lot of cheap syscalls too fast, +and that can lead to starvation to the point some tracees are not served +for indefinite amount of time. In order to solve that unfairness, try +to collect all the pending tracees first along with the relevant +information and only then dispatch the events. + +* defs.h: Include "list.h". +(struct tcb): Add wait_data_idx and wait_list fields. +* strace.c (struct tcb_wait_data): Add "msg" field. +(tcb_wait_tab): New static variable. +(expand_tcbtab): Resize tcb_wait_tab along with tcbtab, provide +an additional slot for extra event. +(droptcb): Remove tcp from wait_list. +(maybe_switch_tcbs): Get old pid from +tcb_wait_tab[tcp->wait_data_idx].msg. +(next_event): Add pending_tcps, extra_tcp, wait_nohang, elem, and +wait_tab_pos variables; check for elements in pending_tcps and skip +waiting if the list is not empty; check for extra_tcp and skip waiting +along with swapping wait_data_idx with wait_extra_data_idx; +after the initial wait, call wait4() in loop with WNOHANG flag set; +fetch siginfo on signal and eventmsg on PTRACE_EVENT_EXEC; +return the first tcp in pending_tcps list. +* tests/Makefile.am (XFAIL_TEST): Remove looping_threads.test. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=478419 +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=526740 +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=851457 +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1609318 +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1610774 +Co-Authored-by: Dmitry V. Levin +Co-Authored-by: Denys Vlasenko +Co-Authored-by: Andreas Schwab +Co-Authored-by: Jeff Law +Co-Authored-by: DJ Delorie +--- + defs.h | 10 ++ + strace.c | 321 ++++++++++++++++++++++++++++++++++-------------------- + tests/Makefile.am | 3 +- + 3 files changed, 212 insertions(+), 122 deletions(-) + +Index: strace-4.24/defs.h +=================================================================== +--- strace-4.24.orig/defs.h 2018-09-12 23:52:48.978021943 +0200 ++++ strace-4.24/defs.h 2018-09-12 23:53:35.764480931 +0200 +@@ -57,6 +57,7 @@ + #include "error_prints.h" + #include "gcc_compat.h" + #include "kernel_types.h" ++#include "list.h" + #include "macros.h" + #include "mpers_type.h" + #include "string_to_uint.h" +@@ -236,6 +237,15 @@ + + struct mmap_cache_t *mmap_cache; + ++ /* ++ * Data that is stored during process wait traversal. ++ * We use indices as the actual data is stored in an array ++ * that is realloc'ed in runtime. ++ */ ++ size_t wait_data_idx; ++ struct list_item wait_list; ++ ++ + #ifdef HAVE_LINUX_KVM_H + struct vcpu_info *vcpu_info_list; + #endif +Index: strace-4.24/strace.c +=================================================================== +--- strace-4.24.orig/strace.c 2018-09-12 23:53:30.371543291 +0200 ++++ strace-4.24/strace.c 2018-09-12 23:53:35.765480919 +0200 +@@ -161,10 +161,17 @@ + struct tcb_wait_data { + enum trace_event te; /**< Event passed to dispatch_event() */ + int status; /**< status, returned by wait4() */ ++ unsigned long msg; /**< Value returned by PTRACE_GETEVENTMSG */ + siginfo_t si; /**< siginfo, returned by PTRACE_GETSIGINFO */ + }; + + static struct tcb **tcbtab; ++/* ++ * Since the queueing of tracees stops as soon as wait4() returns EAGAIN, ++ * or at least two events for a single tracee, tab_wait_tab size shouldn't ++ * exceed tcbtabsize + 1. ++ */ ++static struct tcb_wait_data *tcb_wait_tab; + static unsigned int nprocs; + static size_t tcbtabsize; + +@@ -750,6 +757,9 @@ + for (tcb_ptr = tcbtab + old_tcbtabsize; + tcb_ptr < tcbtab + tcbtabsize; tcb_ptr++, newtcbs++) + *tcb_ptr = newtcbs; ++ ++ tcb_wait_tab = xreallocarray(tcb_wait_tab, sizeof(*tcb_wait_tab), ++ tcbtabsize + 1); + } + + static struct tcb * +@@ -853,6 +863,8 @@ + if (printing_tcp == tcp) + printing_tcp = NULL; + ++ list_remove(&tcp->wait_list); ++ + memset(tcp, 0, sizeof(*tcp)); + } + +@@ -2071,10 +2083,8 @@ + { + FILE *fp; + struct tcb *execve_thread; +- long old_pid = 0; ++ long old_pid = tcb_wait_tab[tcp->wait_data_idx].msg; + +- if (ptrace(PTRACE_GETEVENTMSG, pid, NULL, &old_pid) < 0) +- return tcp; + /* Avoid truncation in pid2tcb() param passing */ + if (old_pid <= 0 || old_pid == pid) + return tcp; +@@ -2235,17 +2245,27 @@ + static const struct tcb_wait_data * + next_event(void) + { +- static struct tcb_wait_data wait_data; +- +- int pid; +- int status; +- struct tcb *tcp; +- struct tcb_wait_data *wd = &wait_data; +- struct rusage ru; +- + if (interrupted) + return NULL; + ++ struct tcb *tcp = NULL; ++ struct list_item *elem; ++ ++ static EMPTY_LIST(pending_tcps); ++ if (!list_is_empty(&pending_tcps)) ++ goto next_event_get_tcp; ++ ++ static struct tcb *extra_tcp; ++ static size_t wait_extra_data_idx; ++ if (extra_tcp) { ++ tcp = extra_tcp; ++ extra_tcp = NULL; ++ tcp->wait_data_idx = wait_extra_data_idx; ++ ++ debug_msg("dequeued extra event for pid %u", tcp->pid); ++ goto next_event_exit; ++ } ++ + /* + * Used to exit simply when nprocs hits zero, but in this testcase: + * int main(void) { _exit(!!fork()); } +@@ -2287,8 +2307,10 @@ + * then the system call will be interrupted and + * the expiration will be handled by the signal handler. + */ +- pid = wait4(-1, &status, __WALL, (cflag ? &ru : NULL)); +- const int wait_errno = errno; ++ int status; ++ struct rusage ru; ++ int pid = wait4(-1, &status, __WALL, (cflag ? &ru : NULL)); ++ int wait_errno = errno; + + /* + * The window of opportunity to handle expirations +@@ -2304,135 +2326,194 @@ + return NULL; + } + +- if (pid < 0) { +- if (wait_errno == EINTR) { +- wd->te = TE_NEXT; +- return wd; ++ size_t wait_tab_pos = 0; ++ bool wait_nohang = false; ++ ++ for (;;) { ++ struct tcb_wait_data *wd; ++ ++ if (pid < 0) { ++ if (wait_errno == EINTR) ++ break; ++ if (wait_nohang) ++ break; ++ if (nprocs == 0 && wait_errno == ECHILD) ++ return NULL; ++ /* ++ * If nprocs > 0, ECHILD is not expected, ++ * treat it as any other error here: ++ */ ++ errno = wait_errno; ++ perror_msg_and_die("wait4(__WALL)"); + } +- if (nprocs == 0 && wait_errno == ECHILD) +- return NULL; +- /* +- * If nprocs > 0, ECHILD is not expected, +- * treat it as any other error here: +- */ +- errno = wait_errno; +- perror_msg_and_die("wait4(__WALL)"); +- } + +- wd->status = status; ++ if (!pid) ++ break; + +- if (pid == popen_pid) { +- if (!WIFSTOPPED(status)) +- popen_pid = 0; +- wd->te = TE_NEXT; +- return wd; +- } ++ if (pid == popen_pid) { ++ if (!WIFSTOPPED(status)) ++ popen_pid = 0; ++ break; ++ } + +- if (debug_flag) +- print_debug_info(pid, status); ++ if (debug_flag) ++ print_debug_info(pid, status); + +- /* Look up 'pid' in our table. */ +- tcp = pid2tcb(pid); ++ /* Look up 'pid' in our table. */ ++ tcp = pid2tcb(pid); + +- if (!tcp) { +- tcp = maybe_allocate_tcb(pid, status); + if (!tcp) { +- wd->te = TE_NEXT; +- return wd; ++ tcp = maybe_allocate_tcb(pid, status); ++ if (!tcp) ++ break; + } +- } + +- clear_regs(tcp); ++ if (cflag) { ++ struct timespec stime = { ++ .tv_sec = ru.ru_stime.tv_sec, ++ .tv_nsec = ru.ru_stime.tv_usec * 1000 ++ }; ++ ts_sub(&tcp->dtime, &stime, &tcp->stime); ++ tcp->stime = stime; ++ } ++ ++ if (wait_tab_pos > tcbtabsize) ++ error_func_msg_and_die("Wait data storage overflow " ++ "(wait_tab_pos %zu, nprocs %u, " ++ "tcbtabsize %zu)", wait_tab_pos, ++ nprocs, tcbtabsize); ++ ++ wd = tcb_wait_tab + wait_tab_pos; ++ memset(wd, 0, sizeof(*wd)); ++ ++ if (WIFSIGNALED(status)) { ++ wd->te = TE_SIGNALLED; ++ } else if (WIFEXITED(status)) { ++ wd->te = TE_EXITED; ++ } else { ++ /* ++ * As WCONTINUED flag has not been specified to wait4, ++ * it cannot be WIFCONTINUED(status), so the only case ++ * that remains is WIFSTOPPED(status). ++ */ + +- /* Set current output file */ +- set_current_tcp(tcp); ++ const unsigned int sig = WSTOPSIG(status); ++ const unsigned int event = (unsigned int) status >> 16; + +- if (cflag) { +- struct timespec stime = { +- .tv_sec = ru.ru_stime.tv_sec, +- .tv_nsec = ru.ru_stime.tv_usec * 1000 +- }; +- ts_sub(&tcp->dtime, &stime, &tcp->stime); +- tcp->stime = stime; +- } ++ switch (event) { ++ case 0: ++ /* ++ * Is this post-attach SIGSTOP? ++ * Interestingly, the process may stop ++ * with STOPSIG equal to some other signal ++ * than SIGSTOP if we happened to attach ++ * just before the process takes a signal. ++ */ ++ if (sig == SIGSTOP && ++ (tcp->flags & TCB_IGNORE_ONE_SIGSTOP)) { ++ debug_func_msg("ignored SIGSTOP on " ++ "pid %d", tcp->pid); ++ tcp->flags &= ~TCB_IGNORE_ONE_SIGSTOP; ++ wd->te = TE_RESTART; ++ } else if (sig == syscall_trap_sig) { ++ wd->te = TE_SYSCALL_STOP; ++ } else { ++ /* ++ * True if tracee is stopped by signal ++ * (as opposed to "tracee received ++ * signal"). ++ * TODO: shouldn't we check for ++ * errno == EINVAL too? ++ * We can get ESRCH instead, you know... ++ */ ++ bool stopped = ptrace(PTRACE_GETSIGINFO, ++ pid, 0, &wd->si) < 0; + +- if (WIFSIGNALED(status)) { +- wd->te = TE_SIGNALLED; +- return wd; +- } ++ wd->te = stopped ? TE_GROUP_STOP ++ : TE_SIGNAL_DELIVERY_STOP; ++ } ++ break; ++ case PTRACE_EVENT_STOP: ++ /* ++ * PTRACE_INTERRUPT-stop or group-stop. ++ * PTRACE_INTERRUPT-stop has sig == SIGTRAP here. ++ */ ++ switch (sig) { ++ case SIGSTOP: ++ case SIGTSTP: ++ case SIGTTIN: ++ case SIGTTOU: ++ wd->te = TE_GROUP_STOP; ++ break; ++ default: ++ wd->te = TE_RESTART; ++ } ++ break; ++ case PTRACE_EVENT_EXEC: ++ /* ++ * TODO: shouldn't we check for ++ * errno == EINVAL here, too? ++ * We can get ESRCH instead, you know... ++ */ ++ if (ptrace(PTRACE_GETEVENTMSG, pid, NULL, ++ &wd->msg) < 0) ++ wd->msg = 0; + +- if (WIFEXITED(status)) { +- wd->te = TE_EXITED; +- return wd; ++ wd->te = TE_STOP_BEFORE_EXECVE; ++ break; ++ case PTRACE_EVENT_EXIT: ++ wd->te = TE_STOP_BEFORE_EXIT; ++ break; ++ default: ++ wd->te = TE_RESTART; ++ } ++ } ++ ++ if (tcp->wait_list.next) { ++ wait_extra_data_idx = wait_tab_pos; ++ extra_tcp = tcp; ++ debug_func_msg("queued extra pid %d", tcp->pid); ++ } else { ++ tcp->wait_data_idx = wait_tab_pos; ++ list_append(&pending_tcps, &tcp->wait_list); ++ debug_func_msg("queued pid %d", tcp->pid); ++ } ++ ++ wd->status = status; ++ wait_tab_pos++; ++ ++ if (extra_tcp) ++ break; ++ ++ pid = wait4(-1, &status, __WALL | WNOHANG, (cflag ? &ru : NULL)); ++ wait_errno = errno; ++ wait_nohang = true; + } + +- /* +- * As WCONTINUED flag has not been specified to wait4, +- * it cannot be WIFCONTINUED(status), so the only case +- * that remains is WIFSTOPPED(status). +- */ ++next_event_get_tcp: ++ elem = list_remove_head(&pending_tcps); ++ ++ if (!elem) { ++ memset(tcb_wait_tab, 0, sizeof(*tcb_wait_tab)); ++ tcb_wait_tab->te = TE_NEXT; ++ ++ return tcb_wait_tab; ++ } else { ++ tcp = list_elem(elem, struct tcb, wait_list); ++ debug_func_msg("dequeued pid %d", tcp->pid); ++ } + ++next_event_exit: + /* Is this the very first time we see this tracee stopped? */ + if (tcp->flags & TCB_STARTUP) + startup_tcb(tcp); + +- const unsigned int sig = WSTOPSIG(status); +- const unsigned int event = (unsigned int) status >> 16; ++ clear_regs(tcp); + +- switch (event) { +- case 0: +- /* +- * Is this post-attach SIGSTOP? +- * Interestingly, the process may stop +- * with STOPSIG equal to some other signal +- * than SIGSTOP if we happened to attach +- * just before the process takes a signal. +- */ +- if (sig == SIGSTOP && (tcp->flags & TCB_IGNORE_ONE_SIGSTOP)) { +- debug_func_msg("ignored SIGSTOP on pid %d", tcp->pid); +- tcp->flags &= ~TCB_IGNORE_ONE_SIGSTOP; +- wd->te = TE_RESTART; +- } else if (sig == syscall_trap_sig) { +- wd->te = TE_SYSCALL_STOP; +- } else { +- memset(&wd->si, 0, sizeof(wd->si)); +- /* +- * True if tracee is stopped by signal +- * (as opposed to "tracee received signal"). +- * TODO: shouldn't we check for errno == EINVAL too? +- * We can get ESRCH instead, you know... +- */ +- bool stopped = ptrace(PTRACE_GETSIGINFO, pid, 0, &wd->si) < 0; +- wd->te = stopped ? TE_GROUP_STOP : TE_SIGNAL_DELIVERY_STOP; +- } +- break; +- case PTRACE_EVENT_STOP: +- /* +- * PTRACE_INTERRUPT-stop or group-stop. +- * PTRACE_INTERRUPT-stop has sig == SIGTRAP here. +- */ +- switch (sig) { +- case SIGSTOP: +- case SIGTSTP: +- case SIGTTIN: +- case SIGTTOU: +- wd->te = TE_GROUP_STOP; +- break; +- default: +- wd->te = TE_RESTART; +- } +- break; +- case PTRACE_EVENT_EXEC: +- wd->te = TE_STOP_BEFORE_EXECVE; +- break; +- case PTRACE_EVENT_EXIT: +- wd->te = TE_STOP_BEFORE_EXIT; +- break; +- default: +- wd->te = TE_RESTART; +- } ++ /* Set current output file */ ++ set_current_tcp(tcp); + +- return wd; ++ return tcb_wait_tab + tcp->wait_data_idx; + } + + static int +Index: strace-4.24/tests/Makefile.am +=================================================================== +--- strace-4.24.orig/tests/Makefile.am 2018-09-12 23:53:31.739527473 +0200 ++++ strace-4.24/tests/Makefile.am 2018-09-12 23:53:35.765480919 +0200 +@@ -367,8 +367,7 @@ + XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS) + XFAIL_TESTS_x86_64 = int_0x80.gen.test + XFAIL_TESTS_x32 = int_0x80.gen.test +-XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) \ +- looping_threads.test ++XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) + + TEST_LOG_COMPILER = env + AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \ diff --git a/SPECS/strace.spec b/SPECS/strace.spec new file mode 100644 index 0000000..d0c0db9 --- /dev/null +++ b/SPECS/strace.spec @@ -0,0 +1,649 @@ +%{?scl:%{?scl_package:%scl_package strace}} + +Summary: Tracks and displays system calls associated with a running process +Name: %{?scl_prefix}strace +Version: 4.24 +Release: 4%{?dist} +License: BSD +Group: Development/Debuggers +URL: https://strace.io +Source: https://strace.io/files/%{version}/strace-%{version}.tar.xz + +Patch0: strace-provide-O_TMPFILE-fallback-definition.patch +Patch1: strace-rhbz1610774-0000-strace.c-introduce-struct-tcb_wait_data.patch +Patch2: strace-rhbz1610774-0001-tests-check-tracing-of-looping-threads.patch +Patch3: strace-rhbz1610774-0002-Add-a-generic-list-implementation.patch +Patch4: strace-rhbz1610774-0003-Implement-queueing-of-threads-before-dispatching-the.patch + +%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} + +BuildRequires: gcc gzip + +# Install Bluetooth headers for AF_BLUETOOTH sockets decoding. +%if 0%{?fedora} >= 18 || 0%{?centos} >= 8 || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1200 +BuildRequires: pkgconfig(bluez) +%endif + +BuildRequires: %{?scl_prefix}elfutils-devel, %{?scl_prefix}binutils-devel +%{?!buildroot:BuildRoot: %_tmppath/buildroot-%name-%version-%release} + +# OBS compatibility +%{?!buildroot:BuildRoot: %_tmppath/buildroot-%name-%version-%release} +%define maybe_use_defattr %{?suse_version:%%defattr(-,root,root)} + +%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. + +%prep +%setup -q -n strace-%{version} + +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 + +chmod a+x tests/*.test + +echo -n %version-%release > .tarball-version +echo -n 2018 > .year +echo -n 2018-07-07 > .strace.1.in.date + +%build +echo 'BEGIN OF BUILD ENVIRONMENT INFORMATION' +uname -a |head -1 +libc="$(ldd /bin/sh |sed -n 's|^[^/]*\(/[^ ]*/libc\.so[^ ]*\).*|\1|p' |head -1)" +$libc |head -1 +file -L /bin/sh +gcc --version |head -1 +ld --version |head -1 +kver="$(printf '%%s\n%%s\n' '#include ' 'LINUX_VERSION_CODE' | gcc -E -P -)" +printf 'kernel-headers %%s.%%s.%%s\n' $(($kver/65536)) $(($kver/256%%256)) $(($kver%%256)) +echo 'END OF BUILD ENVIRONMENT INFORMATION' + +LDFLAGS="-L%{_libdir} -L%{_libdir}/elfutils" +export LDLFAGS + +# -DHAVE_S390_COMPAT_REGS is needed due to lack of v3.10-rc1~201^2~11 +CFLAGS="$RPM_OPT_FLAGS $LDFLAGS" +# Removing explicit -m64 as it breaks mpers +[ "x${CFLAGS#*-m64}" = "x${CFLAGS}" ] || CFLAGS=$(echo "$CFLAGS" | sed 's/-m64//g') +export CFLAGS + +CPPFLAGS="-I%{_includedir} %{optflags}" +# Removing explicit -m64 as it breaks mpers +[ "x${CPPFLAGS#*-m64}" = "x${CPPFLAGS}" ] || CPPFLAGS=$(echo "$CPPFLAGS" | sed 's/-m64//g') +export CPPFLAGS + +CFLAGS_FOR_BUILD="$RPM_OPT_FLAGS"; export CFLAGS_FOR_BUILD +# ac_cv_member_struct_perf_event_attr_context_switch=no is due to +# https://bugzilla.redhat.com/show_bug.cgi?id=1404539 +%configure --enable-mpers=check ac_cv_member_struct_perf_event_attr_context_switch=no +make %{?_smp_mflags} + +%install +make DESTDIR=%{buildroot} install + +# remove unpackaged files from the buildroot +rm -f %{buildroot}%{_bindir}/strace-graph + +# some say uncompressed changelog files are too big +for f in ChangeLog ChangeLog-CVS; do + gzip -9n < "$f" > "$f".gz & +done +wait + +%check +%{buildroot}%{_bindir}/strace -V +# Temporary until we dig deeper into the failures +%ifnarch s390x ppc64 +make %{?_smp_mflags} -k check VERBOSE=1 TIMEOUT_DURATION=1800 +echo 'BEGIN OF TEST SUITE INFORMATION' +tail -n 99999 -- tests*/test-suite.log tests*/ksysent.log +find tests* -type f -name '*.log' -print0 | + xargs -r0 grep -H '^KERNEL BUG:' -- ||: +echo 'END OF TEST SUITE INFORMATION' +%endif + +%files +%maybe_use_defattr +%doc CREDITS ChangeLog.gz ChangeLog-CVS.gz COPYING NEWS README +%{_bindir}/strace +%{_bindir}/strace-log-merge +%{_mandir}/man1/* + +%changelog +* Wed Sep 12 2018 Eugene Syromiatnikov - 4.24-4 +- Add current version of the thread handling unfairness fix. +- Resolves #1610774. + +* Thu Aug 23 2018 Eugene Syromiatnikov - 4.24-3 +- Provide a fallback definition for the O_TMPFILE flag. +- Resolves #1609741. + +* Tue Aug 14 2018 Eugene Syromiatnikov - 4.24-2 +- Remove -DHAVE_S390_COMPAT_REGS=1 from CFLAGS. + +* Tue Aug 14 2018 Eugene Syromiatnikov - 4.24-1 +- Rebase to v4.24. + +* Mon Aug 06 2018 Eugene Syromiatnikov - 4.23-5 +- Provide open mode flags fallback definitions. +- Resolves #1609741. + +* Sun Aug 05 2018 Eugene Syromiatnikov - 4.23-4 +- Enable stack unwinding using DTS version of libelfutils. + +* Wed Jul 18 2018 Eugene Syromiatnikov - 4.23-3 +- Add SCL-specific modifications in order to build for DTS 8.0. +- Resolves #1602841. + +* Mon Jun 18 2018 Eugene Syromiatnikov - 4.23-2 +- Increase test timeout duration. + +* Thu Jun 14 2018 Dmitry V. Levin - 4.23-1 +- v4.22 -> v4.23. +- Enabled libdw backend for -k option (#1568647). + +* Thu Apr 05 2018 Dmitry V. Levin - 4.22-1 +- v4.21 -> v4.22. + +* Tue Feb 13 2018 Dmitry V. Levin - 4.21-1 +- v4.20 -> v4.21. + +* Mon Nov 13 2017 Dmitry V. Levin - 4.20-1 +- v4.19 -> v4.20. + +* Tue Sep 05 2017 Dmitry V. Levin - 4.19-1 +- v4.18 -> v4.19. + +* Wed Jul 05 2017 Dmitry V. Levin - 4.18-1 +- v4.17 -> v4.18. + +* Wed May 24 2017 Dmitry V. Levin - 4.17-1 +- v4.16 -> v4.17. + +* Tue Feb 14 2017 Dmitry V. Levin - 4.16-1 +- v4.15 -> v4.16. + +* Wed Dec 14 2016 Dmitry V. Levin - 4.15-1 +- v4.14-100-g622af42 -> v4.15. + +* Wed Nov 16 2016 Dmitry V. Levin - 4.14.0.100.622a-1 +- v4.14 -> v4.14-100-g622af42: + + implemented syscall fault injection. + +* Tue Oct 04 2016 Dmitry V. Levin - 4.14-1 +- v4.13 -> v4.14: + + added printing of the mode argument of open and openat syscalls + when O_TMPFILE flag is set (#1377846). + +* Tue Jul 26 2016 Dmitry V. Levin - 4.13-1 +- v4.12 -> v4.13. + +* Tue May 31 2016 Dmitry V. Levin - 4.12-1 +- v4.11-163-g972018f -> v4.12. + +* Fri Feb 05 2016 Fedora Release Engineering - 4.11.0.163.9720-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jan 15 2016 Dmitry V. Levin - 4.11.0.163.9720-1 +- New upstream snapshot v4.11-163-g972018f: + + fixed decoding of syscalls unknown to the kernel on s390/s390x (#1298294). + +* Wed Dec 23 2015 Dmitry V. Levin - 4.11-2 +- Enabled experimental -k option on x86_64 (#1170296). + +* Mon Dec 21 2015 Dmitry V. Levin - 4.11-1 +- New upstream release: + + print nanoseconds along with seconds in stat family syscalls (#1251176). + +* Fri Jun 19 2015 Fedora Release Engineering - 4.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon May 11 2015 Marcin Juszkiewicz - 4.10-2 +- Backport set of upstream patches to get it buildable on AArch64 + +* Fri Mar 06 2015 Dmitry V. Levin - 4.10-1 +- New upstream release: + + enhanced ioctl decoding (#902788). + +* Mon Nov 03 2014 Lubomir Rintel - 4.9-3 +- Regenerate ioctl entries with proper kernel headers + +* Mon Aug 18 2014 Fedora Release Engineering - 4.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Aug 15 2014 Dmitry V. Levin - 4.9-1 +- New upstream release: + + fixed build when and conflict (#993384); + + updated CLOCK_* constants (#1088455); + + enabled ppc64le support (#1122323); + + fixed attach to a process on ppc64le (#1129569). + +* Fri Jul 25 2014 Dan HorĂ¡k - 4.8-5 +- update for ppc64 + +* Sun Jun 08 2014 Fedora Release Engineering - 4.8-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri Dec 6 2013 Peter Robinson 4.8-3 +- Fix FTBFS + +* Sun Aug 04 2013 Fedora Release Engineering - 4.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jun 03 2013 Dmitry V. Levin - 4.8-1 +- New upstream release: + + fixed ERESTARTNOINTR leaking to userspace on ancient kernels (#659382); + + fixed decoding of *xattr syscalls (#885233); + + fixed handling of files with 64-bit inode numbers by 32-bit strace (#912790); + + added aarch64 support (#969858). + +* Fri Feb 15 2013 Fedora Release Engineering - 4.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sat Jul 21 2012 Fedora Release Engineering - 4.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed May 02 2012 Dmitry V. Levin 4.7-1 +- New upstream release. + + implemented proper handling of real SIGTRAPs (#162774). + +* Sat Jan 14 2012 Fedora Release Engineering - 4.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Mar 14 2011 Dmitry V. Levin - 4.6-1 +- New upstream release. + + fixed a corner case in waitpid handling (#663547). + +* Wed Feb 09 2011 Fedora Release Engineering - 4.5.20-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Apr 13 2010 Roland McGrath - 4.5.20-1 +- New upstream release, work mostly by Andreas Schwab and Dmitry V. Levin. + + fixed potential stack buffer overflow in select decoder (#556678); + + fixed FTBFS (#539044). + +* Wed Oct 21 2009 Roland McGrath - 4.5.19-1 +- New upstream release, work mostly by Dmitry V. Levin + + exit/kill strace with traced process exitcode/signal (#105371); + + fixed build on ARM EABI (#507576); + + fixed display of 32-bit argv array on 64-bit architectures (#519480); + + fixed display of 32-bit fcntl(F_SETLK) on 64-bit architectures (#471169); + + fixed several bugs in strings decoder, including potential heap + memory corruption (#470529, #478324, #511035). + +* Thu Aug 28 2008 Roland McGrath - 4.5.18-1 +- build fix for newer kernel headers (#457291) +- fix CLONE_VFORK handling (#455078) +- Support new Linux/PPC system call subpage_prot and PROT_SAO flag. +- In sigaction system call, display sa_flags value along with SIG_DFL/SIG_IGN. + +* Mon Jul 21 2008 Roland McGrath - 4.5.17-1 +- handle O_CLOEXEC, MSG_CMSG_CLOEXEC (#365781) +- fix biarch stat64 decoding (#222275) +- fix spurious "..." in printing of environment strings (#358241) +- improve prctl decoding (#364401) +- fix hang wait on exited child with exited child (#354261) +- fix biarch fork/vfork (-f) tracing (#447475) +- fix biarch printing of negative argument kill (#430585) +- fix biarch decoding of error return values (#447587) +- fix -f tracing of CLONE_VFORK (#455078) +- fix ia64 register clobberation in -f tracing (#453438) +- print SO_NODEFER, SA_RESETHAND instead of SA_NOMASK, SA_ONESHOT (#455821) +- fix futex argument decoding (#448628, #448629) + +* Fri Aug 3 2007 Roland McGrath - 4.5.16-1 +- fix multithread issues (#240962, #240961, #247907) +- fix spurious SIGSTOP on early interrupt (#240986) +- fix utime for biarch (#247185) +- fix -u error message (#247170) +- better futex syscall printing (##241467) +- fix argv/envp printing with small -s settings, and for biarch +- new syscalls: getcpu, eventfd, timerfd, signalfd, epoll_pwait, + move_pages, utimensat + +* Tue Jan 16 2007 Roland McGrath - 4.5.15-1 +- biarch fixes (#179740, #192193, #171626, #173050, #218433, #218043) +- fix -ff -o behavior (#204950, #218435, #193808, #219423) +- better quotactl printing (#118696) +- *at, inotify*, pselect6, ppoll and unshare syscalls (#178633, #191275) +- glibc-2.5 build fixes (#209856) +- memory corruption fixes (#200621 +- fix race in child setup under -f (#180293) +- show ipc key values in hex (#198179, #192182) +- disallow -c with -ff (#187847) +- Resolves: RHBZ #179740, RHBZ #192193, RHBZ #204950, RHBZ #218435 +- Resolves: RHBZ #193808, RHBZ #219423, RHBZ #171626, RHBZ #173050 +- Resolves: RHBZ #218433, RHBZ #218043, RHBZ #118696, RHBZ #178633 +- Resolves: RHBZ #191275, RHBZ #209856, RHBZ #200621, RHBZ #180293 +- Resolves: RHBZ #198179, RHBZ #198182, RHBZ #187847 + +* Mon Nov 20 2006 Jakub Jelinek - 4.5.14-4 +- Fix ia64 syscall decoding (#206768) +- Fix build with glibc-2.4.90-33 and up on all arches but ia64 +- Fix build against 2.6.18+ headers + +* Tue Aug 22 2006 Roland McGrath - 4.5.14-3 +- Fix bogus decoding of syscalls >= 300 (#201462, #202620). + +* Fri Jul 14 2006 Jesse Keating - 4.5.14-2 +- rebuild + +* Fri Feb 10 2006 Jesse Keating - 4.5.14-1.2 +- bump again for long double bug on ppc{,64} + +* Tue Feb 07 2006 Jesse Keating - 4.5.14-1.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Mon Jan 16 2006 Roland McGrath - 4.5.14-1 +- Fix biarch decoding of socket syscalls (#174354). +- Fix biarch -e support (#173986). +- Accept numeric syscalls in -e (#174798). +- Fix ipc syscall decoding (#164755). +- Improve msgrcv printing (#164757). +- Man page updates (#165375). +- Improve mount syscall printing (#165377). +- Correct printing of restarting syscalls (#165469). + +* Wed Aug 3 2005 Roland McGrath - 4.5.13-1 +- Fix setsockopt decoding on 64-bit (#162449). +- Fix typos in socket option name strings (#161578). +- Display more IPV6 socket options by name (#162450). +- Don't display inappropriate syscalls for -e trace=file (#159340). +- New selector type -e trace=desc for file-descriptor using calls (#159400). +- Fix 32-bit old_mmap syscall decoding on x86-64 (#162467, #164215). +- Fix errors detaching from multithreaded process on interrupt (#161919). +- Note 4.5.12 fix for crash handling bad signal numbers (#162739). + +* Wed Jun 8 2005 Roland McGrath - 4.5.12-1 +- Fix known syscall recognition for IA32 processes on x86-64 (#158934). +- Fix bad output for ptrace on x86-64 (#159787). +- Fix potential buffer overruns (#151570, #159196). +- Make some diagnostics more consistent (#159308). +- Update PowerPC system calls. +- Better printing for Linux aio system calls. +- Don't truncate statfs64 fields to 32 bits in output (#158243). +- Cosmetic code cleanups (#159688). + +* Tue Mar 22 2005 Roland McGrath - 4.5.11-1 +- Build tweaks. +- Note 4.5.10 select fix (#151570). + +* Mon Mar 14 2005 Roland McGrath - 4.5.10-1 +- Fix select handling on nonstandard fd_set sizes. +- Don't print errors for null file name pointers. +- Fix initial execve output with -i (#143365). + +* Fri Feb 4 2005 Roland McGrath - 4.5.9-2 +- update ia64 syscall list (#146245) +- fix x86_64 syscall argument extraction for 32-bit processes (#146093) +- fix -e signal=NAME parsing (#143362) +- fix x86_64 exit_group syscall handling +- improve socket ioctl printing (#138223) +- code cleanups (#143369, #143370) +- improve mount flags printing (#141932) +- support symbolic printing of x86_64 arch_prctl parameters (#142667) +- fix potential crash in getxattr printing + +* Tue Oct 19 2004 Roland McGrath - 4.5.8-1 +- fix multithreaded exit handling (#132150, #135254) +- fix ioctl name matching (#129808) +- print RTC_* ioctl structure contents (#58606) +- grok epoll_* syscalls (#134463) +- grok new RLIMIT_* values (#133594) +- print struct cmsghdr contents for sendmsg (#131689) +- fix clock_* and timer_* argument output (#131420) + +* Tue Aug 31 2004 Roland McGrath - 4.5.7-2 +- new upstream version, misc fixes and updates (#128091, #129166, #128391, #129378, #130965, #131177) + +* Mon Jul 12 2004 Roland McGrath 4.5.6-1 +- new upstream version, updates ioctl lists (#127398), fixes quotactl (#127393), more ioctl decoding (#126917) + +* Sun Jun 27 2004 Roland McGrath 4.5.5-1 +- new upstream version, fixes x86-64 biarch support (#126547) + +* Tue Jun 15 2004 Elliot Lee 4.5.4-2 +- rebuilt + +* Thu Jun 3 2004 Roland McGrath 4.5.4-0.FC1 +- rebuilt for FC1 update + +* Thu Jun 3 2004 Roland McGrath 4.5.4-1 +- new upstream version, more ioctls (#122257), minor fixes + +* Fri Apr 16 2004 Roland McGrath 4.5.3-1 +- new upstream version, mq_* calls (#120701), -p vs NPTL (#120462), more fixes (#118694, #120541, #118685) + +* Tue Mar 02 2004 Elliot Lee 4.5.2-1.1 +- rebuilt + +* Mon Mar 1 2004 Roland McGrath 4.5.2-1 +- new upstream version, sched_* calls (#116990), show core flag (#112117) + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Thu Nov 13 2003 Roland McGrath 4.5.1-1 +- new upstream version, more fixes (#108012, #105366, #105359, #105358) + +* Tue Sep 30 2003 Roland McGrath 4.5-3 +- revert bogus s390 fix + +* Thu Sep 25 2003 Roland McGrath 4.5-1.2.1AS +- rebuilt for 2.1AS erratum + +* Wed Sep 24 2003 Roland McGrath 4.5-2 +- rebuilt + +* Wed Sep 24 2003 Roland McGrath 4.5-1 +- new upstream version, more fixes (#101499, #104365) + +* Thu Jul 17 2003 Roland McGrath 4.4.99-2 +- rebuilt + +* Thu Jul 17 2003 Roland McGrath 4.4.99-1 +- new upstream version, groks more new system calls, PF_INET6 sockets + +* Tue Jun 10 2003 Roland McGrath 4.4.98-1 +- new upstream version, more fixes (#90754, #91085) + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Sun Mar 30 2003 Roland McGrath 4.4.96-1 +- new upstream version, handles yet more 2.5 syscalls, x86_64 & ia64 fixes + +* Mon Feb 24 2003 Elliot Lee 4.4.95-2 +- rebuilt + +* Mon Feb 24 2003 Roland McGrath 4.4.95-1 +- new upstream version, fixed getresuid/getresgid (#84959) + +* Wed Feb 19 2003 Roland McGrath 4.4.94-1 +- new upstream version, new option -E to set environment variables (#82392) + +* Wed Jan 22 2003 Tim Powers 4.4.93-2 +- rebuilt + +* Tue Jan 21 2003 Roland McGrath 4.4.93-1 +- new upstream version, fixes ppc and s390 bugs, adds missing ptrace requests + +* Fri Jan 10 2003 Roland McGrath 4.4.91-1 +- new upstream version, fixes -f on x86-64 + +* Fri Jan 10 2003 Roland McGrath 4.4.90-1 +- new upstream version, fixes all known bugs modulo ia64 and s390 issues + +* Fri Jan 03 2003 Florian La Roche 4.4-11 +- add further s390 patch from IBM + +* Wed Nov 27 2002 Tim Powers 4.4-10 +- remove unpackaged files from the buildroot + +* Mon Oct 07 2002 Phil Knirsch 4.4-9.1 +- Added latest s390(x) patch. + +* Fri Sep 06 2002 Karsten Hopp 4.4-9 +- preliminary x86_64 support with an ugly patch to help + debugging. Needs cleanup! + +* Mon Sep 2 2002 Jakub Jelinek 4.4-8 +- newer version of the clone fixing patch (Roland McGrath) +- aio syscalls for i386/ia64/ppc (Ben LaHaise) + +* Wed Aug 28 2002 Jakub Jelinek 4.4-7 +- fix strace -f (Roland McGrath, #68994) +- handle ?et_thread_area, SA_RESTORER (Ulrich Drepper) + +* Fri Jun 21 2002 Jakub Jelinek 4.4-6 +- handle futexes, *xattr, sendfile64, etc. (Ulrich Drepper) +- handle modify_ldt (#66894) + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Tue Apr 16 2002 Jakub Jelinek 4.4-4 +- fix for the last patch by Jeff Law (#62591) + +* Mon Mar 4 2002 Preston Brown 4.4-3 +- integrate patch from Jeff Law to eliminate hang tracing threads + +* Sat Feb 23 2002 Florian La Roche +- minor update from debian tar-ball + +* Wed Jan 02 2002 Florian La Roche +- update to 4.4 + +* Sun Jul 22 2001 Florian La Roche +- disable s390 patches, they are already included + +* Wed Jul 18 2001 Preston Brown 4.3-1 +- new upstream version. Seems to have integrated most new syscalls +- tracing threaded programs is now functional. + +* Mon Jun 11 2001 Than Ngo +- port s390 patches from IBM + +* Wed May 16 2001 Nalin Dahyabhai +- modify new syscall patch to allocate enough heap space in setgroups32() + +* Wed Feb 14 2001 Jakub Jelinek +- #include in addition to + +* Fri Jan 26 2001 Karsten Hopp +- clean up conflicting patches. This happened only + when building on S390 + +* Fri Jan 19 2001 Bill Nottingham +- update to CVS, reintegrate ia64 support + +* Fri Dec 8 2000 Bernhard Rosenkraenzer +- Get S/390 support into the normal package + +* Sat Nov 18 2000 Florian La Roche +- added S/390 patch from IBM, adapting it to not conflict with + IA64 patch + +* Sat Aug 19 2000 Jakub Jelinek +- doh, actually apply the 2.4 syscalls patch +- make it compile with 2.4.0-test7-pre4+ headers, add + getdents64 and fcntl64 + +* Thu Aug 3 2000 Jakub Jelinek +- add a bunch of new 2.4 syscalls (#14036) + +* Wed Jul 12 2000 Prospector +- automatic rebuild +- excludearch ia64 + +* Fri Jun 2 2000 Matt Wilson +- use buildinstall for FHS + +* Wed May 24 2000 Jakub Jelinek +- make things compile on sparc +- fix sigreturn on sparc + +* Fri Mar 31 2000 Bill Nottingham +- fix stat64 misdef (#10485) + +* Tue Mar 21 2000 Michael K. Johnson +- added ia64 patch + +* Thu Feb 03 2000 Cristian Gafton +- man pages are compressed +- version 4.2 (why are we keeping all these patches around?) + +* Sat Nov 27 1999 Jeff Johnson +- update to 4.1 (with sparc socketcall patch). + +* Fri Nov 12 1999 Jakub Jelinek +- fix socketcall on sparc. + +* Thu Sep 02 1999 Cristian Gafton +- fix KERN_SECURELVL compile problem + +* Tue Aug 31 1999 Cristian Gafton +- added alpha patch from HJLu to fix the osf_sigprocmask interpretation + +* Sat Jun 12 1999 Jeff Johnson +- update to 3.99.1. + +* Wed Jun 2 1999 Jeff Johnson +- add (the other :-) jj's sparc patch. + +* Wed May 26 1999 Jeff Johnson +- upgrade to 3.99 in order to +- add new 2.2.x open flags (#2955). +- add new 2.2.x syscalls (#2866). +- strace 3.1 patches carried along for now. + +* Sun May 16 1999 Jeff Johnson +- don't rely on (broken!) rpm %%patch (#2735) + +* Tue Apr 06 1999 Preston Brown +- strip binary + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 16) + +* Tue Feb 9 1999 Jeff Johnson +- vfork est arrive! + +* Tue Feb 9 1999 Christopher Blizzard +- Add patch to follow clone() syscalls, too. + +* Sun Jan 17 1999 Jeff Johnson +- patch to build alpha/sparc with glibc 2.1. + +* Thu Dec 03 1998 Cristian Gafton +- patch to build on ARM + +* Wed Sep 30 1998 Jeff Johnson +- fix typo (printf, not tprintf). + +* Sat Sep 19 1998 Jeff Johnson +- fix compile problem on sparc. + +* Tue Aug 18 1998 Cristian Gafton +- buildroot + +* Mon Jul 20 1998 Cristian Gafton +- added the umoven patch from James Youngman +- fixed build problems on newer glibc releases + +* Mon Jun 08 1998 Prospector System +- translations modified for de, fr, tr