[PATCH intel-gpu-tools 1/1] drmtest: exit() rather than abort() for simple usage errors.

Bryce Harrington bryce at canonical.com
Tue Jan 24 19:44:44 PST 2012

When the benchmarks are run as non-root, they terminate since they can't
read the drm files.  However, by terminating with abort(), this raises
SIGSEGV which has the side effect of triggering crash reporting
utilities (e.g. apport).  As a result we've been accumulating bug
reports about it.

As the code is displaying a unique error message prior to termination,
it should be discoverable enough where in the code the failure occurs,
so an exit(1) should be sufficient for termination.

Signed-off-by: Bryce Harrington <bryce at canonical.com>
 lib/drmtest.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index fc40ad1..5ebd6d6 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -65,7 +65,7 @@ int drm_open_any(void)
 	fprintf(stderr, "failed to open any drm device. retry as root?\n");
-	abort();
+	exit(1);
@@ -108,5 +108,5 @@ int drm_open_any_master(void)
 		return fd;
 	fprintf(stderr, "Couldn't find an un-controlled DRM device\n");
-	abort();
+	exit(1);

More information about the xorg-devel mailing list