ramosian-glider / memory-sanitizer

Automatically exported from code.google.com/p/memory-sanitizer
0 stars 0 forks source link

rorw fails with an MSan report when the argument is uninitialized (r217949) #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
# define __bswap_16(x) \
     (__extension__                               \
      ({ register unsigned short int __v, __x = (unsigned short int) (x);    \
       __asm__ ("rorw $8, %w0"                        \
            : "=r" (__v)                          \
            : "0" (__x)                           \
            : "cc");                              \
     __v; }))

int main() {
  int a;
  int b = __bswap_16(a);  // <---- crash here
}

As far as I understand, in the absense of inline asm instrumentation this 
should just leave the result's shadow untouched? (Or do we assert that input 
parameters are unpoisoned?) Is this a regression due to recent work on inline 
asm support?

Original issue reported on code.google.com by earth...@google.com on 16 Oct 2014 at 5:04

GoogleCodeExporter commented 9 years ago
Damn, I'm slow today. This still crashes if I remove the rorw instruction, so I 
guess this is just normal behavior with inline asm blocks.

Original comment by earth...@google.com on 16 Oct 2014 at 5:08

GoogleCodeExporter commented 9 years ago
Yes, we check that all inputs to inline asm are initialized.

Original comment by euge...@google.com on 16 Oct 2014 at 5:24

GoogleCodeExporter commented 9 years ago
Adding Project:MemorySanitizer as part of GitHub migration.

Original comment by gli...@google.com on 30 Jul 2015 at 9:22