From d8a9a8ca7cb3c1c988a174adc3cf7fdfea3c7aeb Mon Sep 17 00:00:00 2001 From: Adrian Taylor Date: Thu, 16 Jun 2022 14:25:13 -0700 Subject: [PATCH] Detect segfaults in reduction --- tools/reduce/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/reduce/src/main.rs b/tools/reduce/src/main.rs index 17c5bf055..06110cd91 100644 --- a/tools/reduce/src/main.rs +++ b/tools/reduce/src/main.rs @@ -482,7 +482,7 @@ fn create_interestingness_test( mv concat.h concat-body.h echo Codegen (echo \"#ifndef __CONCAT_H__\"; echo \"#define __CONCAT_H__\"; echo '#include \"concat-body.h\"'; echo \"#endif\") > concat.h - ({} {} 2>&1 && cat autocxx-ffi-default-gen.rs && cat autocxxgen*.h && {} 2>&1 ) {} + (trap \"if [[ \\$? -eq 139 ]]; then echo Segfault; fi\" CHLD; {} {} 2>&1 && cat autocxx-ffi-default-gen.rs && cat autocxxgen*.h && {} 2>&1 ) {} echo Remove rm concat.h echo Swap back