Closed Bug 1484888 Opened 6 years ago Closed 6 years ago

Avoid clang crash with a stack overflow while doing PGO + LTO on Linux

Categories

(Firefox Build System :: Toolchains, enhancement)

enhancement
Not set
normal

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: glandium, Assigned: glandium)

Details

Attachments

(1 file)

      No description provided.
Summary: Avoid stack overflow while doing PGO + LTO on Linux → Avoid clang crash with a stack overflow while doing PGO + LTO on Linux
For some reason, clang 6 crashes with a stack overflow on PGO + LTO on
Linux 64 bits. Clang 7 doesn't, but has other problems.

After some bisecting, I found the following:
- r322684 is the first revision that is broken on the release_60 branch.
- that revision is a cherry pick of r322313 from trunk, which is
  similarly broken.
- trunk was fixed by r322325, which, funnily enough, predates when
  r322313 was cherry-picked.

While the change from r322325 is relatively large, mixing multiple
different changes in a single commit, there also haven't been
significant changes to the same file on trunk since (one macro name
change, one documentation change, and a change related to debug info),
which would tend to indicate the change is not going to break anything,
or at least not more than upgrading to clang 7 would.

The exact part that fixes the issue could probably be found in this
large commit, but I didn't feel like digging into it further considering
the above.
Attachment #9002643 - Flags: review?(core-build-config-reviews)
Comment on attachment 9002643 [details] [diff] [review]
Apply upstream patch that fixes a clang crash with stack overflow on PGO + LTO on Linux.

Review of attachment 9002643 [details] [diff] [review]:
-----------------------------------------------------------------

This patch is a little terrifying.

I would suggest filing a bug with LLVM pointing to this patch as worth a backport, but I guess the 6.x branch is probably dead at this point?
Attachment #9002643 - Flags: review?(core-build-config-reviews) → review+
(In reply to Mike Hommey [:glandium] from comment #1)
> While the change from r322325 is relatively large, mixing multiple
> different changes in a single commit, there also haven't been
> significant changes to the same file on trunk since (one macro name
> change, one documentation change, and a change related to debug info),
> which would tend to indicate the change is not going to break anything,
> or at least not more than upgrading to clang 7 would.

It's amusing and mildly troubling that the fix comes from a patch labeled as no functional change. :/
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/737a89a8edb7
Apply upstream patch that fixes a clang crash with stack overflow on PGO + LTO on Linux. r=froydnj
https://hg.mozilla.org/mozilla-central/rev/737a89a8edb7
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: