summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorArkadiusz Hiler <arkadiusz.hiler@intel.com>2019-05-08 13:00:06 +0300
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2019-05-10 10:58:54 +0300
commit9c6bda2c852b70fae2fa8e058198c974d2d1bdda (patch)
tree0f640cf87ab5c1d492a49479fd729ba67b40ff9b /m4
parenta269c21fc3d52ab502aa5cf98e47aca6520e5a37 (diff)
runner_tests: Operate within defined behavior
Quoting lib/igt_core.c: * - Code blocks with magic control flow are implemented with setjmp() and * longjmp(). This applies to #igt_fixture and #igt_subtest blocks and all the * three variants to finish test: igt_success(), igt_skip() and igt_fail(). * Mostly this is of no concern, except when such a control block changes * stack variables defined in the same function as the control block resides. * Any store/load behaviour after a longjmp() is ill-defined for these * variables. Avoid such code. * * Quoting the man page for longjmp(): * * "The values of automatic variables are unspecified after a call to * longjmp() if they meet all the following criteria:" * - "they are local to the function that made the corresponding setjmp() call; * - "their values are changed between the calls to setjmp() and longjmp(); and * - "they are not declared as volatile." We have quite a few igt_subtest_group that define local variables to share the state between subtest and fixture (e.g. set open() in subtest, close() in the following fixture), causing the contents to be undefined. We can allocate some of them using malloc and make the others volatile to be back on the defined grounds. Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'm4')
0 files changed, 0 insertions, 0 deletions