From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] lib/tst_test.c: Fix tst_brk() handling
Date: Thu, 3 Apr 2025 14:36:10 +0200 [thread overview]
Message-ID: <20250403123610.GA465253@pevik> (raw)
In-Reply-To: <20250403113053.20040-1-chrubis@suse.cz>
Hi all,
[ Cc Jan and Li s there can be some hidden problems. ]
> This makes the tst_brk() handling cleaner and saner as instead of
> propagating the tst_brk() result in a return value an abort flag is
> introduced into the shared memory.
> Now:
> - All the processes but the library one that reports the results exit
> with 0
> - tst_brk(TBROK, ...) increments result conters, sets the abort flag.
> and exit current process
> - all other tst_brk() variants will just increments the countes and
> exits the current process
> This makes the tst_brk() behavior well defined so we can now even call
> tst_brk() with TFAIL and TPASS as well.
+1. As a separate effort we can replace with coccinelle
tst_res(TFAIL or TPASS) followed by return by tst_brk(TFAIL or TPASS).
> And since TBROK is supposed to exit the test immediatelly (i.e.
> unrecoverable error) we are now properly doing so.
> The case that main test pid called TBROK was working correctly before
> this patch, since send the SIGKILL signal to he process group after we
> waited for the main test pid. All that was missing is a code that sends
> a signal to the main test pid in the case that TBROK was triggered by
> one of it's children and now we properly kill all test processes in that
> case as well.
+1
Also thanks for doing tests.
Generally LGTM.
One thing I'm worried is the fact that some shell loader tests core dumped in CI:
https://github.com/pevik/ltp/actions/runs/14242818586/job/39916477770
e.g. these which are supposed to TBROK due broken metadata:
shell_loader_invalid_block.sh, shell_loader_no_metadata.sh,
shell_loader_wrong_metadata.sh:
Segmentation fault (core dumped)
I also wonder if tst_brk() related doc should be updated.
Isn't there anything which should be updated in doc/old/C-Test-API.asciidoc ?
This docs will stay with us for some time, the conversion to kerneldoc takes
time, it'd be good to keep it updated (valuable texts will be migrated to
kerneldoc).
Maybe parts:
1.8 Doing the test in the child process
1.9 Fork() and Parent-child synchronization
(both code examples and the description).
very nit: please before merge fix typos in both code and commit message:
exitting => exiting
countes|countes => counters
immediatelly => immediately
filtesystem => filesystem
NOTE: test_brk_pass could be added to lib/newlib_tests/runtest.sh. I would also
prefer, if we changed tests to behave like testcases/lib/run_tests.sh, i.e.
allow to run all tests and check exit code (intermediate step before we compare
the test output).
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-04-03 12:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-03 11:30 [LTP] [PATCH] lib/tst_test.c: Fix tst_brk() handling Cyril Hrubis
2025-04-03 12:36 ` Petr Vorel [this message]
2025-04-03 14:12 ` Cyril Hrubis
2025-04-04 12:04 ` Cyril Hrubis
2025-04-04 12:55 ` Petr Vorel
2025-04-04 12:58 ` Jan Stancek via ltp
2025-04-04 14:00 ` Cyril Hrubis
2025-04-04 13:18 ` Petr Vorel
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=20250403123610.GA465253@pevik \
--to=pvorel@suse.cz \
--cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.