From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/execveat01: new test to verify execveat unlinked fd
Date: Tue, 31 Jul 2018 14:43:32 +0200 [thread overview]
Message-ID: <20180731124331.GB32738@rei> (raw)
In-Reply-To: <CALLuPvrDgQX8XB-oVL_gm58cwRSinVNXTk5PzyUxcG8fG+Wcmw@mail.gmail.com>
Hi!
> I removed "if (status == 0) tst_res(TPASS, ..." from execveat01.c and
> add "tst_res(TPASS, ..." in execveat_child.c, but I got a no reported
> result error:
>
> execveat_child.c:44: PASS: execveat_child run as expected
> tst_test.c:869: BROK: Test haven't reported results!
>
> It seems child's test result doesn't propagated to parent.
> Do I use wrong API in child or miss something in parent?
You are right, this is supposed to work but nobody checked that and
while the IPC is mapped the results pointer is not initialized in the
test library.
It should work with following patch:
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 008bcefe0..bb3908d6c 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -152,6 +152,7 @@ void tst_reinit(void)
fd = SAFE_OPEN(path, O_RDWR);
ptr = SAFE_MMAP(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ results = ptr;
tst_futexes = (char*)ptr + sizeof(struct results);
tst_max_futexes = (size - sizeof(struct results))/sizeof(futex_t);
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2018-07-31 12:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-27 7:58 [LTP] [PATCH] syscalls/execveat01: new test to verify execveat unlinked fd Eddie.Horng
2018-07-27 9:47 ` Cyril Hrubis
2018-07-30 9:41 ` Eddie Horng
2018-07-30 10:44 ` Cyril Hrubis
2018-07-31 6:46 ` Eddie Horng
2018-07-31 12:43 ` Cyril Hrubis [this message]
[not found] <1530523133.30361.41.camel@mtkswgap22>
2018-07-02 10:46 ` Amir Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180731124331.GB32738@rei \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox