1 //===-- hwasan.cpp --------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file is a part of HWAddressSanitizer. 10 // 11 // HWAddressSanitizer runtime. 12 //===----------------------------------------------------------------------===// 13 14 #include "hwasan.h" 15 #include "hwasan_checks.h" 16 #include "hwasan_dynamic_shadow.h" 17 #include "hwasan_poisoning.h" 18 #include "hwasan_report.h" 19 #include "hwasan_thread.h" 20 #include "hwasan_thread_list.h" 21 #include "sanitizer_common/sanitizer_atomic.h" 22 #include "sanitizer_common/sanitizer_common.h" 23 #include "sanitizer_common/sanitizer_flag_parser.h" 24 #include "sanitizer_common/sanitizer_flags.h" 25 #include "sanitizer_common/sanitizer_libc.h" 26 #include "sanitizer_common/sanitizer_procmaps.h" 27 #include "sanitizer_common/sanitizer_stackdepot.h" 28 #include "sanitizer_common/sanitizer_stacktrace.h" 29 #include "sanitizer_common/sanitizer_symbolizer.h" 30 #include "ubsan/ubsan_flags.h" 31 #include "ubsan/ubsan_init.h" 32 33 // ACHTUNG! No system header includes in this file. 34 35 using namespace __sanitizer; 36 37 namespace __hwasan { 38 39 void EnterSymbolizer() { 40 Thread *t = GetCurrentThread(); 41 CHECK(t); 42 t->EnterSymbolizer(); 43 } 44 void ExitSymbolizer() { 45 Thread *t = GetCurrentThread(); 46 CHECK(t); 47 t->LeaveSymbolizer(); 48 } 49 bool IsInSymbolizer() { 50 Thread *t = GetCurrentThread(); 51 return t && t->InSymbolizer(); 52 } 53 54 static Flags hwasan_flags; 55 56 Flags *flags() { 57 return &hwasan_flags; 58 } 59 60 int hwasan_inited = 0; 61 int hwasan_instrumentation_inited = 0; 62 bool hwasan_init_is_running; 63 64 int hwasan_report_count = 0; 65 66 void Flags::SetDefaults() { 67 #define HWASAN_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; 68 #include "hwasan_flags.inc" 69 #undef HWASAN_FLAG 70 } 71 72 static void RegisterHwasanFlags(FlagParser *parser, Flags *f) { 73 #define HWASAN_FLAG(Type, Name, DefaultValue, Description) \ 74 RegisterFlag(parser, #Name, Description, &f->Name); 75 #include "hwasan_flags.inc" 76 #undef HWASAN_FLAG 77 } 78 79 static void InitializeFlags() { 80 SetCommonFlagsDefaults(); 81 { 82 CommonFlags cf; 83 cf.CopyFrom(*common_flags()); 84 cf.external_symbolizer_path = GetEnv("HWASAN_SYMBOLIZER_PATH"); 85 cf.malloc_context_size = 20; 86 cf.handle_ioctl = true; 87 // FIXME: test and enable. 88 cf.check_printf = false; 89 cf.intercept_tls_get_addr = true; 90 cf.exitcode = 99; 91 // 8 shadow pages ~512kB, small enough to cover common stack sizes. 92 cf.clear_shadow_mmap_threshold = 4096 * (SANITIZER_ANDROID ? 2 : 8); 93 // Sigtrap is used in error reporting. 94 cf.handle_sigtrap = kHandleSignalExclusive; 95 96 #if SANITIZER_ANDROID 97 // Let platform handle other signals. It is better at reporting them then we 98 // are. 99 cf.handle_segv = kHandleSignalNo; 100 cf.handle_sigbus = kHandleSignalNo; 101 cf.handle_abort = kHandleSignalNo; 102 cf.handle_sigill = kHandleSignalNo; 103 cf.handle_sigfpe = kHandleSignalNo; 104 #endif 105 OverrideCommonFlags(cf); 106 } 107 108 Flags *f = flags(); 109 f->SetDefaults(); 110 111 FlagParser parser; 112 RegisterHwasanFlags(&parser, f); 113 RegisterCommonFlags(&parser); 114 115 #if HWASAN_CONTAINS_UBSAN 116 __ubsan::Flags *uf = __ubsan::flags(); 117 uf->SetDefaults(); 118 119 FlagParser ubsan_parser; 120 __ubsan::RegisterUbsanFlags(&ubsan_parser, uf); 121 RegisterCommonFlags(&ubsan_parser); 122 #endif 123 124 // Override from user-specified string. 125 if (__hwasan_default_options) 126 parser.ParseString(__hwasan_default_options()); 127 #if HWASAN_CONTAINS_UBSAN 128 const char *ubsan_default_options = __ubsan::MaybeCallUbsanDefaultOptions(); 129 ubsan_parser.ParseString(ubsan_default_options); 130 #endif 131 132 parser.ParseStringFromEnv("HWASAN_OPTIONS"); 133 #if HWASAN_CONTAINS_UBSAN 134 ubsan_parser.ParseStringFromEnv("UBSAN_OPTIONS"); 135 #endif 136 137 InitializeCommonFlags(); 138 139 if (Verbosity()) ReportUnrecognizedFlags(); 140 141 if (common_flags()->help) parser.PrintFlagDescriptions(); 142 } 143 144 static void HWAsanCheckFailed(const char *file, int line, const char *cond, 145 u64 v1, u64 v2) { 146 Report("HWAddressSanitizer CHECK failed: %s:%d \"%s\" (0x%zx, 0x%zx)\n", file, 147 line, cond, (uptr)v1, (uptr)v2); 148 PRINT_CURRENT_STACK_CHECK(); 149 Die(); 150 } 151 152 static constexpr uptr kMemoryUsageBufferSize = 4096; 153 154 static void HwasanFormatMemoryUsage(InternalScopedString &s) { 155 HwasanThreadList &thread_list = hwasanThreadList(); 156 auto thread_stats = thread_list.GetThreadStats(); 157 auto *sds = StackDepotGetStats(); 158 AllocatorStatCounters asc; 159 GetAllocatorStats(asc); 160 s.append( 161 "HWASAN pid: %d rss: %zd threads: %zd stacks: %zd" 162 " thr_aux: %zd stack_depot: %zd uniq_stacks: %zd" 163 " heap: %zd", 164 internal_getpid(), GetRSS(), thread_stats.n_live_threads, 165 thread_stats.total_stack_size, 166 thread_stats.n_live_threads * thread_list.MemoryUsedPerThread(), 167 sds->allocated, sds->n_uniq_ids, asc[AllocatorStatMapped]); 168 } 169 170 #if SANITIZER_ANDROID 171 static char *memory_usage_buffer = nullptr; 172 173 static void InitMemoryUsage() { 174 memory_usage_buffer = 175 (char *)MmapOrDie(kMemoryUsageBufferSize, "memory usage string"); 176 CHECK(memory_usage_buffer); 177 memory_usage_buffer[0] = '\0'; 178 DecorateMapping((uptr)memory_usage_buffer, kMemoryUsageBufferSize, 179 memory_usage_buffer); 180 } 181 182 void UpdateMemoryUsage() { 183 if (!flags()->export_memory_stats) 184 return; 185 if (!memory_usage_buffer) 186 InitMemoryUsage(); 187 InternalScopedString s(kMemoryUsageBufferSize); 188 HwasanFormatMemoryUsage(s); 189 internal_strncpy(memory_usage_buffer, s.data(), kMemoryUsageBufferSize - 1); 190 memory_usage_buffer[kMemoryUsageBufferSize - 1] = '\0'; 191 } 192 #else 193 void UpdateMemoryUsage() {} 194 #endif 195 196 } // namespace __hwasan 197 198 using namespace __hwasan; 199 200 void __sanitizer::BufferedStackTrace::UnwindImpl( 201 uptr pc, uptr bp, void *context, bool request_fast, u32 max_depth) { 202 Thread *t = GetCurrentThread(); 203 if (!t) { 204 // the thread is still being created. 205 size = 0; 206 return; 207 } 208 if (!StackTrace::WillUseFastUnwind(request_fast)) { 209 // Block reports from our interceptors during _Unwind_Backtrace. 210 SymbolizerScope sym_scope; 211 return Unwind(max_depth, pc, bp, context, 0, 0, request_fast); 212 } 213 if (StackTrace::WillUseFastUnwind(request_fast)) 214 Unwind(max_depth, pc, bp, nullptr, t->stack_top(), t->stack_bottom(), true); 215 else 216 Unwind(max_depth, pc, 0, context, 0, 0, false); 217 } 218 219 struct hwasan_global { 220 s32 gv_relptr; 221 u32 info; 222 }; 223 224 static void InitGlobals(const hwasan_global *begin, const hwasan_global *end) { 225 for (auto *desc = begin; desc != end; ++desc) { 226 uptr gv = reinterpret_cast<uptr>(desc) + desc->gv_relptr; 227 uptr size = desc->info & 0xffffff; 228 uptr full_granule_size = RoundDownTo(size, 16); 229 u8 tag = desc->info >> 24; 230 TagMemoryAligned(gv, full_granule_size, tag); 231 if (size % 16) 232 TagMemoryAligned(gv + full_granule_size, 16, size % 16); 233 } 234 } 235 236 enum { NT_LLVM_HWASAN_GLOBALS = 3 }; 237 238 struct hwasan_global_note { 239 s32 begin_relptr; 240 s32 end_relptr; 241 }; 242 243 // Check that the given library meets the code model requirements for tagged 244 // globals. These properties are not checked at link time so they need to be 245 // checked at runtime. 246 static void CheckCodeModel(ElfW(Addr) base, const ElfW(Phdr) * phdr, 247 ElfW(Half) phnum) { 248 ElfW(Addr) min_addr = -1ull, max_addr = 0; 249 for (unsigned i = 0; i != phnum; ++i) { 250 if (phdr[i].p_type != PT_LOAD) 251 continue; 252 ElfW(Addr) lo = base + phdr[i].p_vaddr, hi = lo + phdr[i].p_memsz; 253 if (min_addr > lo) 254 min_addr = lo; 255 if (max_addr < hi) 256 max_addr = hi; 257 } 258 259 if (max_addr - min_addr > 1ull << 32) { 260 Report("FATAL: HWAddressSanitizer: library size exceeds 2^32\n"); 261 Die(); 262 } 263 if (max_addr > 1ull << 48) { 264 Report("FATAL: HWAddressSanitizer: library loaded above address 2^48\n"); 265 Die(); 266 } 267 } 268 269 static void InitGlobalsFromPhdrs(ElfW(Addr) base, const ElfW(Phdr) * phdr, 270 ElfW(Half) phnum) { 271 for (unsigned i = 0; i != phnum; ++i) { 272 if (phdr[i].p_type != PT_NOTE) 273 continue; 274 const char *note = reinterpret_cast<const char *>(base + phdr[i].p_vaddr); 275 const char *nend = note + phdr[i].p_memsz; 276 while (note < nend) { 277 auto *nhdr = reinterpret_cast<const ElfW(Nhdr) *>(note); 278 const char *name = note + sizeof(ElfW(Nhdr)); 279 const char *desc = name + RoundUpTo(nhdr->n_namesz, 4); 280 if (nhdr->n_type != NT_LLVM_HWASAN_GLOBALS || 281 internal_strcmp(name, "LLVM") != 0) { 282 note = desc + RoundUpTo(nhdr->n_descsz, 4); 283 continue; 284 } 285 286 // Only libraries with instrumented globals need to be checked against the 287 // code model since they use relocations that aren't checked at link time. 288 CheckCodeModel(base, phdr, phnum); 289 290 auto *global_note = reinterpret_cast<const hwasan_global_note *>(desc); 291 auto *global_begin = reinterpret_cast<const hwasan_global *>( 292 note + global_note->begin_relptr); 293 auto *global_end = reinterpret_cast<const hwasan_global *>( 294 note + global_note->end_relptr); 295 InitGlobals(global_begin, global_end); 296 return; 297 } 298 } 299 } 300 301 static void InitLoadedGlobals() { 302 dl_iterate_phdr( 303 [](dl_phdr_info *info, size_t size, void *data) { 304 InitGlobalsFromPhdrs(info->dlpi_addr, info->dlpi_phdr, 305 info->dlpi_phnum); 306 return 0; 307 }, 308 nullptr); 309 } 310 311 // Prepare to run instrumented code on the main thread. 312 static void InitInstrumentation() { 313 if (hwasan_instrumentation_inited) return; 314 315 InitPrctl(); 316 317 if (!InitShadow()) { 318 Printf("FATAL: HWAddressSanitizer cannot mmap the shadow memory.\n"); 319 DumpProcessMap(); 320 Die(); 321 } 322 323 InitThreads(); 324 hwasanThreadList().CreateCurrentThread(); 325 326 hwasan_instrumentation_inited = 1; 327 } 328 329 // Interface. 330 331 uptr __hwasan_shadow_memory_dynamic_address; // Global interface symbol. 332 333 // This function was used by the old frame descriptor mechanism. We keep it 334 // around to avoid breaking ABI. 335 void __hwasan_init_frames(uptr beg, uptr end) {} 336 337 void __hwasan_init_static() { 338 InitShadowGOT(); 339 InitInstrumentation(); 340 341 // In the non-static code path we call dl_iterate_phdr here. But at this point 342 // libc might not have been initialized enough for dl_iterate_phdr to work. 343 // Fortunately, since this is a statically linked executable we can use the 344 // linker-defined symbol __ehdr_start to find the only relevant set of phdrs. 345 extern ElfW(Ehdr) __ehdr_start; 346 InitGlobalsFromPhdrs( 347 0, 348 reinterpret_cast<const ElfW(Phdr) *>( 349 reinterpret_cast<const char *>(&__ehdr_start) + __ehdr_start.e_phoff), 350 __ehdr_start.e_phnum); 351 } 352 353 void __hwasan_init() { 354 CHECK(!hwasan_init_is_running); 355 if (hwasan_inited) return; 356 hwasan_init_is_running = 1; 357 SanitizerToolName = "HWAddressSanitizer"; 358 359 InitTlsSize(); 360 361 CacheBinaryName(); 362 InitializeFlags(); 363 364 // Install tool-specific callbacks in sanitizer_common. 365 SetCheckFailedCallback(HWAsanCheckFailed); 366 367 __sanitizer_set_report_path(common_flags()->log_path); 368 369 AndroidTestTlsSlot(); 370 371 DisableCoreDumperIfNecessary(); 372 373 InitInstrumentation(); 374 InitLoadedGlobals(); 375 376 // Needs to be called here because flags()->random_tags might not have been 377 // initialized when InitInstrumentation() was called. 378 GetCurrentThread()->InitRandomState(); 379 380 MadviseShadow(); 381 382 SetPrintfAndReportCallback(AppendToErrorMessageBuffer); 383 // This may call libc -> needs initialized shadow. 384 AndroidLogInit(); 385 386 InitializeInterceptors(); 387 InstallDeadlySignalHandlers(HwasanOnDeadlySignal); 388 InstallAtExitHandler(); // Needs __cxa_atexit interceptor. 389 390 Symbolizer::GetOrInit()->AddHooks(EnterSymbolizer, ExitSymbolizer); 391 392 InitializeCoverage(common_flags()->coverage, common_flags()->coverage_dir); 393 394 HwasanTSDInit(); 395 HwasanTSDThreadInit(); 396 397 HwasanAllocatorInit(); 398 399 #if HWASAN_CONTAINS_UBSAN 400 __ubsan::InitAsPlugin(); 401 #endif 402 403 VPrintf(1, "HWAddressSanitizer init done\n"); 404 405 hwasan_init_is_running = 0; 406 hwasan_inited = 1; 407 } 408 409 void __hwasan_library_loaded(ElfW(Addr) base, const ElfW(Phdr) * phdr, 410 ElfW(Half) phnum) { 411 InitGlobalsFromPhdrs(base, phdr, phnum); 412 } 413 414 void __hwasan_library_unloaded(ElfW(Addr) base, const ElfW(Phdr) * phdr, 415 ElfW(Half) phnum) { 416 for (; phnum != 0; ++phdr, --phnum) 417 if (phdr->p_type == PT_LOAD) 418 TagMemory(base + phdr->p_vaddr, phdr->p_memsz, 0); 419 } 420 421 void __hwasan_print_shadow(const void *p, uptr sz) { 422 uptr ptr_raw = UntagAddr(reinterpret_cast<uptr>(p)); 423 uptr shadow_first = MemToShadow(ptr_raw); 424 uptr shadow_last = MemToShadow(ptr_raw + sz - 1); 425 Printf("HWASan shadow map for %zx .. %zx (pointer tag %x)\n", ptr_raw, 426 ptr_raw + sz, GetTagFromPointer((uptr)p)); 427 for (uptr s = shadow_first; s <= shadow_last; ++s) 428 Printf(" %zx: %x\n", ShadowToMem(s), *(tag_t *)s); 429 } 430 431 sptr __hwasan_test_shadow(const void *p, uptr sz) { 432 if (sz == 0) 433 return -1; 434 tag_t ptr_tag = GetTagFromPointer((uptr)p); 435 uptr ptr_raw = UntagAddr(reinterpret_cast<uptr>(p)); 436 uptr shadow_first = MemToShadow(ptr_raw); 437 uptr shadow_last = MemToShadow(ptr_raw + sz - 1); 438 for (uptr s = shadow_first; s <= shadow_last; ++s) 439 if (*(tag_t *)s != ptr_tag) { 440 sptr offset = ShadowToMem(s) - ptr_raw; 441 return offset < 0 ? 0 : offset; 442 } 443 return -1; 444 } 445 446 u16 __sanitizer_unaligned_load16(const uu16 *p) { 447 return *p; 448 } 449 u32 __sanitizer_unaligned_load32(const uu32 *p) { 450 return *p; 451 } 452 u64 __sanitizer_unaligned_load64(const uu64 *p) { 453 return *p; 454 } 455 void __sanitizer_unaligned_store16(uu16 *p, u16 x) { 456 *p = x; 457 } 458 void __sanitizer_unaligned_store32(uu32 *p, u32 x) { 459 *p = x; 460 } 461 void __sanitizer_unaligned_store64(uu64 *p, u64 x) { 462 *p = x; 463 } 464 465 void __hwasan_loadN(uptr p, uptr sz) { 466 CheckAddressSized<ErrorAction::Abort, AccessType::Load>(p, sz); 467 } 468 void __hwasan_load1(uptr p) { 469 CheckAddress<ErrorAction::Abort, AccessType::Load, 0>(p); 470 } 471 void __hwasan_load2(uptr p) { 472 CheckAddress<ErrorAction::Abort, AccessType::Load, 1>(p); 473 } 474 void __hwasan_load4(uptr p) { 475 CheckAddress<ErrorAction::Abort, AccessType::Load, 2>(p); 476 } 477 void __hwasan_load8(uptr p) { 478 CheckAddress<ErrorAction::Abort, AccessType::Load, 3>(p); 479 } 480 void __hwasan_load16(uptr p) { 481 CheckAddress<ErrorAction::Abort, AccessType::Load, 4>(p); 482 } 483 484 void __hwasan_loadN_noabort(uptr p, uptr sz) { 485 CheckAddressSized<ErrorAction::Recover, AccessType::Load>(p, sz); 486 } 487 void __hwasan_load1_noabort(uptr p) { 488 CheckAddress<ErrorAction::Recover, AccessType::Load, 0>(p); 489 } 490 void __hwasan_load2_noabort(uptr p) { 491 CheckAddress<ErrorAction::Recover, AccessType::Load, 1>(p); 492 } 493 void __hwasan_load4_noabort(uptr p) { 494 CheckAddress<ErrorAction::Recover, AccessType::Load, 2>(p); 495 } 496 void __hwasan_load8_noabort(uptr p) { 497 CheckAddress<ErrorAction::Recover, AccessType::Load, 3>(p); 498 } 499 void __hwasan_load16_noabort(uptr p) { 500 CheckAddress<ErrorAction::Recover, AccessType::Load, 4>(p); 501 } 502 503 void __hwasan_storeN(uptr p, uptr sz) { 504 CheckAddressSized<ErrorAction::Abort, AccessType::Store>(p, sz); 505 } 506 void __hwasan_store1(uptr p) { 507 CheckAddress<ErrorAction::Abort, AccessType::Store, 0>(p); 508 } 509 void __hwasan_store2(uptr p) { 510 CheckAddress<ErrorAction::Abort, AccessType::Store, 1>(p); 511 } 512 void __hwasan_store4(uptr p) { 513 CheckAddress<ErrorAction::Abort, AccessType::Store, 2>(p); 514 } 515 void __hwasan_store8(uptr p) { 516 CheckAddress<ErrorAction::Abort, AccessType::Store, 3>(p); 517 } 518 void __hwasan_store16(uptr p) { 519 CheckAddress<ErrorAction::Abort, AccessType::Store, 4>(p); 520 } 521 522 void __hwasan_storeN_noabort(uptr p, uptr sz) { 523 CheckAddressSized<ErrorAction::Recover, AccessType::Store>(p, sz); 524 } 525 void __hwasan_store1_noabort(uptr p) { 526 CheckAddress<ErrorAction::Recover, AccessType::Store, 0>(p); 527 } 528 void __hwasan_store2_noabort(uptr p) { 529 CheckAddress<ErrorAction::Recover, AccessType::Store, 1>(p); 530 } 531 void __hwasan_store4_noabort(uptr p) { 532 CheckAddress<ErrorAction::Recover, AccessType::Store, 2>(p); 533 } 534 void __hwasan_store8_noabort(uptr p) { 535 CheckAddress<ErrorAction::Recover, AccessType::Store, 3>(p); 536 } 537 void __hwasan_store16_noabort(uptr p) { 538 CheckAddress<ErrorAction::Recover, AccessType::Store, 4>(p); 539 } 540 541 void __hwasan_tag_memory(uptr p, u8 tag, uptr sz) { 542 TagMemoryAligned(p, sz, tag); 543 } 544 545 uptr __hwasan_tag_pointer(uptr p, u8 tag) { 546 return AddTagToPointer(p, tag); 547 } 548 549 void __hwasan_handle_longjmp(const void *sp_dst) { 550 uptr dst = (uptr)sp_dst; 551 // HWASan does not support tagged SP. 552 CHECK(GetTagFromPointer(dst) == 0); 553 554 uptr sp = (uptr)__builtin_frame_address(0); 555 static const uptr kMaxExpectedCleanupSize = 64 << 20; // 64M 556 if (dst < sp || dst - sp > kMaxExpectedCleanupSize) { 557 Report( 558 "WARNING: HWASan is ignoring requested __hwasan_handle_longjmp: " 559 "stack top: %p; target %p; distance: %p (%zd)\n" 560 "False positive error reports may follow\n", 561 (void *)sp, (void *)dst, dst - sp); 562 return; 563 } 564 TagMemory(sp, dst - sp, 0); 565 } 566 567 void __hwasan_handle_vfork(const void *sp_dst) { 568 uptr sp = (uptr)sp_dst; 569 Thread *t = GetCurrentThread(); 570 CHECK(t); 571 uptr top = t->stack_top(); 572 uptr bottom = t->stack_bottom(); 573 if (top == 0 || bottom == 0 || sp < bottom || sp >= top) { 574 Report( 575 "WARNING: HWASan is ignoring requested __hwasan_handle_vfork: " 576 "stack top: %zx; current %zx; bottom: %zx \n" 577 "False positive error reports may follow\n", 578 top, sp, bottom); 579 return; 580 } 581 TagMemory(bottom, sp - bottom, 0); 582 } 583 584 extern "C" void *__hwasan_extra_spill_area() { 585 Thread *t = GetCurrentThread(); 586 return &t->vfork_spill(); 587 } 588 589 void __hwasan_print_memory_usage() { 590 InternalScopedString s(kMemoryUsageBufferSize); 591 HwasanFormatMemoryUsage(s); 592 Printf("%s\n", s.data()); 593 } 594 595 static const u8 kFallbackTag = 0xBB; 596 597 u8 __hwasan_generate_tag() { 598 Thread *t = GetCurrentThread(); 599 if (!t) return kFallbackTag; 600 return t->GenerateRandomTag(); 601 } 602 603 #if !SANITIZER_SUPPORTS_WEAK_HOOKS 604 extern "C" { 605 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE 606 const char* __hwasan_default_options() { return ""; } 607 } // extern "C" 608 #endif 609 610 extern "C" { 611 SANITIZER_INTERFACE_ATTRIBUTE 612 void __sanitizer_print_stack_trace() { 613 GET_FATAL_STACK_TRACE_PC_BP(StackTrace::GetCurrentPc(), GET_CURRENT_FRAME()); 614 stack.Print(); 615 } 616 } // extern "C" 617