LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 39051 - [7.0 Regression] libc++abi incorrectly aligns exceptions in 32 bit builds
Summary: [7.0 Regression] libc++abi incorrectly aligns exceptions in 32 bit builds
Status: RESOLVED FIXED
Alias: None
Product: libc++abi
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: 7.0
Hardware: PC Linux
: P release blocker
Assignee: Marshall Clow (work)
URL:
Keywords: regression
Depends on:
Blocks: release-7.0.1
  Show dependency tree
 
Reported: 2018-09-22 13:20 PDT by Eric Fiselier
Modified: 2018-10-22 09:29 PDT (History)
5 users (show)

See Also:
Fixed By Commit(s): r342815 r344917


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Fiselier 2018-09-22 13:20:16 PDT
Libc++ commit r339431 moved the _LIBCPP_HAS_NO_ALIGNED_ALLOCATION logic from <new> to <__config>. As a result, it was defined when building libc++abi's fallback_malloc.cpp, which made libc++abi think posix_memalign was unavailable.

This meant that libc++abi was silently falling back to using malloc. In 32 bit builds, malloc does not return correctly aligned memory for the exception header.

This is a regression in the 7.0 release.

The issues was fixed in libc++abi commit r342815. This change should be merged into the 7.1 release.

@Marshall, Louis, can you sign off on this?
Comment 1 Louis Dionne 2018-09-22 13:35:37 PDT
Signed off. How did you discover the bug? We should have testers for this, no?
Comment 2 Eric Fiselier 2018-09-22 13:54:19 PDT
> How did you discover the bug? We should have testers for this, no?

We do. The libc++abi 32 bit buildbot has been failing for months due to this bug [1].

I suspect it's also the cause of PR38473.

[1] http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-32bit/builds/424
Comment 3 Louis Dionne 2018-09-22 14:10:41 PDT
> > How did you discover the bug? We should have testers for this, no?
> We do. The libc++abi 32 bit buildbot has been failing for months due to this bug [1].

How embarrassing -- that one's on me.


> I suspect it's also the cause of PR38473.

I don't think so: my reproduction for PR38473 still fails after applying your patch.
Comment 4 Eric Fiselier 2018-09-22 14:24:12 PDT
>> I suspect it's also the cause of PR38473.
>
> I don't think so: my reproduction for PR38473 still fails after applying your patch.

Yeah, looking further, I think the analysis about the separate unwind headers on that bug seems correct.
Comment 5 Tom Stellard 2018-10-19 10:07:55 PDT
Marshall, is this OK to merge?
Comment 6 Marshall Clow (home) 2018-10-19 10:37:15 PDT
(In reply to Tom Stellard from comment #5)
> Marshall, is this OK to merge?

Yes; this is OK to merge for 7.1
Comment 7 Marshall Clow (home) 2018-10-19 10:37:49 PDT
Is there any reason that this bug should not be closed?
Comment 8 Eric Fiselier 2018-10-20 11:16:02 PDT
Have we merged the commit? That would be the reason to keep this open.
Comment 9 Louis Dionne 2018-10-22 05:30:09 PDT
I don't think the commit has been merged to the release branch for LLVM 7.1
Comment 10 Tom Stellard 2018-10-22 09:29:58 PDT
Merged: r344917