From 3835acca9101bd7afa181d8df8eba5a496d480e6 Mon Sep 17 00:00:00 2001 From: Agi Csaki Date: Fri, 21 Aug 2015 12:56:30 -0700 Subject: Correct for signal, native bridge test hard-coded signal handling values Added inline assembly to ensure that the instruction causing a segfault in x86/x86_64 for the 004-SignalTest and 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: I474a04782a446439956c22360c71cea2655f8a1b --- test/115-native-bridge/nativebridge.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/115-native-bridge/nativebridge.cc') diff --git a/test/115-native-bridge/nativebridge.cc b/test/115-native-bridge/nativebridge.cc index 04326b3028..702e779bb1 100644 --- a/test/115-native-bridge/nativebridge.cc +++ b/test/115-native-bridge/nativebridge.cc @@ -206,8 +206,9 @@ static jint trampoline_Java_Main_testSignal(JNIEnv*, jclass) { #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"); + // Cause a SEGV using an instruction known to be 3 bytes long to account for hardcoded jump + // in the signal handler + asm volatile("movl $0, %%eax;" "movb $1, (%%al);" : : : "%eax"); #else // On other architectures we simulate SEGV. kill(getpid(), SIGSEGV); -- cgit v1.2.3-59-g8ed1b