Skip to content

Commit

Permalink
[Fuchsia] Add ASAN_OPTIONS in asan build
Browse files Browse the repository at this point in the history
fuchsia-fyi-x64-asan build is broken due to detect_odr_violation in
rust.[1] and search for "odr-violation" in [2].

It's a known issue [3] and also impacts other platforms [4].

A previous attempt to disable the
sanitize-address-globals-dead-stripping
(in https://crrev.com/c/4690811) fixed media_unittests but broke
base_unittests. So I ended up deciding to follow the suggestion from
the sanitizer itself to use the environment variable.

Since there isn't a asan try, it takes 6+ hours to run, I have to
manually test the change locally. With this change, both media_unittests
and base_unittests are passing when is_asan = true in gn args.

[1]: https://chromium-swarm.appspot.com/task?id=6360bb22591abb10
[2]: https://cas-viewer.appspot.com/projects/chromium-swarm/instances/default_instance/blobs/be139e3b5b49518b8a83be3fcdc5c209dc2acc2c9f725c558dd3fc2aac93a558/404237?filename=emulator_log.serial
[3]: rust-lang/rust#113404
[4]: https://crbug.com/1459233

Bug: 1459233, 1465997
Change-Id: I36fcbb947f87bafaa618bb5de5d631ad895a1bac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4688280
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Reviewed-by: Arthur Eubanks <aeubanks@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
Cr-Commit-Position: refs/heads/main@{#1172603}
NOKEYCHECK=True
GitOrigin-RevId: 78d978e2ea02c1703ed1c65e2da7f04eda84a4ed
  • Loading branch information
zijiehe-google-com authored and copybara-github committed Jul 19, 2023
1 parent e3b5fb0 commit 844789b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions config/fuchsia/test/asan_options.shard.test-cml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
{
program: {
// TODO(crbug.com/1465997): Remove the use of ASAN_OPTIONS once media does
// not load the shared rust library separately.
environ: [
"ASAN_OPTIONS=detect_odr_violation=0",
]
}
}

0 comments on commit 844789b

Please sign in to comment.