Skip to content

Commit

Permalink
[ASAN] Enable detect_odr_violation=2
Browse files Browse the repository at this point in the history
The ASAN flag for detecting ODR violations has been set to its **++default++** value (2).
commit_hash:7475c1eb748fa0704d3db551189591c87ce5357d
  • Loading branch information
Nechda committed Feb 2, 2025
1 parent 26237f7 commit 6ecdd17
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build/scripts/fix_py2_protobuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ def gen_renames_1(d):

def gen_renames_2(p, d):
for s in gen_renames_1(d):
"""
Since clang-17, the option -fsanitize-address-globals-dead-stripping
has been enabled by default. Due to this, we have broken optimization
that merges calls to the `asan.module_ctor` function, as we are renaming
symbols with a prefix of 'py2_'. When this flag is enabled, and
the functions are not merged, false-positive ODR (One Definition Rule)
violations occur on objects such as `typeinfo std::exception`, because
the runtime is trying to handle global objects that have already been handled.
"""
if 'asan_globals' in s:
continue
yield s + ' ' + p + s


Expand Down

0 comments on commit 6ecdd17

Please sign in to comment.