Skip to contentSkip to conversation

xfstests 228: suppress core dump message

PATCH In review Eric Sandeen 2 participants 3 messages Jun 9, 2010 – Aug 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests 228: suppress core dump message

When running 228 with abrt on in rhel6, I was getting different output due to a (core dumped) message on SIGXFSZ. For some reason I wasn't able to use sed to filter it, and just ulimit -c 0 didn't suppress it either.

abrt sets the core pattern to:

"|/usr/libexec/abrt-hook-ccpp /var/spool/abrt %p %s %u %c""

which apparently allows core dumps even if ulimit -c is 0, due to the pipe.

Temporarily changing the kernel's core pattern to just plain "core" and setting ulimit -c to 0 does suppress it. These are reset to original values after the test is run.

---

228 renamed from 228.orig +8 -0
@@ -31,6 +31,8 @@
 {
 	cd /
 	rm -f $tmp.*
+	sysctl -w kernel.core_pattern="$core_pattern" &>/dev/null
+	ulimit -c $ulimit_c
 }
 
 here=`pwd`
@@ -58,6 +60,12 @@
 avail=`df -P $TEST_DIR | awk 'END {print $4}'`
 [ "$avail" -ge 104000 ] || _notrun "Test device is too small ($avail KiB)"
 
+# Suppress core dumped messages
+core_pattern=`sysctl kernel.core_pattern | awk -F = '{print $NF}'`
+ulimit_c=`ulimit -c`
+sysctl -w kernel.core_pattern=core &>/dev/null
+ulimit -c 0
+
 # Set the FSIZE ulimit to 100MB and check
 ulimit -f 102400
 flim=`ulimit -f`

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 9 lines · Eric Sandeen

When running 228 with abrt on in rhel6, I was getting different output due to a (core dumped) message on SIGXFSZ. For some reason I wasn't able to use sed to filter it, and just ulimit -c 0 didn't suppress it either.

abrt sets the core pattern to:

"|/usr/libexec/abrt-hook-ccpp /var/spool/abrt %p %s %u %c""

Quoted 8 lines

which apparently allows core dumps even if ulimit -c is 0, due to the pipe.

Temporarily changing the kernel's core pattern to just plain "core" and setting ulimit -c to 0 does suppress it. These are reset to original values after the test is run.

hm ping on this one?

Quoted 27 lines

---

228 renamed from 228.orig +8 -0
@@ -31,6 +31,8 @@
 {
 	cd /
 	rm -f $tmp.*
+	sysctl -w kernel.core_pattern="$core_pattern" &>/dev/null
+	ulimit -c $ulimit_c
 }
 
 here=`pwd`
@@ -58,6 +60,12 @@
 avail=`df -P $TEST_DIR | awk 'END {print $4}'`
 [ "$avail" -ge 104000 ] || _notrun "Test device is too small ($avail KiB)"
 
+# Suppress core dumped messages
+core_pattern=`sysctl kernel.core_pattern | awk -F = '{print $NF}'`
+ulimit_c=`ulimit -c`
+sysctl -w kernel.core_pattern=core &>/dev/null
+ulimit -c 0
+
 # Set the FSIZE ulimit to 100MB and check
 ulimit -f 102400
 flim=`ulimit -f`
Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs