[cfe-commits] r148842 - in /cfe/trunk: docs/LanguageExtensions.html include/clang/Basic/Attr.td include/clang/Sema/AttributeList.h lib/CodeGen/CodeGenModule.cpp lib/Sema/AttributeList.cpp lib/Sema/SemaDeclAttr.cpp test/CodeGen/address-safety-attr

Alexander Potapenko glider at google.com
Fri Jan 27 07:58:08 PST 2012


it seems to me that this patch broke the support for ObjC.

$ gobjdump -D bin_darwin/asan_test32

0013b460 <+[LoadSomething load]>:
  13b460:       55                      push   %ebp
  13b461:       89 e5                   mov    %esp,%ebp
  13b463:       53                      push   %ebx
  13b464:       57                      push   %edi
  13b465:       56                      push   %esi
  13b466:       83 ec 0c                sub    $0xc,%esp
  13b469:       e8 00 00 00 00          call   13b46e <+[LoadSomething
  13b46e:       5b                      pop    %ebx
  13b46f:       8d b3 72 75 1b 00       lea    0x1b7572(%ebx),%esi
  13b475:       89 34 24                mov    %esi,(%esp)
  13b478:       e8 4f 77 17 00          call   2b2bcc <_strlen$stub>
  13b47d:       85 c0                   test   %eax,%eax
  13b47f:       74 22                   je     13b4a3 <+[LoadSomething
  13b481:       31 ff                   xor    %edi,%edi
  13b483:       8d 9b 72 75 1b 00       lea    0x1b7572(%ebx),%ebx
  13b489:       0f 1f 80 00 00 00 00    nopl   0x0(%eax)
  13b490:       8a 06                   mov    (%esi),%al
  13b492:       88 45 f3                mov    %al,-0xd(%ebp)
  13b495:       89 1c 24                mov    %ebx,(%esp)
  13b498:       46                      inc    %esi
  13b499:       47                      inc    %edi
  13b49a:       e8 2d 77 17 00          call   2b2bcc <_strlen$stub>
  13b49f:       39 c7                   cmp    %eax,%edi
  13b4a1:       72 ed                   jb     13b490 <+[LoadSomething
  13b4a3:       83 c4 0c                add    $0xc,%esp
  13b4a6:       5e                      pop    %esi
  13b4a7:       5f                      pop    %edi
  13b4a8:       5b                      pop    %ebx
  13b4a9:       5d                      pop    %ebp
  13b4aa:       c3                      ret
  13b4ab:       0f 1f 44 00 00          nopl   0x0(%eax,%eax,1)

-- as you can see, __asan_init is not called at the beginning of the function.
This leads to crashes in Chromium, because some instrumented code ends
up being called from such load methods before __asan_init.
I'm going to take a look, but it'll be great if you know how to fix
this off the top of your head.

More information about the cfe-commits mailing list