diff --git a/cmake/add_atsplugin.cmake b/cmake/add_atsplugin.cmake index e097c4e3b7a..f7e956934e5 100644 --- a/cmake/add_atsplugin.cmake +++ b/cmake/add_atsplugin.cmake @@ -47,6 +47,11 @@ function(verify_global_plugin target) add_test(NAME verify_global_${target} COMMAND $ -C "verify_global_plugin $" ) + # Process the optional suppression file parameter. + set(suppression_file ${ARGV1}) + if(suppression_file) + set_tests_properties(verify_global_${target} PROPERTIES ENVIRONMENT "LSAN_OPTIONS=suppressions=${suppression_file}") + endif() endfunction() if(APPLE) diff --git a/plugins/experimental/magick/CMakeLists.txt b/plugins/experimental/magick/CMakeLists.txt index 97d07452c50..1fd0dc3dcb3 100644 --- a/plugins/experimental/magick/CMakeLists.txt +++ b/plugins/experimental/magick/CMakeLists.txt @@ -19,4 +19,4 @@ add_atsplugin(magick magick.cc) target_link_libraries(magick PRIVATE ImageMagick::MagickWand ImageMagick::MagickCore ts::tscppapi OpenSSL::Crypto) -verify_global_plugin(magick) +verify_global_plugin(magick ${CMAKE_CURRENT_SOURCE_DIR}/image_magic_dlopen_leak_suppression.txt) diff --git a/plugins/experimental/magick/image_magic_dlopen_leak_suppression.txt b/plugins/experimental/magick/image_magic_dlopen_leak_suppression.txt new file mode 100644 index 00000000000..a187337c190 --- /dev/null +++ b/plugins/experimental/magick/image_magic_dlopen_leak_suppression.txt @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# dlopen of plugins that link with ImageMagick results in ASan reporting a leak +# for the verify_global tests for those plugins. It has been verified that the +# plugin itself is not leaking because all other code for the plugin had been +# commented out so there was nothing to leak in the plugin. +leak:plugin_dso_load diff --git a/plugins/webp_transform/CMakeLists.txt b/plugins/webp_transform/CMakeLists.txt index 86eb796b266..c2e31d051b2 100644 --- a/plugins/webp_transform/CMakeLists.txt +++ b/plugins/webp_transform/CMakeLists.txt @@ -18,4 +18,4 @@ add_atsplugin(webp_transform ImageTransform.cc) target_link_libraries(webp_transform PRIVATE ImageMagick::Magick++ tscppapi) -verify_global_plugin(webp_transform) +verify_global_plugin(webp_transform ${CMAKE_CURRENT_SOURCE_DIR}/image_magic_dlopen_leak_suppression.txt) diff --git a/plugins/webp_transform/image_magic_dlopen_leak_suppression.txt b/plugins/webp_transform/image_magic_dlopen_leak_suppression.txt new file mode 100644 index 00000000000..a187337c190 --- /dev/null +++ b/plugins/webp_transform/image_magic_dlopen_leak_suppression.txt @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# dlopen of plugins that link with ImageMagick results in ASan reporting a leak +# for the verify_global tests for those plugins. It has been verified that the +# plugin itself is not leaking because all other code for the plugin had been +# commented out so there was nothing to leak in the plugin. +leak:plugin_dso_load