IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
I found that I use it quite often. Lets make it so that
after cut-n-pasting it into a file, there is no need
to edit the result (e.g. no need to remove C comment
chars from every line.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Without this patch, strace claims that parent_tidptr == tls, which is
clearly wrong. It is expected that parent_tidptr == child_tidptr.
* process.c [X86_64] (ARG_CTID, ARG_TLS): Take current
personality into account.
Signed-off-by: Elliott Hughes <enh@google.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
We need to handle this situation more like x86-64. 32-bit arm and i386
actually have a common struct stat64, except the arm one must not be
packed. Additionally, on aarch64 the 32-bit personality is personality 0.
Signed-off-by: Elliott Hughes <enh@google.com>
OABI is rarely used in ARM EABI systems nowadays, so disable its support
by default. Add --enable-arm-oabi option to enable ARM OABI support.
* configure.ac: New option --enable-arm-oabi.
* syscall.c (get_scno) [ARM]: Check ENABLE_ARM_OABI macro defined by
configure instead of undocumented STRACE_KNOWS_ONLY_EABI macro.
Patch fb642bb6d63f7ffe2228bf48a6008bc8f56f67ff fixed building with
HAVE_STAT64 for aarch64 with uapi kernel headers but not x86_64.
The workaround needed to be applied to all LP64 architectures, not
just aarch64. This patch fixes that and adds an explanatory comment.
Signed-off-by: Elliott Hughes <enh@google.com>
The only supported domain for socketpair syscall is AF_UNIX, so
no decoding related to other domains is required for socketpair.
* net.c (sys_socketpair): Remove support for PF_INET and PF_IPX domains,
print the protocol argument as is.
Decode siginfo_t more clearly for si_code SI_TIMER.
The 'pid' is actually a POSIX timer id, and the 'uid' is actually the
overrun.
Also factor out the si_value dumping so it's the same for every si_code.
Signed-off-by: Elliott Hughes <enh@google.com>
If an aarch64 strace is tracing a process using the arm personality, it
also needs to call the shuffle_scno function for the ARM-specific
syscalls.
* syscall.c (shuffle_scno): Define on AARCH64.
(get_scno) [AARCH64]: Call shuffle_scno when the tracee is in 32-bit mode.
Signed-off-by: Elliott Hughes <enh@google.com>
Assume that F_SETLK64, F_SETLKW64, and F_GETLK64 are either defined or
not defined altogether.
Do not assume that sizeof(off_t) < sizeof(long long) when F_SETLK64 is
undefined.
This change fixes build with musl libc on x86.
* configure.ac: Define SIZEOF_OFF_T.
* desc.c (USE_PRINTFLOCK64): New macro.
(struct flock64, printflock64): Do not define on X32.
(printflock): Replace X32 specific workaround with SIZEOF_OFF_T check.
Fix printing off_t members of struct flock.
(sys_fcntl): Use USE_PRINTFLOCK64.
F_FREESP and F_FREESP64 fcntl commands are not available in Linux
and therefore the code implementing their decoding is useless.
Besides that, F_FREESP64 decoding is too complicated to support.
* desc.c (fcntlcmds): Remove F_FREESP and F_FREESP64.
Remove F_FREESP64 from the check whether to define struct flock64.
(sys_fcntl): Remove F_FREESP and F_FREESP64 support.
struct sigaction is another structure that contains members
whose size differs between 32-bit and 64-bit personalities.
* signal.c [HAVE_SIGACTION] (old_sigaction32): New structure.
[HAVE_SIGACTION] (decode_old_sigaction): Decode 32-bit struct
old_sigaction on a 64-bit host.
Signed-off-by: Elliott Hughes <enh@google.com>
aarch64's uapi header files have a struct stat but no struct stat64.
To correctly decode a 32-bit process' s struct stat64 we need
HAVE_STAT64, but then the build fails because there is no struct stat64.
Luckily, the aarch64 struct stat is structurally equivalent to the arm
struct stat64, so we can just reuse that.
* file.c [AARCH64] (stat64): Define to stat.
Signed-off-by: Elliott Hughes <enh@google.com>
The generic version of ioctlsort.c became obsolete after commit
v4.6-240-g5afdf12 that removed its last non-Linux users.
* ioctlsort.c: Remove.
* Makefile.am (EXTRA_DIST): Remove ioctlsort.c.
Reported-by: Elliott Hughes <enh@google.com>
stack_t is one of many structures that contain members
whose size differs between 32-bit and 64-bit personalities.
* signal.c (print_stack_t): Decode 32-bit stack_t on a 64-bit host.
Reported-by: Elliott Hughes <enh@google.com>
The sigset_t provided by libc is not quite convenient.
In glibc, sigset_t is an array with space for 1024 bits, which is much
more than required: all architectures supported by Linux have only 64
signals except MIPS, which has 128.
In bionic libc, LP32 sigset_t is only 4 bytes long, which is less than
necessary.
With this change, signal mask is decoded without use of intermediate
sigset_t structure, which saves us some cpu cycles in case of glibc with
its inflated sigset_t, and enables build with libcs where sigset_t is
broken.
Old implementation used to check each signal number in the given signal
mask twice using sigismember().
New implementation is based on popcount and next_set_bit() so it's
noticeably faster.
* configure.ac: Check for __builtin_popcount.
* signal.c: Ensure that NSIG >= 32.
(sprintsigmask, sprintsigmask_long, printsigmask): Remove.
(popcount32, sprintsigmask_n): New functions.
(tprintsigmask_addr, sprintsigmask_val, tprintsigmask_val): New macros.
(print_sigset_addr_len, sys_sigsetmask, sys_sigreturn, sys_siggetmask,
sys_sigsuspend, sys_sigprocmask, decode_new_sigaction): Update to use
new signal mask decoding interface.
* tests/sigaction.c (main): Add a test with almost filled signal mask.
* tests/sigaction.awk: Update.
Add generic tests for fopen64 and fputs_unlocked functions to fix build
with Bionic libc that does not provide them.
* configure.ac (AC_CHECK_FUNCS): Add fopen64 and fputs_unlocked.
* strace.c [_LARGEFILE64_SOURCE]: Use fopen instead of fopen64
if !HAVE_FOPEN64.
Use fputs instead of fputs_unlocked if !HAVE_FPUTS_UNLOCKED.
* vsprintf.c: Use fputs instead of fputs_unlocked
if !HAVE_FPUTS_UNLOCKED.
Reported-by: Elliott Hughes <enh@google.com>
* syscall.c (get_scno) [POWERPC64]: Fix 64-bit process detection
on embedded powerpc.
Signed-off-by: James Yang <james.yang@freescale.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Add a generic test for <scsi/sg.h> availability to fix build with
Bionic libc that does not provide <scsi/sg.h>.
* configure.ac (AC_CHECK_HEADERS): Add scsi/sg.h.
* ioctl.c (ioctl_decode): Do not call scsi_ioctl if !HAVE_SCSI_SG_H.
* scsi.c: Do not compile scsi ioctl decoding if !HAVE_SCSI_SG_H.
Reported-by: Elliott Hughes <enh@google.com>
The patch originally submitted by Ezequiel García was OK, but I somehow
managed to mangle it so that most of the patch was not applied.
According to Ezequiel García, an architecture port based on the generic
syscall ABI is in progress.
This reverts commit 61e426e87ac81be4b4ff9de581635b4ea585624f.
If SA_RESTORER is not defined by libc headers but defined by kernel
headers, use the definition provided by kernel headers for proper
sigaction decoding.
* signal.c [!SA_RESTORER]: Define to ASM_SA_RESTORER if the latter is
defined, regardless of architecure.
Kernel header <asm/signal.h> cannot be included from regular code
because it conflicts with libc headers, but SA_RESTORER is needed in
signal.c, so SA_RESTORER value is forwarded from <asm/signal.h> to
config.h using a configure check.
* configure.ac (ASM_SA_RESTORER): Define if SA_RESTORER is defined
in <asm/signal.h>.
This commit adds strace support for Altera's Nios-II official
kernel port as found in git://git.rocketboards.org/linux-socfpga.git
Notice that this an out-of-tree kernel architectural port, and uses the
legacy (non-generic) system call ABI. In particular, the port doesn't
support PTRACE_GETREGSET, so the implementation is based on PTRACE_GETREGS.
Given it's mandatory for new architectures to support the generic
syscall ABI and PTRACE_GETREGSET, if the nios2 architecure is ever
mainlined, the strace support will have to be re-factored accordingly.
* linux/nios2/ioctlent.h.in: New file.
* linux/nios2/syscallent.h: Likewise.
* Makefile.am (EXTRA_DIST): Add linux/nios2/ioctlent.h.in and
linux/nios2/syscallent.h.
* configure.ac: Add NIOS2 to the list of supported architectures.
* defs.h [NIOS2]: Use register reading system.
* process.c (struct_user_offsets): Add NIOS2 support.
* syscall.c (get_regs, get_scno, get_syscall_args,
get_syscall_result, get_error): Likewise.
* util.c (change_syscall): Likewise.
* mem.c (sys_getpagesize): Define on NIOS2.
* system.c [NIOS2] (sys_cacheflush, sys_nios2cmpxchg): New functions.
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Acked-by: Mike Frysinger <vapier@gentoo.org>