> When an ASSERT fails in a TEST_F(), __bail() longjmp()s back to the
> setjmp() in the test wrapper, where the grandchild that ran the test
> should see child == 0 and run the fixture teardown. child is a local
> that fork() sets after setjmp(), so its value after longjmp() is
> indeterminate. With -O2 it comes back as 1, its value at setjmp(): the
> grandchild takes the parent's path, skips the teardown and aborts. A
> failed test then leaves its cgroups, files or mounts behind, and the
> next test can fail on them, as test_cache does on the cgroup that a
> failed test_numa_migrate left.
> 
> Make the variable volatile, so it keeps the value fork() returned.
> 
> Mainline no longer uses setjmp() here since commit 869c788909b9
> ("selftests: harness: Stop using setjmp()/longjmp()"), which was a
> large rewrite, and out of scope for this series.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-154520
> Feature: fix selftests
> 
> Signed-off-by: Eva Kurchatova <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review ยท 
https://sashiko.vzint.dev/#/patchset/[email protected]?part=1


_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to