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

[BUG] Fuzzing integration build (Linux) - invalid argument '-fsanitize=address' not allowed with '-fsanitize=thread' #25959

Closed
zcduthie opened this issue Apr 4, 2023 · 6 comments · Fixed by #25967

Comments

@zcduthie
Copy link

zcduthie commented Apr 4, 2023

Reproduction steps

Following the libfuzzer command for linux listed under 'Fuzzing integration' instructions here:
./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target linux-x64-all-clusters-no-ble-asan-libfuzzer-clang build"

On a fresh linux environment (Docker container on Windows host) results in the error:

clang-15: error: invalid argument '-fsanitize=address' not allowed with '-fsanitize=thread'

Bug prevalence

Whenever I do this

GitHub hash of the SDK that was being used

d81d4e3

Platform

windows

Platform Version(s)

No response

Anything else?

I believe this is because the following line enables tsan (while the sample command manually includes -asan-):

target.AppendModifier("libfuzzer", use_tsan=True).OnlyIfRe("-clang")

Additionally, if I bypass this manually (by updating targets.py to also default to asan) it seems to only produce a standard (non-libfuzzer) binary.

ubuntu@99a0803337d7:~/connectedhomeip$ ls out/linux-x64-all-clusters-no-ble-asan-libfuzzer-clang/
args.gn        build.ninja.stamp          compile_commands.json  liblogging-stdio.a  relative_path_transformations.json
build.ninja    chip-all-clusters-app      gen                    obj                 toolchain.ninja
build.ninja.d  chip-all-clusters-app.map  lib                    python              zap_gen.lock

(I believe the output binary should be chip-all-clusters-app-fuzzing). Executing the binary results in standard all-clusters-app operation, with no libfuzzer output:

ubuntu@99a0803337d7:~/connectedhomeip$ ./out/linux-x64-all-clusters-no-ble-asan-libfuzzer-clang/chip-all-clusters-app
CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_kvs
CHIP:DL: writing settings to file (/tmp/chip_kvs-cwM2BF)
CHIP:DL: renamed tmp file to file (/tmp/chip_kvs)
CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_kvs
CHIP:DL: ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: /tmp/chip_kvs
@bzbarsky-apple
Copy link
Contributor

@andy31415

@andy31415
Copy link
Contributor

it looks to me like linux-x64-all-clusters-no-ble-asan-libfuzzer-clang is not a valid target, however linux-x64-all-clusters-no-ble-libfuzzer-clang works for me.

we should probably update our documentation.

@andy31415
Copy link
Contributor

oh .. typo in variant ... should not be asan, should be fuzzer. Will create a PR.

@andy31415
Copy link
Contributor

Fixed ... als tried it to see it runs ... it does and crashes right away. We may need to fix some things ...

@andy31415
Copy link
Contributor

CHIP:SPT: VerifyOrDie failure at ../../examples/all-clusters-app/linux/third_party/connectedhomeip/src/platform/CommissionableDataProvider.cpp:32: gCommissionableDataProvider != nullptr

It seems fuzzing was not run for a long time, so actual prerequisites are not set in main.

@andy31415
Copy link
Contributor

DataProvider fixed in #25968

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.

3 participants