Correct for 115-native-bridge hard-coded x86/x86_64 signal handling values
Added inline assembly to ensure that the instruction causing a segfault
in x86/x86_64 for the 115-native-bridge test always has a size of 3 bytes,
in response to a bug that caused the test to fail when this instruction
had variable sizes.
Bug: 22876261
Change-Id: I296e623f170fd1925919bedf913c569a6563e3dc
diff --git a/test/115-native-bridge/nativebridge.cc b/test/115-native-bridge/nativebridge.cc
index a6a6e08..04326b3 100644
--- a/test/115-native-bridge/nativebridge.cc
+++ b/test/115-native-bridge/nativebridge.cc
@@ -203,9 +203,11 @@
// Test segv
sigaction(SIGSEGV, &tmp, nullptr);
-#if defined(__arm__) || defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
- // On supported architectures we cause a real SEGV.
+#if defined(__arm__) || defined(__i386__) || defined(__aarch64__)
*go_away_compiler = 'a';
+#elif defined(__x86_64__)
+ // Cause a SEGV using an instruction known to be 3 bytes long
+ asm volatile("movl $0, %%eax;" "movb $1, (%%eax);" : : : "%eax");
#else
// On other architectures we simulate SEGV.
kill(getpid(), SIGSEGV);