http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55289



--- Comment #11 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-11-13 
20:13:18 UTC ---

For the simple test case...



int main()

{

int i;

i=5;

}



compiled with 'g++-fsf-4.8 -faddress-sanitizer -O0 -framework CoreFoundation

test.cc -lasan'

using a mach_override.c with...



#define DEBUG_DISASM 1

// #undef DEBUG_DISASM



the errors appear late in the debug output at...



Replacing function at 0x11183d630

First 16 bytes of the function: 48 8d 5 11 4f b 0 53 48 8d 5f e0 48 89 77 90 

To disassemble, save the following function as disas.c and run:

  gcc -c disas.c && gobjdump -d disas.o

The first 16 bytes of the original function will start after four nop

instructions.



void foo() {

  asm volatile("nop;nop;nop;nop;");

  asm volatile(".byte 0x48, 0x8d, 0x5, 0x11, 0x4f, 0xb, 0x0, 0x53;");

  asm volatile(".byte 0x48, 0x8d, 0x5f, 0xe0, 0x48, 0x89, 0x77, 0x90;");

}



Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48 8d  FAIL

Matching: 48 8d  FAIL

Matching: 48 8d  FAIL

Matching: 48 8d  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48 8d  FAIL

Matching: 48 8d  FAIL

Matching: 48  FAIL

Matching: 48 8d  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48  FAIL

Matching: 48 8d  FAIL

mach_override: some instructions unknown! Need to update mach_override.c

overridePossible = false @299

err = f8000001

../../../../gcc-4.8-20121113/libsanitizer/interception/mach_override/mach_override.c:308

err = f8000001

../../../../gcc-4.8-20121113/libsanitizer/interception/mach_override/mach_override.c:321

err = f8000001

../../../../gcc-4.8-20121113/libsanitizer/interception/mach_override/mach_override.c:327

err = f8000001

../../../../gcc-4.8-20121113/libsanitizer/interception/mach_override/mach_override.c:340

err = f8000001

../../../../gcc-4.8-20121113/libsanitizer/interception/mach_override/mach_override.c:345

First 16 bytes of the function after slicing: 48 8d 5 11 4f b 0 53 48 8d 5f e0

48 89 77 90 

Replacing function at 0x7fff94c23364

Reply via email to