Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic link with clang causes boost::runtime::arg_type_mismatch #430

Closed
kantan2015 opened this issue Sep 24, 2024 · 0 comments · Fixed by #431
Closed

dynamic link with clang causes boost::runtime::arg_type_mismatch #430

kantan2015 opened this issue Sep 24, 2024 · 0 comments · Fixed by #431

Comments

@kantan2015
Copy link
Contributor

kantan2015 commented Sep 24, 2024

When the library(v1.85.0) dynamically linked with clang, the boost::runtime::arg_type_mismatch exception can be thrown on getting the configuration parameters.

#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/test/unit_test_parameters.hpp>

bool init_unit_test() {
  using namespace boost::unit_test;

  runtime_config::get<log_level>(runtime_config::btrt_log_level);        // OK
  runtime_config::get<output_format>(runtime_config::btrt_log_format);   // NG
  runtime_config::get<report_level>(runtime_config::btrt_report_level);  // NG
  return true;
}

int main(int argc, char* argv[], char*[]) {
  return boost::unit_test::unit_test_main(&init_unit_test, argc, argv);
}

The program was compiled with -std=c++20 and showed the error on run time.

Test setup error: boost::runtime::arg_type_mismatch: Access with invalid type for argument corresponding to parameter log_format

With gcc(13.2), there is no problem.

clang++ --version
clang version 17.0.6 (Red Hat 17.0.6-1.module_el8.10.0+3757+fc27b834)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

This seems similar to the issue #199 and confirmed fine with the library built with visibility=global.

mborland added a commit that referenced this issue Oct 4, 2024
Fix for the issue #430, arg_type_mismatch exception with dynamic link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant