Announcement

Collapse
No announcement yet.

Unable to compile with AddressSanitizer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to compile with AddressSanitizer

    I am attempting to run benchmarks with AddressSanitizer enabled in order to study the performance overhead of memory error detection.

    AddressSanitizer works fine if I compile programs with 'gcc -fsanitize=address' or 'g++ -fsanitize=address' but I can't seem to get Phoronix to use it by adding it to CFLAGS, CPPFLAGS or CXXFLAGS.

    Using ubuntu I executed the commands:
    CFLAGS=-fsanitize=address
    export CFLAGS
    CPPFLAGS=-fsanitize=address
    export CPPFLAGS
    CXXFLAGS=-fsanitize=address
    export CXXFLAGS

    and printenv seems to confirm that I set the environment variables correctly:
    comp@comp-NV55C:~$ printenv CFLAGS
    -fsanitize=address
    comp@comp-NV55C:~$ printenv CXXFLAGS
    -fsanitize=address
    comp@comp-NV55C:~$ printenv CPPFLAGS
    -fsanitize=address

    But when I run phoronix it never reports the compiler options being any different regardless of how the environment variables are set. I'm new to this sort of work and would greatly appreciate any advice on how to get this to work. Thank you.

  • #2
    After setting the env vars, did you run "phoronix-test-suite force-install <the tests you want to test>" to ensure they were rebuilt after setting the flags? What tests are you trying?
    Michael Larabel
    https://www.michaellarabel.com/

    Comment


    • #3
      Originally posted by Michael View Post
      After setting the env vars, did you run "phoronix-test-suite force-install <the tests you want to test>" to ensure they were rebuilt after setting the flags? What tests are you trying?
      That did the trick! I hadn't realized I needed to force the recompile. Thanks so much!

      Comment


      • #4
        Originally posted by Michael View Post
        After setting the env vars, did you run "phoronix-test-suite force-install <the tests you want to test>" to ensure they were rebuilt after setting the flags? What tests are you trying?
        Hi Michael - I've been able to get this to work with graphics-magick but not with ramspeed, bork, stream or c-ray. Any suggestions how to get it to work with other tests or for some other tests that might be appropriate? Thanks for your help!

        Comment


        • #5
          Originally posted by Ubuntu View Post
          Hi Michael - I've been able to get this to work with graphics-magick but not with ramspeed, bork, stream or c-ray. Any suggestions how to get it to work with other tests or for some other tests that might be appropriate? Thanks for your help!
          Some of the upstream tests might just not be compatible with the Address Sanitizer.
          Michael Larabel
          https://www.michaellarabel.com/

          Comment

          Working...
          X