Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bindings/pyroot/pythonizations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ list(APPEND PYROOT_EXTRA_HEADERS

set(py2_py3_sources
ROOT/_application.py
ROOT/_asan.py
ROOT/_facade.py
ROOT/__init__.py
ROOT/_numbadeclare.py
Expand Down
3 changes: 3 additions & 0 deletions bindings/pyroot/pythonizations/python/ROOT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
# Prevent cppyy from filtering ROOT libraries
environ['CPPYY_NO_ROOT_FILTER'] = '1'

# Do setup specific to AddressSanitizer environments
from . import _asan

import cppyy
if not 'ROOTSYS' in environ:
# Revert setting made by cppyy
Expand Down
23 changes: 23 additions & 0 deletions bindings/pyroot/pythonizations/python/ROOT/_asan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Author: Jonas Hahnfeld CERN 10/2022

################################################################################
# Copyright (C) 1995-2022, Rene Brun and Fons Rademakers. #
# All rights reserved. #
# #
# For the licensing terms see $ROOTSYS/LICENSE. #
# For the list of contributors see $ROOTSYS/README/CREDITS. #
################################################################################

import os

# Filter out ASan related libraries that need to be preloaded into the
# Python process, but must not be propagated into instrumented executables
# such as root or rootcling.
if 'LD_PRELOAD' in os.environ:
new_preload = []
for lib in os.environ['LD_PRELOAD'].split(':'):
if 'libROOTSanitizerConfig' in lib or 'libclang_rt.asan-' in lib:
continue
new_preload.append(lib)
os.environ['LD_PRELOAD'] = ':'.join(new_preload)

3 changes: 3 additions & 0 deletions bindings/pyroot/pythonizations/test/import_load_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class ImportLoadLibs(unittest.TestCase):
'libnss_.*',
'ld.*',
'libffi',
# AddressSanitizer runtime and ROOT configuration
'libclang_rt.asan-.*',
'libROOTSanitizerConfig',
]

# Verbose mode of the test
Expand Down