[LTP] [PATCH] lib/tst_test.c: Fix tst_brk() handling
Cyril Hrubis
chrubis@suse.cz
Fri Apr 4 16:00:47 CEST 2025
Hi!
> Interesting, I never noticed lib_pid :). It's assigned in tst_run_tcases() -
> library gets initialized there. As that's the very first call in main(), this
> really applies for helpers in testcases/lib/ which define TST_NO_DEFAULT_MAIN.
>
> I suppose this is the part of the fix for core dumped helpers.
The tst_run_shell.c needs to fill in the tst_test structure first and
that is done before the test library was initialized. If we happen to
call tst_brk() in that phase we have to make sure that we do not touch
the results structure, which wasn't mapped yet and that we exit() with
right exit value. After these changes, once the test library has been
initialized all processes but the test library has to exit with success
and the final exit value is produce by the test library process.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list