diff --git a/compiler-rt/lib/ubsan/ubsan_diag.cpp b/compiler-rt/lib/ubsan/ubsan_diag.cpp index 51bb3dca0a0fe5f07f03df3f9b580217c486e17f..15661fc3f894f6caa726b88ab85e3b9b984404e7 100644 --- a/compiler-rt/lib/ubsan/ubsan_diag.cpp +++ b/compiler-rt/lib/ubsan/ubsan_diag.cpp @@ -402,6 +402,11 @@ ScopedReport::~ScopedReport() { if (flags()->halt_on_error) Die(); + + // OHOS_LOCAL + // a mark for DFX to identify ubsan log and synchronize the log file to faultlog folder + if (!Opts.FromUnrecoverableHandler) + Report("End Ubsan report\n"); } ALIGNED(64) static char suppression_placeholder[sizeof(SuppressionContext)]; diff --git a/compiler-rt/lib/ubsan/ubsan_handlers.cpp b/compiler-rt/lib/ubsan/ubsan_handlers.cpp index faafa92423bdb43e1e7f4099b6f27f4686d0f4a7..e201e6bba22078e3d873aeb5792b98ecd860cdaa 100644 --- a/compiler-rt/lib/ubsan/ubsan_handlers.cpp +++ b/compiler-rt/lib/ubsan/ubsan_handlers.cpp @@ -902,7 +902,6 @@ void __ubsan::__ubsan_handle_cfi_check_fail(CFICheckFailData *Data, handleCFIBadIcall(Data, Value, Opts); else __ubsan_handle_cfi_bad_type(Data, Value, ValidVtable, Opts); - Report("End CFI report\n"); // OHOS_LOCAL } void __ubsan::__ubsan_handle_cfi_check_fail_abort(CFICheckFailData *Data, diff --git a/compiler-rt/lib/ubsan/ubsan_init.cpp b/compiler-rt/lib/ubsan/ubsan_init.cpp index 54ff2b450519ff65310719fb1bb3f83e49f90848..ba7ff79f73081cd9cc1b6150a29d10d1931d14fc 100644 --- a/compiler-rt/lib/ubsan/ubsan_init.cpp +++ b/compiler-rt/lib/ubsan/ubsan_init.cpp @@ -37,7 +37,10 @@ static void CommonInit() { static void UbsanDie() { if (common_flags()->print_module_map >= 1) DumpProcessMap(); - Report("End CFI report (UbsanDie)\n"); // OHOS_LOCAL + + // OHOS_LOCAL + // a mark for DFX to identify ubsan log and synchronize the log file to faultlog folder + Report("End Ubsan report (UbsanDie)\n"); } static void CommonStandaloneInit() {