openharmony 鸿蒙 hiappevent-watcher-address-sanitizer-events

2025-06-12 浏览 (1)

Address Sanitizer Event Overview

Overview

An address sanitizer error refers to an invalid memory access that causes application exceptions or crashes.

You can subscribe to address sanitizer events using the ArkTS and C/C++ APIs provided by HiAppEvent. For details, see the following documents:

NOTE

Address sanitizer events can be subscribed to using HiAppEvent in application clones. Since API version 22, this feature is also supported for input method applications. This feature is not supported for atomic services.

Detection Principles

For details, see Address Sanitizer Detection.

Event Fields

params

NameTypeDescription
timenumberEvent triggering time, in ms.
bundle_versionstringApplication version.
bundle_namestringApplication name.
pidnumberProcess ID of the application.
uidnumberUser ID of the application.
typestringType of the address sanitizer error. For details, see the description of type.
external_logstring[]Path of the error log file. If the directory files exceed the threshold (for details, see log_over_limit), new log files may fail to be written. Therefore, delete the log files immediately after they are processed.
log_over_limitbooleanWhether the size of generated fault log files and existing log files exceeds the upper limit (5 MB). The value true indicates that the upper limit is exceeded and logs fail to be written. The value false indicates that the upper limit is not exceeded.

type

ValueDescription
GWP-ASANError triggered by GWP-ASan.
UBSANError triggered by UBSan.
TSANError triggered by TSan.
FDSANError triggered by fdsan. This type is supported since API version 20.
stack tag-mismatchStack tag mismatch detected by HWASan, possibly due to stack use-after-return, out-of-scope access, or out-of-bounds access.
alloc-dealloc-mismatchThe memory allocation and release modes do not match.
allocation-size-too-bigThe heap memory is too large.
calloc-overflowcalloc() fails to allocate memory.
container-overflowThe container overflows.
double-freeThe memory is repeatedly released.
dynamic-stack-buffer-overflowThe buffer access exceeds the boundary of a stack-allocated object.
global-buffer-overflowThe global buffer overflows.
heap-buffer-overflowThe heap buffer overflows.
heap-use-after-freeThe released heap memory is used.
invalid-allocation-alignmentThe alignment mode specified in memory allocation is invalid.
memcpy-param-overlapmemcpy() does not support overlapping memory regions.
new-delete-type-mismatchThe released memory size does not match the allocated memory size.
stack-buffer-overflowThe stack buffer overflows.
stack-buffer-underflowThe stack buffer underflow occurs.
stack-use-after-returnThe stack memory is used after the function has returned.
stack-use-after-scopeThe stack memory is out of range.
strcat-param-overlapThe source and destination buffers used for string concatenation overlap.
use-after-poisonThe memory address is used after being poisoned.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 hiappevent-watcher-app-killed-events

openharmony 鸿蒙 hiappevent-intro

openharmony 鸿蒙 hicollie-guidelines-ndk

openharmony 鸿蒙 event-subscription-overview

openharmony 鸿蒙 hiappevent-watcher-mainthreadjank-events-arkts

openharmony 鸿蒙 hiappevent-watcher-resourceleak-events-ndk

openharmony 鸿蒙 hilog-guidelines-arkts

openharmony 鸿蒙 hiappevent-watcher-apphicollie-events-ndk

openharmony 鸿蒙 hitracechain-guidelines-arkts

openharmony 鸿蒙 hiappevent-watcher-freeze-events

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/IAuGH6