Skip to content

Commit

Permalink
filtering ubsan for the bitset #14576
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Mar 22, 2024
1 parent 0a85a2e commit 65a4e31
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions build_config/clang_ubsan_suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ shift-base:fontstash.h
unsigned-integer-overflow:fontstash.h
implicit-integer-sign-change:glfontstash.h
implicit-signed-integer-truncation:stb_truetype.h
shift-base:bitset
3 changes: 1 addition & 2 deletions src/netedit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ add_dependencies(generate-templates-h sumo netgenerate)

# create CMake custom command that generates templates.h file (OUTPUT) giving as argument python executable (PYTHON_EXECUTABLE),
# the python script <SUMO>/tools/build_config/templates.py (<SUMO/src/netedit>/../../tools/build_config/templates.py) and the sumo binary
# the LSAN_OPTIONS are only relevant for the clang build but should not hurt others
add_custom_command(OUTPUT templates.h
COMMAND ${CMAKE_COMMAND} -E env LSAN_OPTIONS=suppressions=${CMAKE_CURRENT_SOURCE_DIR}/../../build_config/clang_memleak_suppressions.txt ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../tools/build_config/templates.py $<TARGET_FILE:sumo> $<TARGET_FILE:netgenerate>
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../tools/build_config/templates.py $<TARGET_FILE:sumo> $<TARGET_FILE:netgenerate>
DEPENDS sumo netgenerate
)

Expand Down
6 changes: 5 additions & 1 deletion tools/build_config/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,14 @@ def generateTemplate(app, appBin):
@brief generate template for the given app
"""
print("Obtaining " + app + " template")
env = dict(os.environ)
# the *SAN_OPTIONS are only relevant for the clang build but should not hurt others
env["LSAN_OPTIONS"] = "suppressions=%s/../../build_config/clang_memleak_suppressions.txt" % dirname(__file__)
env["UBSAN_OPTIONS"] = "suppressions=%s/../../build_config/clang_ubsan_suppressions.txt" % dirname(__file__)
# obtain template piping stdout using check_output
try:
template = formatBinTemplate(subprocess.check_output(
[appBin, "--save-template", "stdout"], universal_newlines=True))
[appBin, "--save-template", "stdout"], env=env, universal_newlines=True))
except subprocess.CalledProcessError as e:
sys.stderr.write("Error when generating template for " + app + ": '%s'" % e)
template = ""
Expand Down

0 comments on commit 65a4e31

Please sign in to comment.