OpenROAD icon indicating copy to clipboard operation
OpenROAD copied to clipboard

Make `bazelisk test --config=asan ...` work

Open oharboe opened this issue 2 months ago • 4 comments

Description

Currently it doesn't get to anything interesting, so the pipe has to be cleared all the way to actually running openroad.

ERROR: /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/src/sta/BUILD:16:7: Generating src/sta/liberty/LibExprLex.cc from src/sta/liberty/LibExprLex.ll failed: (Exit 1): flex failed: error executing Flex command (from target //src/sta:LibExprLex) bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/rules_flex++default_toolchain_ext+flex_v2.6.4/bin/flex -o bazel-out/k8-fastbuild/bin/src/sta/liberty/LibExprLex.cc -P LibExprLex_ ... (remaining 1 argument skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging

=================================================================
==3208386==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 512 byte(s) in 1 object(s) allocated from:
    #0 0x5e33c7b29ca4  (/home/oyvind/.cache/bazel/_bazel_oyvind/896cc02f64446168f604c13ad7b60f8b/execroot/_main/bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/rules_flex++default_toolchain_ext+flex_v2.6.4/bin/flex+0x1b1ca4) (BuildId: df080502b5acc46109cc288b6cd3b9f3)
    #1 0x5e33c7b890a1  (/home/oyvind/.cache/bazel/_bazel_oyvind/896cc02f64446168f604c13ad7b60f8b/execroot/_main/bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/rules_flex++default_toolchain_ext+flex_v2.6.4/bin/flex+0x2110a1) (BuildId: df080502b5acc46109cc288b6cd3b9f3)
    #2 0x5e33c7b88c46  (/home/oyvind/.cache/bazel/_bazel_oyvind/896cc02f64446168f604c13ad7b60f8b/execroot/_main/bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/rules_flex++default_toolchain_ext+flex_v2.6.4/bin/flex+0x210c46) (BuildId: df080502b5acc46109cc288b6cd3b9f3)
    #3 0x5e33c7b6cbe9  (/home/oyvind/.cache/bazel/_bazel_oyvind/896cc02f64446168f604c13ad7b60f8b/execroot/_main/bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/rules_flex++default_toolchain_ext+flex_v2.6.4/bin/flex+0x1f4be9) (BuildId: df080502b5acc46109cc288b6cd3b9f3)
    #4 0x5e33c7b98757  (/home/oyvind/.cache/bazel/_bazel_oyvind/896cc02f64446168f604c13ad7b60f8b/execroot/_main/bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/rules_flex++default_toolchain_ext+flex_v2.6.4/bin/flex+0x220757) (BuildId: df080502b5acc46109cc288b6cd3b9f3)
    #5 0x5e33c7b6aceb  (/home/oyvind/.cache/bazel/_bazel_oyvind/896cc02f64446168f604c13ad7b60f8b/execroot/_main/bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/rules_flex++default_toolchain_ext+flex_v2.6.4/bin/flex+0x1f2ceb) (BuildId: df080502b5acc46109cc288b6cd3b9f3)
    #6 0x5e33c7b69b63  (/home/oyvind/.cache/bazel/_bazel_oyvind/896cc02f64446168f604c13ad7b60f8b/execroot/_main/bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/rules_flex++default_toolchain_ext+flex_v2.6.4/bin/flex+0x1f1b63) (BuildId: df080502b5acc46109cc288b6cd3b9f3)
    #7 0x75e91c22a577  (/lib/x86_64-linux-gnu/libc.so.6+0x2a577) (BuildId: ae7440bbdce614e0e79280c3b2e45b1df44e639c)
    #8 0x75e91c22a63a  (/lib/x86_64-linux-gnu/libc.so.6+0x2a63a) (BuildId: ae7440bbdce614e0e79280c3b2e45b1df44e639c)
    #9 0x5e33c7a88cf4  (/home/oyvind/.cache/bazel/_bazel_oyvind/896cc02f64446168f604c13ad7b60f8b/execroot/_main/bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/rules_flex++default_toolchain_ext+flex_v2.6.4/bin/flex+0x110cf4) (BuildId: df080502b5acc46109cc288b6cd3b9f3)

SUMMARY: AddressSanitizer: 512 byte(s) leaked in 1 allocation(s).

Suggested Solution

No response

Additional Context

No response

oharboe avatar Oct 16 '25 17:10 oharboe

on what test case?

maliberty avatar Oct 18 '25 05:10 maliberty

This seems to be uselessly telling me that flex itself has a leak as bazelisk build --config=asan //:openroad fails similarly. @QuantamHD @hzeller is there a way to not run asan on the MODULE/WORKSPACE binaries?

maliberty avatar Oct 18 '25 06:10 maliberty

There is a concept of 'compiling a binary as a tool which is used during the build process'. That is typically just regular opt-compiled whlie the rest is compiled with the other flags (such as asan).

So I suspect the flex binary is not marked as tool. How that works, I don't know, but @QuantamHD probably does.

hzeller avatar Oct 18 '25 08:10 hzeller

I'll take this one

calewis avatar Nov 19 '25 19:11 calewis