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!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
If strace -tt is running too long, it might happen that time stamps
before and after its invocation differ for more than a second.
Adjust expected output to handle this rare but possible case.
* tests/strace-tt.test: Allow any time stamp between start and finish
of strace invocation.
Introduce a synchronization mechanism between the tracee and its peer.
* tests/redirect.test: Change timeout file to $OUT. Let the tracee
remove $LOG, wait for $LOG removal in its peer.
Introduce a synchronization mechanism between attach-f-p and strace.
* tests/attach-f-p-cmd.c: New file.
* tests/Makefile.am (check_PROGRAMS): Add attach-f-p-cmd.
* tests/attach-f-p.c: Include <sys/stat.h>.
(main): Write to stdout instead of descriptor 3. Wait for the peer
writing to stdout.
* tests/attach-f-p.test: Assume that ./attach-f-p-cmd works.
Use $OUT for expected output. Use attach-f-p-cmd for unlocking $OUT.
Introduce a synchronization mechanism between attach-p-cmd-p
and attach-p-cmd-cmd processes.
* tests/attach-p-cmd-cmd.c: Include <errno.h> and <sys/stat.h>.
(main): Wait for the lock directory creation by attach-p-cmd-p.
* tests/attach-p-cmd-p.c: Include <errno.h> and <sys/stat.h>.
(main): Create a lock directory and wait for its removal
by attach-p-cmd-cmd.
* tests/attach-p-cmd.test: Assume that test programs work.
* defs.h (signal_set): New variable prototypes.
(qualify_signals): New function prototypes.
(QUAL_SIGNAL): Change to a value greater than 0xff.
(QUAL_FAULT): Change to a lower value.
* qualify.c (signal_set): New variable.
(sigstr_to_uint, qualify_signals): New functions.
* syscall.c (qual_signal): Remove.
(qual_options): Replace qual_signal with NULL.
(qualify): Use qualify_signals.
* strace.c (print_signalled, print_stopped): Use is_number_in_set
with signal_set argument.
As a side effect, this also fixes support of negated sets
of descriptors.
* defs.h (struct number_set): New forward declaration.
(read_set, write_set): New variable prototypes.
(is_number_in_set, qualify_read, qualify_write): New function
prototypes.
(QUAL_READ, QUAL_WRITE): Change to values greater than 0xff.
* qualify.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* syscall.c (qual_desc): Remove.
(qual_options): Replace qual_desc with NULL.
(qualify): Use qualify_read and qualify_write.
(dumpio): Use is_number_in_set.
* tests/options-syntax.test: Check invalid sets of descriptors.
* tests/readv.test: Check dumping of negated sets of descriptors.
valgrind is not as transparent as strace wrt standard descriptors,
so if strace is wrapped with valgrind, the test would check valgrind
transparency properties and fail imminently.
* tests/redirect-fds.test: Skip the test when $STRACE shows a presence
of valgrind.
As valgrind is not quite happy about the way how get_cpuset_size uses
sched_getaffinity, add a suppression file for this case.
* valgrind.supp: New file.
* Makefile.am (EXTRA_DIST): Add it.
Change the test to allow wrappers like STRACE="valgrind ./strace".
* tests/options-syntax.test: Strip all words but last from $STRACE
variable in all contexts where the name of strace executable is expected
in its output.
libc is perfectly capable of allocating memory for its buffers,
so let it do its job.
* strace.c (init): Do not allocate memory for setvbuf invocation.
As this is the type used in kernel.
* uid.c (SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Print size parameter
as "%d".
* tests/getgroups.c: Update expected output.
* tests/setgroups.c: Likewise.
Co-authored-by: Elvira Khabirova <lineprinter0@gmail.com>
* uid.c (setfsuid, get_print_uid, print_gid): Use printuid.
* tests/setfsugid.c (printuid): New function.
(main): Use it to print UID/GID values.
* tests/setgroups.c: Likewise.
* tests/setugid.c (ugid2int): Remove.
(printuid): New function.
(main): Use it to print UID/GID values.
Co-authored-by: Elvira Khabirova <lineprinter0@gmail.com>
The string literal "__NR_syscall_4294967295" is semantically incorrect
as there is no such constant defined.
* syscall.c (syscall_name): Return NULL if there is no syscall
corresponding to the given number.
* defs.h (syscall_name): Document this behaviour.
* printsiginfo.c (print_si_info): Print syscall name with "__NR_" prefix
only if there is a syscall corresponding to si_syscall number; print
a plain syscall number otherwise.
* tests/ptrace.c (main): Update expected output.
* print_statfs.c: Print f_fsid as a structure containing field "val"
which, in turn, is an array of two elements that used to be printed
as members of f_fsid structure.
* tests/statfs.expected: Update expected output.
* tests/xstatfsx.c (print_statfs): Likewise.
* swapon.c (SYS_FUNC(swapon)): Do not check for non-zero the value
of the prio variable in order to print it.
* tests/swap.c (main): Update expected output.
This makes debugging of failing test a bit easier.
* tests/init.sh (match_grep): Add the cnt variable, increment it on every
pattern line read, print it as a prefix for non-matched pattern.
It is a number which consists of several xlat values, not a structure.
* futex.c (SYS_FUNC(futex)): Modify output of the val3 argument
of the FUTEX_WAKE_OP futex syscall command.
* tests/futex.c (main): Update expected output.
Co-authored-by: Elvira Khabirova <lineprinter0@gmail.com>
* syscall.c (dumpio): Explicitly cast the first argument of syscall
to "int", the same way as the kernel does.
* tests/read-write.c: Include <asm/unistd.h> and "kernel_types.h".
(k_read, k_write): New functions.
(test_dump, main): Use them.
* tests/preadv2-pwritev2.c: Include "kernel_types.h".
(main): Use kernel_ulong_t instead of unsigned long as types
of arguments of preadv2 and pwritev2 syscalls.
* util.c (sprinttime): Make date output conform to ISO 8601.
* tests/utime.c (print_tm): Update expected output.
* tests/xstatx.c (print_time): Likewise.
Change the parser of fault expression to follow the POLA:
-e fault=!SET
means that all syscalls except those from SET are subject to fault
injection;
-e fault=!SET1:error=ERRNO1, -e fault=!SET2:error=ERRNO2
means that all syscalls except those from SET2 are subject to fault
injection with error code ERRNO2, and all syscalls from SET2 that are
not in SET1 are subject to fault injection with error code ERRNO1.
* syscall.c (qualify_scno, qualify_syscall_class, qualify_syscall_name):
Handle negated QUAL_FAULT case differently.
* tests/fault_syntax.test: Add checks of negated sets.
* utime.c (SYS_FUNC(utime)): Print struct utimbuf as a structure,
not as an array (use curly brackets instead of square ones).
Add field names to the output.
* tests/utime.c (main): Update expected output.
This is necessary for the upcoming change in the output format
of the val3 argument of the FUTEX_WAKE_OP futex command.
* defs.h (printxvals, printxval_searchn): Change return type to int.
(printxval64, printxval, printxval_long): Likewise. Forward the value
returned by printxvals call.
* util.c (printxvals, printxval_searchn): Change return type to int,
return 1 if xlat value has been found, 0 otherwise.
This is necessary for the upcoming change in the output format
of the val3 argument of the FUTEX_WAKE_OP futex command.
* util.c (printxvals): Do not print dflt if it is NULL.
* linux/aarch64/set_scno.c: Note the kernel commit that introduced
NT_ARM_SYSTEM_CALL support.
* linux/arm/set_scno.c: Note the kernel commit that introduced
PTRACE_SET_SYSCALL support.
* linux/sparc/set_scno.c: Note the kernel commit that introduced
reloading from the syscall number register.