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

Libunwind 1.5rc2 again #36988

Merged
3 commits merged into from
Jun 1, 2020
Merged

Libunwind 1.5rc2 again #36988

3 commits merged into from
Jun 1, 2020

Conversation

sdmaclea
Copy link
Contributor

@sdmaclea sdmaclea commented May 25, 2020

Split the libunwind upgrade to 1.5rc2 into two parts.

  • Support for UNWIND_CONTEXT_IS_UCONTEXT_T==0
  • Update libunwind 1.3rc1 to 1.5rc2

This first part is a requirement of the second part.

Do it separately to see if it causes the libraries regression which triggered the revert of the upgrade.

@sdmaclea sdmaclea added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it labels May 25, 2020
@sdmaclea sdmaclea self-assigned this May 25, 2020
@ghost
Copy link

ghost commented May 25, 2020

Tagging subscribers to this area: @ViktorHofer
Notify danmosemsft if you want to be subscribed.

@sdmaclea
Copy link
Contributor Author

Interestingly the force UNWIND_CONTEXT_IS_UCONTEXT_T=0 broke x64, but not aarch64.

@sdmaclea
Copy link
Contributor Author

@safern @jashook I am trying to recreate the failure which caused the revert. I picked up the change to run the libraries on arm64, but I am still seeing libraries on arm64 being skipped and not failing.

I tried to copy the correct line form your patch, but it is not working. Did I copy it wrong? Am I misunderstanding this should run arm64 libraries tests now?

@sdmaclea sdmaclea changed the title WIP Libunwind again Libunwind 1.5rc2 again May 26, 2020
@sdmaclea sdmaclea requested review from janvorli and safern May 26, 2020 18:36
@sdmaclea sdmaclea removed NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it labels May 26, 2020
@sdmaclea
Copy link
Contributor Author

sdmaclea commented May 26, 2020

Per @safern #36909 reverted this change because it broke alpine arm64 which had no PR CI coverage.

@janvorli @am11 I am assuming the issue was that the uc_sigmask structure was not always the same size (and may have been different between the pal/src/libunwind and the pal/src/exception view). Rather than use macro magic, I have directly applied the patch for libunwind/libunwind#176, and updated the version file for the two patches I have applied on top of 1.5rc2.

This removes the Alpine != glibc, so glibc testing should uncover any issues.

@am11
Copy link
Member

am11 commented May 26, 2020

Thank you!

We can open a PR in libunwind repo. Maintainer will review it (like they did for the previous fixes).

@safern
Copy link
Member

safern commented May 26, 2020

@sdmaclea you would need to add Linux_musl_arm64 here in order to recreate the failure. https://github.com/dotnet/runtime/blob/master/eng/pipelines/runtime.yml#L906

I will update my PR to include musl_arm64 testing on runtime changes.

@janvorli
Copy link
Member

I am assuming the issue was that the uc_sigmask structure was not always the same size

@sdmaclea so you were not able to repro the problem locally? I have Alpine ARM64 Linux distro on my local RPI3, so I can verify that if you want.

@sdmaclea
Copy link
Contributor Author

@janvorli I spent a lot of time staring at all the differences in the aarch64 source, because I hadn't realized the issue was with arm64 alpine. When I finally found out it was an issue with arm64 Alpine, I realized it had to be an issue with this macro stuff. It is the only thing that affects Alpine directly. I was going to trigger a outerloop build on this PR to make sure everything passed.

If you would prefer to test it locally on a RPI3 that would be helpful.

@sdmaclea
Copy link
Contributor Author

The full rolling build passed on this PR. The libraries Libraries Test Run release coreclr Linux_musl arm64 Release was included in the run and passed. I believe this this suite caused the original revert.

I believe it can be reviewed and committed.
I can revert the eng pipeline change if desired before merging.

@sdmaclea
Copy link
Contributor Author

sdmaclea commented May 27, 2020

We can open a PR in libunwind repo. Maintainer will review it (like they did for the previous fixes).

The maintainer pulled the alpine patch into master & 1.5 last night.

@sdmaclea
Copy link
Contributor Author

sdmaclea commented Jun 1, 2020

@janvorli Can we merge this, or do you want me to change something?

@sdmaclea
Copy link
Contributor Author

sdmaclea commented Jun 1, 2020

I'll remove the change to eng/pipelines/runtime.yml. Looks like @safern's patch dropped this change, so it needs to be removed.

edited

Rebased, removed the pipleline change, removed reverted patch. No functional changes.

@@ -111,6 +111,22 @@ static void WinContextToUnwindContext(CONTEXT *winContext, unw_context_t *unwCon
unwContext->regs[13] = winContext->Sp;
unwContext->regs[14] = winContext->Lr;
unwContext->regs[15] = winContext->Pc;
#elif defined(HOST_ARM64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdmaclea, was it not required in the previous version of libunwind?

Copy link
Contributor Author

@sdmaclea sdmaclea Jun 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Between 1.3rc1 and 1.5rc2, libunwind changed the definition of unw_context_t. Therefore #if UNWIND_CONTEXT_IS_UCONTEXT_T changed from being evaluated as true to false. Now this code is used.

This is functionally identical to the code above.

static void WinContextToUnwindContext(CONTEXT *winContext, unw_context_t *unwContext)
{
#define ASSIGN_REG(reg) MCREG_##reg(unwContext->uc_mcontext) = winContext->reg;
    ASSIGN_UNWIND_REGS
#undef ASSIGN_REG
}

See lines 43 & 89 above.

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@ghost
Copy link

ghost commented Jun 1, 2020

Hello @sdmaclea!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 581dc19 into dotnet:master Jun 1, 2020
sdmaclea added a commit to sdmaclea/coreclr that referenced this pull request Jun 25, 2020
Libunwind 1.5rc2 again (dotnet/runtime#36988)

* Add arm64 support for UNWIND_CONTEXT_IS_UCONTEXT_T==0

* Reapply libunwind 1.5rc2

* Fix Linux Alpine libunwind1.5rc2

Add libunwind to cross DAC (dotnet/runtime#37521)

* Libunwind v1.5-rc1-28-g9165d2a1

Pull upstream libunwind which supports building on Windows

* Alignas and typos libunwind/libunwind#186
* Update libunwind-version.txt

* Add libunwind to cross DAC

* Colocate Unix/Windows compiler config
* Unify Windows/Unix configure.cmake
sdmaclea added a commit to sdmaclea/coreclr that referenced this pull request Jun 25, 2020
Libunwind 1.5rc2 again (dotnet/runtime#36988)

* Add arm64 support for UNWIND_CONTEXT_IS_UCONTEXT_T==0

* Reapply libunwind 1.5rc2

* Fix Linux Alpine libunwind1.5rc2

Add libunwind to cross DAC (dotnet/runtime#37521)

* Libunwind v1.5-rc1-28-g9165d2a1

Pull upstream libunwind which supports building on Windows

* Alignas and typos libunwind/libunwind#186
* Update libunwind-version.txt

* Add libunwind to cross DAC

* Colocate Unix/Windows compiler config
* Unify Windows/Unix configure.cmake
sdmaclea added a commit to sdmaclea/coreclr that referenced this pull request Jul 1, 2020
 + Auto renames for (dotnet/coreclr/dotnet#26080)
 + Rename _WIN64 define to BIT64 (dotnet#26080)
 + Remove stray sos reference (dotnet/runtime/dotnet#1875)
 + Fix MSVC warn as errors... (dotnet/runtime/dotnet#1876)
 + Remove unused/unnecessary defines (dotnet/runtime/dotnet#1878)
 + Rename CLR_CMAKE_PLATFORM* CLR_CMAKE_HOST* (dotnet/runtime/#1974)
 + Rename PAL_CMAKE_* CLR_CMAKE_* (dotnet/runtime/dotnet#1984)
 + Add alpinedac & linuxdac build options (dotnet/runtime/dotnet#2056)
 + Refactor CMake system to allow cross OS DAC compile (dotnet/runtime/#2054)
 + Add FEATURE_REMOTE_PROC_MEM (dotnet/runtime/dotnet#2244)
 + Fix compilation of dbgtransportsession (dotnet/runtime/dotnet#2247)
 + Auto renames from (dotnet/runtime/#2256)
 + Rename cross compilation related defines (dotnet/runtime/#2256)
 + Fix logic to disable mscordbi build (dotnet/runtime/#31745)
 + Fix unused variable warning (dotnet/runtime/#31747)
 + Remove GetRecycleMemoryInfo from DAC builds (dotnet/runtime/#31748)
 + Fix check.* cross compilation linker errors (dotnet/runtime/#31751)
 + Reduce PAL DAC exports (dotnet/runtime/#31749)
 + Add EMPTY_BASES_DECL (dotnet/runtime/dotnet#26980)
 + Disable linux unwinder on Windows (dotnet/runtime/#31777)
 + Add cross OS support for MAKEDLLNAME (dotnet/runtime/#31746)
 + Fix host compiler when cross OS DAC compiling (dotnet/runtime/#31775)
 + Fix arm64singlestepper #ifdef (dotnet/runtime/#31776)
 + Configure host features based on host OS (dotnet/runtime/#31778)
 + Configure Host OS APIs based on HOST macros (dotnet/runtime/#31774)
 + Use common CLR_CMAKE_* variables in more places (dotnet/runtime/#31659)
 + Add T_CRITICAL_SECTION for cross OS DAC compile (dotnet/runtime/#31908)
 + Fix arm cross OS DAC compilation (dotnet/runtime/#31903)
 + Add CrossOS DAC build back (dotnet/runtime/#33064)
 + Fix typo (dotnet/runtime/#33192)
 + Fix type layout whan Cross OS compiling (dotnet/runtime/#33487)
 + Partial revert auto renames from (dotnet/runtime/dotnet#2056)
 + Partial revert (dotnet/runtime/dotnet#26080)
 + Enable cross OS DBI build(dotnet/runtime/#35021)
 + Disable EMPTY_BASE_DECL except for cross OS DAC
 + Fix DBI type layout issues
   + Add utilcode_dbi
   + Consistently define DBI features
   + Define T_CRITICAL_SECTION during non-DAC builds
 + Port cross DAC unwind support to 3.1
   + Libunwind 1.5rc2 again (dotnet/runtime#36988)
 + Add libunwind to cross DAC (dotnet/runtime#37521)
@sdmaclea sdmaclea deleted the libunwindAgain branch September 26, 2020 16:53
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants