[Piglit] [PATCH] Use _exit() instead of exit() in child processes

Michel Dänzer michel at daenzer.net
Wed Jun 6 09:43:18 UTC 2018


From: Michel Dänzer <michel.daenzer at amd.com>

A child process which doesn't call exec() shouldn't use exit(), as that
will attempt to run any atexit handlers of the parent, which may break.
It actually results in crashing with the Mesa radeonsi driver.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 .../spec/glx_ext_import_context/import-context-multi-process.c  | 2 +-
 tests/spec/glx_ext_import_context/make-current-multi-process.c  | 2 +-
 tests/spec/glx_ext_import_context/make-current-single-process.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/spec/glx_ext_import_context/import-context-multi-process.c b/tests/spec/glx_ext_import_context/import-context-multi-process.c
index 5f758d6a8..3d4ab9c91 100644
--- a/tests/spec/glx_ext_import_context/import-context-multi-process.c
+++ b/tests/spec/glx_ext_import_context/import-context-multi-process.c
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
 		pass = try_import_context(0xDEADBEEF, invalid)
 			&& pass;
 
-		exit(pass ? 0 : 1);
+		_exit(pass ? 0 : 1);
 	}
 
 	/* The test passes if the child exited normally with a return value of
diff --git a/tests/spec/glx_ext_import_context/make-current-multi-process.c b/tests/spec/glx_ext_import_context/make-current-multi-process.c
index 0f88eaf97..23e50715f 100644
--- a/tests/spec/glx_ext_import_context/make-current-multi-process.c
+++ b/tests/spec/glx_ext_import_context/make-current-multi-process.c
@@ -62,7 +62,7 @@ int main(int argc, char **argv)
 		XSync(dpy, 0);
 		pass = validate_glx_error_code(BadAccess, -1);
 
-		exit(pass ? 0 : 1);
+		_exit(pass ? 0 : 1);
 	}
 
 	/* The test passes if the child exited normally with a return value of
diff --git a/tests/spec/glx_ext_import_context/make-current-single-process.c b/tests/spec/glx_ext_import_context/make-current-single-process.c
index 0475f4446..d8734032f 100644
--- a/tests/spec/glx_ext_import_context/make-current-single-process.c
+++ b/tests/spec/glx_ext_import_context/make-current-single-process.c
@@ -52,7 +52,7 @@ int main(int argc, char **argv)
 		XSync(dpy, 0);
 		pass = validate_glx_error_code(Success, -1);
 
-		exit(pass ? 0 : 1);
+		_exit(pass ? 0 : 1);
 	}
 
 	/* The test passes if the child exited normally with a return value of
-- 
2.17.1



More information about the Piglit mailing list