New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 907597 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 843356
Owner: ----
Closed: Nov 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Clang crashes when compiles with use_clang_coverage=true for Android

Project Member Reported by jdufault@chromium.org, Nov 21

Issue description

Per docs in [1], CrOS is a supported code coverage platform, but when I try to build I get a clang compiler crash in android_image_reader_compat.o[2].
Looking at https://chromium-coverage.appspot.com/ I don't see any chromeos specific components (chrome/browser/chromeos), so I'm guessing this config is not automatically tested.

android_image_reader_compat.cc is only compiled after I set "use_clang_coverage=true". This issue is tangentially related to issue 843356, but since this file should not even be compiled for cros I don't think they are duplicates, since that is a clang compilation failure and this is a build config failure.

My args.gn is

  use_clang_coverage = true
  is_component_build = false
  dcheck_always_on = true
  target_os = "chromeos"

1: https://chromium.googlesource.com/chromium/src/+blame/HEAD/docs/code_coverage.md
2: https://paste.googleplex.com/4817305393430528?raw

liaoyuke@ for further triage if needed.
 
Probably a dupe of issue 865376?
I think we need to come up with a small reproducer and report the issue to LLVM bugtracker. It's a compiler crash and 'LLVM IR generation" is not something we've worked with :)
Do we know why `use_clang_coverage=true` sets is_android to true? Otherwise android_image_reader_compat.cc will not be compiled and the LLVM issue (tracked in issue 843356) should ideally just go away.
Cc: vapier@chromium.org
As far as I understand, parts of the codebase are built for android in all chromeos builds (for arc something something, or mojo, or similar -- I don't remember details and fail to find the thread on it. Maybe vapier knows?).

And we don't support coverage on x86 android I think (issue 865376) (?)
When I removed `use_clang_coverage = true`, android_image_reader_compat.cc did not get built.

So I believe is_android is getting set incorrectly, but I have been unable to figure out where/how that variable is set.
Can you reproduce this issue reliably? e.g. create two empty directories, like:

out/no_coverage and out/with_coverage

and try to build the target in question with and without use_clang_coverage=true?


So far the behavior you're describing is hard to believe in, and my best guess is that something might be accidentally messed up in your build directory (or any other local changes impact that). I'd appreciate if you could verify that, as the case is really confusing at the moment :)
Ah, looks like it was a weird repro state, android_image_reader_compat.cc is now getting built even if I don't have use_clang_coverage=true set.
Cc: steve...@chromium.org achuith@chromium.org
i'm not familiar with the browser code base.  maybe Steven or Achuith would know.
Cc: bpastene@chromium.org
Labels: -Pri-1 Pri-0
Status: Assigned (was: Untriaged)
Labels: -Pri-0 Pri-2
Owner: jdufault@chromium.org
Summary: Clang crashes when compiles with use_clang_coverage=true for Android (was: Code coverage build is broken for os="chromeos"; is_android is getting set to true)
jdufault@, does clang compile android_image_reader_compat.cc successfully without use_clang_coverage=true? But it does crash when use_clang_coverage=true, right?

How many dependencies does this file have? Would it be possible to get rid of any external headers / types and use it as a standalone crash reproducer?
Labels: -Pri-2 Pri-1
Owner: mmoroz@chromium.org
mmoroz@, if you do not maintain chrome coverage builds, can you reassign to the person who does? I'm not the right owner for this.

Yes, android_image_reader_compat.cc builds successfully with use_clang_coverage=false.

I'm not sure about dependencies - maybe llvm has tools for this?
Mergedinto: 843356
Owner: ----
Status: Duplicate (was: Assigned)
I can't maintain something that is not supposed to work. It's a known issue that clang is crashing when compiling for Android with code coverage instrumentation turned on (issue 843356). Help from the people developing for Android would be greatly appreciated here, because they can reduce a crashing input faster than anyone else and therefore file an actionable bug report.

Sign in to add a comment