Long/address printing in non-native personalities

2016-06-10 Thread Eugene Syromyatnikov
Hello. It's been brought to my attention that one of strace tests (nsyscalls) is failing when x32 ABI is used. $ cat tests-mx32/nsyscalls.log 1c1 < syscall_546(0xbadc0ded, 0xbadc1ded, 0xbadc2ded, 0xbadc3ded, 0xbadc4ded, 0xbadc5ded) = -1 (errno 38) --- > syscall_546(0xbadc0ded, 0xbadc1ded,

[PATCH] Split qualify/multipers-related stuff into separate files

2016-08-06 Thread Eugene Syromyatnikov
This is an initial attempt ("proof of concept") of division of enormous syscall.c into more local pieces. Originally it was intended to split out qualify-related stuff, but in process it is revealed that there is also significant part of multipers-related stuff which is also should be isolated

[PATCH] Unify usage of include guards.

2016-08-06 Thread Eugene Syromyatnikov
This commit is an attempt to unify usage of include guards (in top-level headers, at least). As a side note, different files with *.h extension have different semantics: for example, printargs.h is included multiple times in order to generate slightly varying code depending on values of macro

Re: Feature request: coloured output

2017-02-07 Thread Eugene Syromyatnikov
; Strace-devel mailing list > Strace-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/strace-devel > -- Eugene Syromyatnikov mailto:evg...@gmail.com xmpp:esyr@jabber.{ru|org} -- Check out the vibrant

Re: GSOC : Introducing myself

2017-02-18 Thread Eugene Syromyatnikov
ug_status%2Cpriority%2Cbug_severity=Fedora_based_on=_format=advanced -- Eugene Syromyatnikov mailto:evg...@gmail.com xmpp:esyr@jabber.{ru|org} -- Check out the vibrant tech community on one of the world's most enga

Re: GSOC : Introducing myself

2017-02-21 Thread Eugene Syromyatnikov
On Tue, Feb 21, 2017 at 11:24 AM, Animesh Kashyap <annimesh2...@gmail.com> wrote: > On Sun, Feb 19, 2017 at 12:20 AM, Eugene Syromyatnikov <evg...@gmail.com> > wrote: >> Well, strace itself does not utilise bug tracker of any sort; bugs and >> suggestions usually

Re: strace cant parse struct msghdr RHEL

2017-02-10 Thread Eugene Syromyatnikov
NTROUTE|MSG_CTRUNC|MSG_DONTWAIT|MSG_WAITALL|MSG_SYN|MSG_CONFIRM|MSG_MORE|0xff8b}, >> 0) = 12 >> ./strace: Out of memory >> sendmsg(8, {msg_name=NULL, msg_namelen=-7623584, msg_iov=NULL, >> msg_iovlen=33655230453052149, msg_control=./strace: umo

[PATCH] Move SH-specific argument number calculation to getllval

2016-08-20 Thread Eugene Syromyatnikov
This change prevents scattering of ll-related hacks and simplifies pread/pwrite syscalls parsers' logic a bit. * util.c (getllval): Add fixup for arg_no for SuperH when argument number is equal to 3 (see comment). * io.c (PREAD_OFFSET_ARG): Macro removed. (SYS_FUNC(pread)): Always use

[PATCH 2/2] Fix old_value argument retrieval in timerfd_settime parser

2016-08-22 Thread Eugene Syromyatnikov
This is done similar to timer_settime syscall parser. * time.c (SYS_FUNC(timerfd_settime)): retrieve old_value argument on exiting and not on entering. Return 0 instead of RVAL_DECODED (since call hasn't been decoded in full on entering). --- time.c | 20 +++- 1 file

[PATCH 0/2] Minor bug in timerfd_settime parser

2016-08-22 Thread Eugene Syromyatnikov
and second one fixes the aforementioned problem. Eugene Syromyatnikov (2): Fill old_value argument in timer{,fd}_xettime tests Fix old_value argument retrieval in timerfd_settime parser tests/timer_xettime.c |4 tests/timerfd_xettime.c |4 time.c | 20

[PATCH 0/2] Test and minor printf format fix for the readahead syscall

2016-08-31 Thread Eugene Syromyatnikov
Hello. There is some initial implementation of readahead syscall decoder test. While it is implemented, it has been noticed that incorrect format is used for printing "count" argument. Eugene Syromyatnikov (2): readahead: Fix print format for the "count" argument t

[PATCH 2/2] tests: check decoding of readahead syscall

2016-08-31 Thread Eugene Syromyatnikov
* tests/readahead.c: New file. * tests/readahead.test: New test. * tests/.gitignore: Add readahead. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add readahead.test. --- Simple test for simple decoder. tests/.gitignore |1 + tests/Makefile.am|2 ++

[PATCH] Makefile.am: use readlink as a fallback for realpath

2016-08-31 Thread Eugene Syromyatnikov
Since realpath utility is fairly new in GNU coreutils, there could be possibility that it is not present in the system. Instead of checking its presence in configure script it probably makes sense to resort to calling readlink since it is (probably) more widespread. --- Makefile.am |3 ++- 1

[PATCH v2 3/5] tests/futex: Add support for return codes other than 0 and -1 to sprintrc

2016-09-02 Thread Eugene Syromyatnikov
* tests/futex.c (sprintrc): Print the actual return code provided, not just "0"; checks for snprintf return code added. --- tests/futex.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/futex.c b/tests/futex.c index 28d9df8..09a6c25 100644 ---

[PATCH v2 1/5] tests/futex: Rename retstr to sprintrc

2016-09-02 Thread Eugene Syromyatnikov
* tests/futex.c (retstr): Rename to sprintstr, (main): Convert all retstr calls to sprintrc. --- tests/futex.c | 88 + 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/tests/futex.c b/tests/futex.c index dfdf68d..fe3741a

[PATCH v2 2/5] tests/futex: Increase static sprintrc buffer size

2016-09-02 Thread Eugene Syromyatnikov
* tests/futex.c (sprintrc) : Value increased from 256 to 4096. --- tests/futex.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/futex.c b/tests/futex.c index fe3741a..28d9df8 100644 --- a/tests/futex.c +++ b/tests/futex.c @@ -145,8 +145,7 @@ void invalid_op(int

[PATCH v2 4/5] tests: Move return code printing into a separate file

2016-09-02 Thread Eugene Syromyatnikov
* tests/tests.h: Add sprintrc declaration. * tests/futex.c (sprintrc): Remove. * tests/sprintrc.c: New file. * tests/Makefile.am (libtests_a_SOURCES): Add sprintrc.c. --- tests/Makefile.am |1 + tests/futex.c | 20 tests/sprintrc.c | 33

[PATCH v2 5/5] tests: check decoding of readahead syscall

2016-09-02 Thread Eugene Syromyatnikov
* tests/readahead.c: New file. * tests/readahead.test: New test. * tests/.gitignore: Add readahead. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add readahead.test. --- tests/.gitignore |1 + tests/Makefile.am|2 ++ tests/readahead.c| 62

[PATCH v2] tests: Some additional aio checks

2016-09-05 Thread Eugene Syromyatnikov
* aio.c: Additional checks added. --- Changes since v1: * All io_submit checks now use long as second argument, last io_submit check now always passes positive nr value. * Additional decoder checks reworked a bit in order to increase coverage. tests/aio.c | 137

[PATCH v2] Makefile.am: use dirname as a fallback for realpath

2016-09-05 Thread Eugene Syromyatnikov
Since realpath utility is fairly new in GNU coreutils, there could be possibility that it is not present in the system. Instead of checking its presence in configure script it probably makes sense to fall back to dirname call since it is more widespread. Initial implementation utilized readlink

[PATCH 3/7] tests: Add sprintrc_grep function

2016-09-05 Thread Eugene Syromyatnikov
sprintrc_grep function is sprintrc function equivalent suitable for tests where grep-base pattern matching is employed. * tests/sprintrc.c (enum sprintrc_fmt): New sprintrc format enumeration. (sprintrc_ex): New function, renamed from sprintrc with updates regarding support of different

[PATCH 2/7] tests: Perform more strict structure allocation in sched_xetattr test

2016-09-05 Thread Eugene Syromyatnikov
tail_alloc with precise size of the structure is used now. * tests/sched_xetattr.c: Eliminate usage of anonymous union type; rename sched to sched_attr; change type of sched_attr to struct pointer; use tail_alloc for sched_attr allocation; update printf statements accrodingly. ---

[PATCH 0/7] Minor tests tweaks pt. 2

2016-09-05 Thread Eugene Syromyatnikov
Hello. This time, mostly sched_xetattr tweaks. Another notable changes are new sprintrc_grep function and additional shmget check. Eugene Syromyatnikov (7): tests: Split long lines in sched_xetattr test tests: Perform more strict structure allocation in sched_xetattr test tests: Add

[PATCH 4/7] tests: Additional shmget decoder checks

2016-09-05 Thread Eugene Syromyatnikov
* tests/ipc_shm.c: Additional checks for shmget syscall decoding. --- tests/ipc_shm.c | 20 1 file changed, 20 insertions(+) diff --git a/tests/ipc_shm.c b/tests/ipc_shm.c index 54723e2..80a8f0f 100644 --- a/tests/ipc_shm.c +++ b/tests/ipc_shm.c @@ -27,11 +27,15 @@ */

[PATCH 7/7] tests: Additional sched_getattr/sched_setattr decoder checks

2016-09-05 Thread Eugene Syromyatnikov
* tests/sched_xetattr.c: Additional checs for sched_getattr and sched_setattr decoding. --- tests/sched_xetattr.c | 43 +++ 1 file changed, 43 insertions(+) diff --git a/tests/sched_xetattr.c b/tests/sched_xetattr.c index 9ff8c72..ce5c417 100644 ---

[PATCH 6/7] tests: Print size argument of sched_setattr as unsigned

2016-09-05 Thread Eugene Syromyatnikov
Since it is how it is declared. * tests/sched_xetattr.c: Cast size of struct sched_attr to unsigned, update format specifier accordingly. --- tests/sched_xetattr.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sched_xetattr.c b/tests/sched_xetattr.c index

[PATCH 5/7] tests: Change type of sched_nice field to signed in sched_xetattr test

2016-09-05 Thread Eugene Syromyatnikov
Kernel headers declare this field as s32, and strace prints it with %d specifier. * tests/sched_xetattr.c: Change type of sched_nice field of struct sched_attr to int32_t, update format specifiers accordingly. --- tests/sched_xetattr.c |6 +++--- 1 file changed, 3 insertions(+), 3

Re: [PATCH 2/2] tests: check decoding of readahead syscall

2016-09-01 Thread Eugene Syromyatnikov
On Thu, Sep 1, 2016 at 9:39 AM, Dmitry V. Levin <l...@altlinux.org> wrote: > On Thu, Sep 01, 2016 at 02:43:30AM +0300, Eugene Syromyatnikov wrote: >> * tests/readahead.c: New file. >> * tests/readahead.test: New test. >> * tests/.gitignore: Add readahead. >> *

Re: [PATCH] Makefile.am: use readlink as a fallback for realpath

2016-09-01 Thread Eugene Syromyatnikov
On Thu, Sep 1, 2016 at 9:35 AM, Dmitry V. Levin <l...@altlinux.org> wrote: > On Thu, Sep 01, 2016 at 02:47:34AM +0300, Eugene Syromyatnikov wrote: >> Since realpath utility is fairly new in GNU coreutils, there could be >> possibility that it is not present in the system

[PATCH 1/2] tests: Additional IPC checks

2016-09-07 Thread Eugene Syromyatnikov
* tests/ipc_msg.c: Additional msgget (parameter format), msgctl (parameter format, decoding of struct msqid_ds in IPC_SET/IPC_STAT commands) checks. * tests/ipc_sem.c: Additional semget, semctl checks. * tests/ipc_shm.c: Additional shmctl checks. * tests/semop.c: Additional semop checks. Added

[PATCH 0/2] Additional checks for IPC tests

2016-09-07 Thread Eugene Syromyatnikov
Hello. I've noticed that IPC tests do not check first parameter (IPC ID) enough which allowed incorrect format specifier usage. These patches augment tests with regard to aforementioned issue and correct illicit behaviour. Eugene Syromyatnikov (2): tests: Additional IPC checks Change type

[PATCH 2/2] Change type of the format specifier from "%lu" to "%d" for IPC ID

2016-09-07 Thread Eugene Syromyatnikov
* ipc_msgctl.c (SYS_FUNC(msgctl)): Convert format specifier of the first argument from "%lu" to "%d", cast argument to int. * ipc_sem.c (SYS_FUNC(semop)): Likewise. (SYS_FUNC(semtimedop)): Likewise. (SYS_FUNC(semget)): Likewise. * ipc_shm.c (SYS_FUNC(shmat)): Likewise. * ipc_shmctl.c

[PATCH v2 5/9] tests: Add sprintrc_grep function

2016-09-08 Thread Eugene Syromyatnikov
sprintrc_grep function is sprintrc function equivalent suitable for tests where grep-base pattern matching is employed. * tests/sprintrc.c (enum sprintrc_fmt): New sprintrc format enumeration. (sprintrc_ex): New function, renamed from sprintrc with updates regarding support of different

[PATCH v2 3/9] tests: Split long lines in sched_xetattr test

2016-09-08 Thread Eugene Syromyatnikov
--- tests/sched_xetattr.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/sched_xetattr.c b/tests/sched_xetattr.c index b437b04..b982cca 100644 --- a/tests/sched_xetattr.c +++ b/tests/sched_xetattr.c @@ -54,7 +54,10 @@ main(void) if

[PATCH v2 0/9] Minor tests tweaks pt. 2 + Additional checks for IPC tests

2016-09-08 Thread Eugene Syromyatnikov
f decoding checks. * Invalid addresses are now made more invalid in order to avoid accidental decoding. Eugene Syromyatnikov (9): Change type of the format specifier from "%lu" to "%d" for IPC ID Fix key_t argument printing in IPC *get calls tests: Split long lines in

[PATCH v2 7/9] tests: Print size argument of sched_setattr as unsigned

2016-09-08 Thread Eugene Syromyatnikov
Since it is how it is declared. * tests/sched_xetattr.c: Cast size of struct sched_attr to unsigned, update format specifier accordingly. --- tests/sched_xetattr.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sched_xetattr.c b/tests/sched_xetattr.c index

[PATCH v2 1/9] Change type of the format specifier from "%lu" to "%d" for IPC ID

2016-09-08 Thread Eugene Syromyatnikov
* ipc_msgctl.c (SYS_FUNC(msgctl)): Convert format specifier of the first argument from "%lu" to "%d", cast argument to int. * ipc_sem.c (SYS_FUNC(semop)): Likewise. (SYS_FUNC(semtimedop)): Likewise. (SYS_FUNC(semget)): Likewise. * ipc_shm.c (SYS_FUNC(shmat)): Likewise. * ipc_shmctl.c

[PATCH v2 2/9] Fix key_t argument printing in IPC *get calls

2016-09-08 Thread Eugene Syromyatnikov
key_t is actually int. * ipc_msg.c (SYS_FUNC(msgget)): Change format specifier of the first argument to "%#x". * ipc_sem.c (SYS_FUNC(semget)): Likewise. * ipc_shm (SYS_FUNC(shmget)): Likewise. --- ipc_msg.c |5 +++-- ipc_sem.c |5 +++-- ipc_shm.c |5 +++-- 3 files changed, 9

[PATCH v2 8/9] tests: Additional sched_getattr/sched_setattr decoder checks

2016-09-08 Thread Eugene Syromyatnikov
* tests/sched_xetattr.c: Additional checs for sched_getattr and sched_setattr decoding. --- tests/sched_xetattr.c | 43 +++ 1 file changed, 43 insertions(+) diff --git a/tests/sched_xetattr.c b/tests/sched_xetattr.c index 9ff8c72..ce5c417 100644 ---

[PATCH v2 9/9] tests: Additional IPC checks

2016-09-08 Thread Eugene Syromyatnikov
* tests/ipc_msg.c: Additional msgget (parameter format), msgctl (parameter format, decoding of struct msqid_ds in IPC_SET/IPC_STAT commands) checks. * tests/ipc_sem.c: Additional semget, semctl checks. * tests/ipc_shm.c: Additional shmget, shmctl checks. * tests/semop.c: Additional semop

[PATCH v2 6/9] tests: Change type of sched_nice field to signed in sched_xetattr test

2016-09-08 Thread Eugene Syromyatnikov
Kernel headers declare this field as s32, and strace prints it with %d specifier. * tests/sched_xetattr.c: Change type of sched_nice field of struct sched_attr to int32_t, update format specifiers accordingly. --- tests/sched_xetattr.c |6 +++--- 1 file changed, 3 insertions(+), 3

[PATCH 0/9] Minor decoder fixes and various tests amendments

2016-09-04 Thread Eugene Syromyatnikov
Hello. This is quite inconsistent collection of patches for various decoder test in attempt to make them more thorough. Eugene Syromyatnikov (9): tests: check decoding of perf_event_open syscall tests: Use sprintrc for return code output in sched_xetscheduler test tests: Additional decoder

[PATCH 5/9] tests: Additional decoder tests in sched_rr_get_interval

2016-09-04 Thread Eugene Syromyatnikov
Some additional syscall parser tests: * Incorrect timespec pointer. * Successful call. * tests/sched_rr_get_interval.c: Additional tests. --- tests/sched_rr_get_interval.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/sched_rr_get_interval.c

[PATCH 3/9] tests: Additional decoder tests in sched_xetscheduler

2016-09-04 Thread Eugene Syromyatnikov
Some additional syscall parser tests: * Incorrect (negative) PID in sched_getscheduler, sched_setscheduler * Incorrect address of sched_param structure. * Incorrect policy value. * tests/sched_xetscheduler.c: additional tests. --- tests/sched_xetscheduler.c | 19 +++ 1 file

[PATCH 4/9] tests: Use sprintrc for return code output in sched_rr_get_interval test

2016-09-04 Thread Eugene Syromyatnikov
* tests/sched_rr_get_interval.c: Use sprintrc for return code output. --- tests/sched_rr_get_interval.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/sched_rr_get_interval.c b/tests/sched_rr_get_interval.c index 8501346..73e2d39 100644 ---

[PATCH 1/9] tests: check decoding of perf_event_open syscall

2016-09-04 Thread Eugene Syromyatnikov
* tests/perf_event_open.c: New file. * tests/perf_event_open.test: New test. * tests/.gitignore: Add perf_event_open. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add perf_event_open.test. --- tests/.gitignore |1 + tests/Makefile.am |2 ++

[PATCH 9/9] tests: Some additional aio checks

2016-09-04 Thread Eugene Syromyatnikov
* aio.c: Additional checks added. --- tests/aio.c | 108 +++ 1 file changed, 108 insertions(+) diff --git a/tests/aio.c b/tests/aio.c index 8c5bfa7..00de5ae 100644 --- a/tests/aio.c +++ b/tests/aio.c @@ -111,6 +111,33 @@ main(void)

[PATCH 7/9] tests: Use sprintrc for return code output in aio test

2016-09-04 Thread Eugene Syromyatnikov
* tests/aio.c: Use sprintrc for return code output. --- tests/aio.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/aio.c b/tests/aio.c index a6a3b9c..5a023cf 100644 --- a/tests/aio.c +++ b/tests/aio.c @@ -147,8 +147,8 @@ main(void)

[PATCH 8/9] tests: min_nr and nr arguments in io_getevents should be long

2016-09-04 Thread Eugene Syromyatnikov
* aio.c (main): change output format for min_nr and nr arguments in io_getevents check to %ld, cast arguments to long. --- tests/aio.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/aio.c b/tests/aio.c index 5a023cf..8c5bfa7 100644 --- a/tests/aio.c +++

[PATCH 2/9] tests: Use sprintrc for return code output in sched_xetscheduler test

2016-09-04 Thread Eugene Syromyatnikov
* tests/sched_xetscheduler.c: Use sprintrc for return code output. --- tests/sched_xetscheduler.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sched_xetscheduler.c b/tests/sched_xetscheduler.c index d3b7759..ffb3307 100644 --- a/tests/sched_xetscheduler.c +++

[PATCH v3] tests: check decoding of readahead syscall

2016-09-04 Thread Eugene Syromyatnikov
* tests/readahead.c: New file. * tests/readahead.test: New test. * tests/.gitignore: Add readahead. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add readahead.test. --- Changes since v2: * Added workaround for an old glibc bug

Re: [PATCH 4/8] Add xlat values for FUTEX_WAIT commands with FUTEX_CLOCK_REALTIME bit set

2016-08-29 Thread Eugene Syromyatnikov
On Mon, Aug 29, 2016 at 5:45 PM, Dmitry V. Levin <l...@altlinux.org> wrote: > On Mon, Aug 29, 2016 at 06:12:55PM +0300, Eugene Syromyatnikov wrote: >> The support for these has been added in commit g337f130, before Linux 4.5. > > commit g337f130? Is it a septendecima

[PATCH v2 0/7] Some futex parser tweaks and futex test

2016-08-29 Thread Eugene Syromyatnikov
in comments. * Futex test: instances of direct usage of magic constants replaced with appropriate macro usage (VAL/VAL_PR) * Futex test: some typo fixes, etc. * Other patches haven't been changed. Eugene Syromyatnikov (7): Fix FUTEX_WAKE_OP compare function mask futex: Add handling of FUTEX_FD

[PATCH v2 3/7] futex: Some refinement to unknown command argument formatting

2016-08-29 Thread Eugene Syromyatnikov
Several changes have been performed: * alternate form is used for timeout value since it is pointer half of the time. And half of the time it is not, which can be confusing without number base prefix. * uaddr is pointer across all existing operations, so it's rather expected that it

[PATCH v2 4/7] Add xlat values for FUTEX_WAIT commands with FUTEX_CLOCK_REALTIME bit set

2016-08-29 Thread Eugene Syromyatnikov
The support for these has been added in commit 337f130, before Linux 4.5. * xlat/futexops.in: add FUTEX_WAIT|FUTEX_CLOCK_REALTIME and FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME records. --- xlat/futexops.in |2 ++ 1 file changed, 2 insertions(+) diff --git a/xlat/futexops.in

[PATCH v2 2/7] futex: Add handling of FUTEX_FD command

2016-08-29 Thread Eugene Syromyatnikov
Since FUTEX_FD is known (and most likely reserved for the future use), albeit obsolete, it has some expected argument format, so it's probably wise to employ it. * futex.c (SYS_FUNC(futex)): add handling of FUTEX_FD command. --- futex.c |1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v2 6/7] futex: Avoid printing val when it is not used by the command

2016-08-29 Thread Eugene Syromyatnikov
Analogous to timeout argument omitting in FUTEX_WAKE_BITSET command. * futex.c (SYS_FUNC(futex)): Remove common val argument print call, add it into specific command cases (all except FUTEX_LOCK_PI, FUTEX_UNLOCK_PI, FUTEX_TRYLOCK_PI). --- futex.c | 14 +- 1 file changed, 13

[PATCH v2 5/7] futex: Use alternate form for val3 presented in hex

2016-08-29 Thread Eugene Syromyatnikov
In order to distinguish it from the cases where it is printed in decimal. * futex.c (SYS_FUNC(futex)) : use alternate form for the val3 argument. --- futex.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/futex.c b/futex.c index

[PATCH 0/5] tests: Refactor of retstr from futex.c into a library function and updated readahead test

2016-09-01 Thread Eugene Syromyatnikov
of this patch set, since looks like it is fine as is. Eugene Syromyatnikov (5): tests/futex: Rename retstr to sprintrc tests/futex: Increase static sprintrc buffer size tests/futex: Add support for return codes other than 0 and -1 to sprintrc tests: Move return code printing into a separate

[PATCH 2/5] tests/futex: Increase static sprintrc buffer size

2016-09-01 Thread Eugene Syromyatnikov
* tests/futex.c (sprintrc) : Value increased from 256 to 4095. --- tests/futex.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/futex.c b/tests/futex.c index dca191e..edb5c9d 100644 --- a/tests/futex.c +++ b/tests/futex.c @@ -145,7 +145,7 @@ void invalid_op(int

[PATCH 1/5] tests/futex: Rename retstr to sprintrc

2016-09-01 Thread Eugene Syromyatnikov
* tests/futex.c (retstr): Rename to sprintrc, (main): Update all retstr calls to sprintrc. --- tests/futex.c | 88 + 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/tests/futex.c b/tests/futex.c index dfdf68d..dca191e

[PATCH 5/5] tests: check decoding of readahead syscall

2016-09-01 Thread Eugene Syromyatnikov
* tests/readahead.c: New file. * tests/readahead.test: New test. * tests/.gitignore: Add readahead. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add readahead.test. --- tests/.gitignore |1 + tests/Makefile.am|2 ++ tests/readahead.c| 62

[PATCH 3/5] tests/futex: Add support for return codes other than 0 and -1 to sprintrc

2016-09-01 Thread Eugene Syromyatnikov
* tests/futex.c (sprintrc): Print the actual return code provided, not just "0". --- tests/futex.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/futex.c b/tests/futex.c index edb5c9d..fb7833c 100644 --- a/tests/futex.c +++ b/tests/futex.c @@ -147,11

[PATCH 4/5] tests: Move return code printing into a separate file

2016-09-01 Thread Eugene Syromyatnikov
* tests/tests.h: Add sprintrc declaration. * tests/futex.c (sprintrc): Remove. * tests/sprintrc.c: New file. * tests/Makefile.am (libtests_a_SOURCES): Add sprintrc.c. --- tests/Makefile.am |1 + tests/futex.c | 24 tests/sprintrc.c | 36

[PATCH] futex: Remove inclusion which is not used

2016-08-30 Thread Eugene Syromyatnikov
configure script doesn't perform check for linux/futex.h presence, so HAVE_LINUX_FUTEX_H is always undefined and inclusion of system header is never performed. Moreover, this header had an incorrect definition of FUTEX_WAIT_BITSET_PRIVATE/FUTEX_WAKE_BITSET_PRIVATE in the past: from commit

[PATCH] Refactor common sa_handler printing code

2016-08-31 Thread Eugene Syromyatnikov
* xlat/sa_handler_values.in: New file. * signal.c: Include "xlat/sa_handler_values.h". (get_sa_handler_str, print_sa_handler): New functions. (SYS_FUNC(sigsetmask), SYS_FUNC(signal), decode_new_sigaction): Use them. --- signal.c | 64

[PATCH v4] tests: Additional IPC checks

2016-09-13 Thread Eugene Syromyatnikov
* tests/ipc_msg.c: Additional msgget (parameter format), msgctl (parameter format, decoding of struct msqid_ds in IPC_SET/IPC_STAT commands) checks. * tests/ipc_sem.c: Additional semget, semctl checks. * tests/ipc_shm.c: Additional shmget, shmctl checks. * tests/semop.c: Additional semop

[PATCH v3 0/2] Aditional checks for IPC tests

2016-09-12 Thread Eugene Syromyatnikov
Changes since v2: * Workaround for musl which sets size argument in shmget call to SIZE_MAX if it is greater than PTRDIFF_MAX. * Fix pattern for indirect semctl call. * Added workaround for broken msgctl call with faulty pointer in third argument on PPC64. Eugene Syromyatnikov (2

[PATCH v3 1/2] tests: Additional IPC checks

2016-09-12 Thread Eugene Syromyatnikov
* tests/ipc_msg.c: Additional msgget (parameter format), msgctl (parameter format, decoding of struct msqid_ds in IPC_SET/IPC_STAT commands) checks. * tests/ipc_sem.c: Additional semget, semctl checks. * tests/ipc_shm.c: Additional shmget, shmctl checks. * tests/semop.c: Additional semop

Re: [PATCH v3 2/2] tests: Workaroud for buggy glibc in ipc_msg test on ppc64

2016-09-13 Thread Eugene Syromyatnikov
On Tue, Sep 13, 2016 at 7:32 AM, Andreas Schwab <sch...@suse.de> wrote: > On Sep 13 2016, Eugene Syromyatnikov > <evgsyr-re5jqeeqqe8avxtiumw...@public.gmane.org> wrote: > >> glibc before 2.23 (glibc-2.22-122-gbe48165? to be more precise) tried to >> access

[PATCH 5/8] keyctl: Print errno name in KEYCTL_REJECT in case it is available

2016-09-29 Thread Eugene Syromyatnikov
* keyctl.c (keyctl_reject_key): Get errno string via err_name and print it if it is not NULL. --- keyctl.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/keyctl.c b/keyctl.c index c9081b7..1fb1da5 100644 --- a/keyctl.c +++ b/keyctl.c @@ -175,8 +175,16 @@ static

[PATCH 8/8] tests: Add add_key, keyctl, request_key tests

2016-09-29 Thread Eugene Syromyatnikov
* tests/Makefile.am (DECODER_TESTS): Add add_key.test, keyctl.test, request_key.test. (check_PROGRAMS): Add add_key, keyctl, request_key. * tests/.gitignore: Likewise. * tests/add_key.c: New file. * tests/add_key.test: Likewise. * tests/keyctl.c: Likewise. * tests/keyctl.test: Likewise. *

[PATCH 6/8] keyctl: Add support for KEYCTL_DH_COMPUTE

2016-09-29 Thread Eugene Syromyatnikov
* keyctl.c (struct keyctl_dh_params): New structure. (print_dh_params): New function. (keyctl_dh_compute): New function. (SYS_FUNC(keyctl)): Add support for KEYCTL_DH_COMPUTE cmd value. --- keyctl.c | 46 ++ 1 file changed, 46 insertions(+)

[PATCH 1/8] keyctl: Use printuid for printing UID/GID

2016-09-29 Thread Eugene Syromyatnikov
UID/GID are unsigned except special -1 value (which is also special in context of specific keyctl commands), so special printing function should be used. * keyctl.c (keyctl_chown_key): Use printuid instead of printf with "%d" conversion for printing UID/GID. (keyctl_get_persistent): Likewise.

[PATCH 0/8] keyctl tests

2016-09-29 Thread Eugene Syromyatnikov
Hello. This patchset provides minor updates to decoders in keyctl.c along with tests for add_key, keyctl, and request_key syscall decoders. Eugene Syromyatnikov (8): keyctl: Use printuid for printing UID/GID keyctl: Use getarg_ull for printing generic arguments keyctl: Do not print comma

[PATCH 7/8] io: Handle data_size of -1 as unlimited data in print_iovec

2016-09-29 Thread Eugene Syromyatnikov
Otherwise it can be depleted and print_iovec starts printing empty strings. * io.c (print_iovec): Interpret c->data_size of -1 as unlimited data and do not decrease it in this case. --- io.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io.c b/io.c index

[PATCH 2/8] keyctl: Use getarg_ull for printing generic arguments

2016-09-29 Thread Eugene Syromyatnikov
Otherwise it is erroneous on x32, for example. * keyctl.c (SYS_FUNC(keyctl)): Use "%#llx" conversion specifier and getarg_ull for fallback argument printing. --- keyctl.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyctl.c b/keyctl.c index ecb3e79..a0bbbd0

[PATCH 4/8] Add function for getting errno string.

2016-09-29 Thread Eugene Syromyatnikov
* syscall.c (err_name): New function. * defs.h: Add declaration of err_name(). --- defs.h|1 + syscall.c |9 + 2 files changed, 10 insertions(+) diff --git a/defs.h b/defs.h index ffea23f..1e2363b 100644 --- a/defs.h +++ b/defs.h @@ -457,6 +457,7 @@ extern void

[PATCH 3/8] keyctl: Do not print comma for KEYCTL_SESSION_TO_PARENT command

2016-09-29 Thread Eugene Syromyatnikov
Since this command doesn't have any additional arguments, the comma does not needed. Since this is the only command which lacks additional arguments, it's better to add special case for it rather than add printing of comma to all other commands. * keyctl.c (SYS_FUNC(keyctl)): Add check for

Re: strace 4.14 released

2016-10-05 Thread Eugene Syromyatnikov
On Wed, Oct 5, 2016 at 9:08 AM, Andreas Schwab wrote: > I'm seeing this testsuite failure: > > https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:Factory/strace/s/s390x > > FAIL: count > === > > Pattern of expected output: *[^ ]+

Re: strace 4.14 released

2016-10-05 Thread Eugene Syromyatnikov
On Wed, Oct 5, 2016 at 9:35 AM, Andreas Schwab <sch...@suse.de> wrote: > On Okt 05 2016, Eugene Syromyatnikov > <evgsyr-re5jqeeqqe8avxtiumw...@public.gmane.org> wrote: > >> May be you have any ideas regarding possibilities of fixing the >> environment in order

Re: strace 4.14 released

2016-10-05 Thread Eugene Syromyatnikov
On Wed, Oct 5, 2016 at 9:56 AM, Andreas Schwab <sch...@suse.de> wrote: > On Okt 05 2016, Eugene Syromyatnikov > <evgsyr-re5jqeeqqe8avxtiumw...@public.gmane.org> wrote: > >> On Wed, Oct 5, 2016 at 9:35 AM, Andreas Schwab >> <schwab-l3a5bk7w...@public.gmane.or

Re: basic questions to strace

2016-10-07 Thread Eugene Syromyatnikov
On Fri, Oct 7, 2016 at 4:08 PM, Lentes, Bernd <bernd.len...@helmholtz-muenchen.de> wrote: > > > - On Oct 7, 2016, at 3:59 PM, Eugene Syromyatnikov evg...@gmail.com wrote: > > >>> Starting a process give me this error in the log: >>> traps: nsrexecd[12162

Re: basic questions to strace

2016-10-07 Thread Eugene Syromyatnikov
On Fri, Oct 7, 2016 at 1:16 PM, Lentes, Bernd wrote: > Hi, > > i'm a system administrator, not a developer. I use strace sometimes for > debugging problems, and i like it very much. Nice tool. > I have some principal questions and hope this is the right

[PATCH 11/21] dm: Compare entering field values with exiting ones

2016-10-09 Thread Eugene Syromyatnikov
--- dm.c | 74 -- tests/ioctl_dm.c | 26 +++ 2 files changed, 64 insertions(+), 36 deletions(-) diff --git a/dm.c b/dm.c index f23a65d..b6fb11d 100644 --- a/dm.c +++ b/dm.c @@ -282,28 +282,62 @@

[PATCH 12/21] dm: Add inttypes.h, include reorder

2016-10-09 Thread Eugene Syromyatnikov
Build failed otherwise on RHEL 5. --- dm.c |3 ++- tests/ioctl_dm.c |1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dm.c b/dm.c index b6fb11d..a11196f 100644 --- a/dm.c +++ b/dm.c @@ -2,8 +2,9 @@ #ifdef HAVE_LINUX_DM_IOCTL_H -# include +# include #

[PATCH 09/21] dm: Remove char * cast

2016-10-09 Thread Eugene Syromyatnikov
--- dm.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dm.c b/dm.c index adfa97e..3ee74c3 100644 --- a/dm.c +++ b/dm.c @@ -286,7 +286,7 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code, long arg) char *extra = NULL; uint32_t extra_size = 0; -

[PATCH 06/21] dm: Some future-proofing by means of compile-time DM_VERSION_MAJOR check

2016-10-09 Thread Eugene Syromyatnikov
* dm.c: Add check whether DM_VERSION_MAJOR equals to 4, provide empty dm_ioctl if check fails. --- dm.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dm.c b/dm.c index ebdfc44..79bb7c7 100644 --- a/dm.c +++ b/dm.c @@ -5,6 +5,8 @@ # include # include +#

[PATCH 05/21] xlat: Add values for dm_flags

2016-10-09 Thread Eugene Syromyatnikov
Otherwise build fails on some old distros which lack DM_DATA_OUT_FLAG and other flags (excerpt from RHEL 5 build log): [ 66s] dm.c: In function 'dm_known_ioctl': [ 66s] dm.c:311: error: 'DM_DATA_OUT_FLAG' undeclared (first use in this function) [ 66s] dm.c:311: error: (Each undeclared

[PATCH 07/21] dm: Add definitions for ioctl commands not implemented initially

2016-10-09 Thread Eugene Syromyatnikov
dm.c [!DM_LIST_VERSIONS] (DM_LIST_VERSIONS): New definition. [!DM_TARGET_MSG] (DM_TARGET_MSG): Likewise. [!DM_DEV_SET_GEOMETRY] (DM_DEV_SET_GEOMETRY): Likewise. --- dm.c | 13 + 1 file changed, 13 insertions(+) diff --git a/dm.c b/dm.c index 79bb7c7..66b615d 100644 --- a/dm.c +++

[PATCH 13/21] dm: Move printing of dm_ioctl fields before allocation of extra data

2016-10-09 Thread Eugene Syromyatnikov
--- dm.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dm.c b/dm.c index a11196f..73a9b57 100644 --- a/dm.c +++ b/dm.c @@ -335,6 +335,10 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code, long arg) goto skip; } +

[PATCH 15/21] dm: Additional data_size/data_start checks

2016-10-09 Thread Eugene Syromyatnikov
--- dm.c |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dm.c b/dm.c index 814d7d2..289bc0d 100644 --- a/dm.c +++ b/dm.c @@ -293,7 +293,8 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code, long arg) if (!ioc) return 0; - if

[PATCH 10/21] dm: use => instead of , for splitting output structure from input

2016-10-09 Thread Eugene Syromyatnikov
--- dm.c |4 ++-- tests/ioctl_dm.c | 12 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dm.c b/dm.c index 3ee74c3..f23a65d 100644 --- a/dm.c +++ b/dm.c @@ -288,8 +288,8 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code, long arg)

[PATCH 17/21] dm: Add data_size and data_offset fields to output

2016-10-09 Thread Eugene Syromyatnikov
--- dm.c |4 +++- tests/ioctl_dm.c | 41 - 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/dm.c b/dm.c index 5c908c9..caffc55 100644 --- a/dm.c +++ b/dm.c @@ -327,7 +327,6 @@ dm_known_ioctl(struct tcb *tcp, const unsigned

[PATCH 14/21] dm: replace abbrev branching with goto

2016-10-09 Thread Eugene Syromyatnikov
--- dm.c | 78 ++ 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/dm.c b/dm.c index 73a9b57..814d7d2 100644 --- a/dm.c +++ b/dm.c @@ -350,52 +350,54 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code, long

[PATCH 16/21] dm: Add comment regarding intended fall-through in switch statement

2016-10-09 Thread Eugene Syromyatnikov
--- dm.c |1 + 1 file changed, 1 insertion(+) diff --git a/dm.c b/dm.c index 289bc0d..5c908c9 100644 --- a/dm.c +++ b/dm.c @@ -60,6 +60,7 @@ dm_decode_values(struct tcb *tcp, const unsigned int code, case DM_DEV_SUSPEND: if (ioc->flags &

[PATCH 02/21] dm: whitespace fixes

2016-10-09 Thread Eugene Syromyatnikov
--- dm.c | 87 +++--- 1 file changed, 52 insertions(+), 35 deletions(-) diff --git a/dm.c b/dm.c index 33a3972..d81983d 100644 --- a/dm.c +++ b/dm.c @@ -2,8 +2,8 @@ #ifdef HAVE_LINUX_DM_IOCTL_H -#include -#include +# include

[PATCH 03/21] tests: Working around bounds check

2016-10-09 Thread Eugene Syromyatnikov
When building with -Wp,-D_FORTIFY_SOURCE=2, dompiler produces the following warning: In file included from /usr/include/string.h:638:0, from ioctl_dm.c:4: In function ‘strcpy’, inlined from ‘main’ at ioctl_dm.c:57:8: /usr/include/bits/string3.h:104:3: warning: call to

[PATCH 04/21] dm: Minor output tweaks

2016-10-09 Thread Eugene Syromyatnikov
Trying to make it more C-like and in line with common practices regarding structure printing. --- dm.c | 21 + tests/ioctl_dm.c |2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dm.c b/dm.c index d81983d..ebdfc44 100644 --- a/dm.c +++

[PATCH 21/21] dm: rewrite structure decoding

2016-10-09 Thread Eugene Syromyatnikov
Rewrite structure decoding in attempt to make it more in line with how structures and arrays are decoded in strace. * Replace single structure retrieval with on-demand retrieval. It allows limiting amount of memory being allocated (suppose ioctl with data_size = -1) * Check for abbrev in

  1   2   3   >