[PATCH] D15363: [UBSan] Implement runtime suppressions (PR25066).

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 15 15:32:27 PST 2016


hans added a subscriber: hans.
hans added a comment.

I tried to printf debug with this patch:

  Index: lib/sanitizer_common/sanitizer_suppressions.cc
  ===================================================================
  --- lib/sanitizer_common/sanitizer_suppressions.cc      (revision 257931)
  +++ lib/sanitizer_common/sanitizer_suppressions.cc      (working copy)
  @@ -82,6 +82,7 @@
       return false;
     for (uptr i = 0; i < suppressions_.size(); i++) {
       Suppression &cur = suppressions_[i];
  +    Printf("matching cur.templ='%s' against str='%s'\n", cur.templ, str);
       if (0 == internal_strcmp(cur.type, type) && TemplateMatch(cur.templ, str))
  {
         *s = &cur;
         return true;
  @@ -134,6 +135,8 @@
         s.templ[end2 - line] = 0;
         suppressions_.push_back(s);
         has_suppression_type_[type] = true;
  +      Printf("suppression type: %s\n", suppression_types_[type]);
  +      Printf("template: %s\n", s.templ);
       }
       if (end[0] == 0)
         break;
  Index: lib/sanitizer_common/sanitizer_flag_parser.cc
  ===================================================================
  --- lib/sanitizer_common/sanitizer_flag_parser.cc       (revision 257931)
  +++ lib/sanitizer_common/sanitizer_flag_parser.cc       (working copy)
  @@ -97,6 +97,8 @@
       value = ll_strndup(buf_ + value_start, pos_ - value_start);
     }
  
  +  Printf("parsed flag: '%s' = '%s'\n", name, value);
  +
     bool res = run_handler(name, value);
     if (!res) fatal_error("Flag parsing failed.");
   }

Maybe it's failing to symbolize the do_overflow function name? It looks like it's never trying to match it against the suppressions, instead it's trying to match the null string twice for some reason:

  Command 7 Stderr:
  parsed flag: 'halt_on_error' = '1'
  parsed flag: 'suppressions' = 'D:\src\chromium\src\third_party\llvm-bootstrap\pr
  ojects\compiler-rt\test\ubsan\Standalone-x86_64\TestCases\Integer\Output\suppres
  sions.cpp.tmp.func-supp'
  suppression type: unsigned-integer-overflow
  template: do_overflow
  matching cur.templ='do_overflow' against str='D:\src\chromium\src\third_party\ll
  vm\projects\compiler-rt\test\ubsan\TestCases\Integer\suppressions.cpp'
  matching cur.templ='do_overflow' against str='D:\src\chromium\src\third_party\ll
  vm-bootstrap\projects\compiler-rt\test\ubsan\Standalone-x86_64\TestCases\Integer
  \Output\suppressions.cpp.tmp'
  matching cur.templ='do_overflow' against str='<null>'
  matching cur.templ='do_overflow' against str='<null>'
  D:\src\chromium\src\third_party\llvm\projects\compiler-rt\test\ubsan\TestCases\I
  nteger\suppressions.cpp:25:44: runtime error: unsigned integer overflow: 1000000
  0000000000000 + 9000000000000000000 cannot be represented in type 'unsigned long
   long' 


Repository:
  rL LLVM

http://reviews.llvm.org/D15363





More information about the cfe-commits mailing list