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

Fix redhat arm64 #52244

Merged
merged 17 commits into from
Jul 28, 2021
Merged

Fix redhat arm64 #52244

merged 17 commits into from
Jul 28, 2021

Conversation

janvorli
Copy link
Member

@janvorli janvorli commented May 4, 2021

Clang on ARM64 places the .rodata section into the same segment
as .text. On RHEL 8 ARM64, the kernel is configured for 64kB
memory pages. When we flip the page protection of the page containing
the GS cookie to RW and back to RO, we assume that the cookie lives
in a non-executable memory. This assumption is broken on RHEL 8 and
we end up setting protection of a part of the coreclr code to read
only instead of back to RX.

This change switches the linker we use to lld from the previously
used gnu linker. That linker places .rodata into a different segment
than .text by default. Moreover, I was planning to move to using
lld anyways to use all build tools from LLVM.

Enabling linking using lld revealed a problem with ARM (32 bit) target.
We were using absolute addresses in some asm helpers and so load time
relocation was necessary. This change fixes it by replacing all of those by
PC relative ones.

@janvorli janvorli self-assigned this May 4, 2021
@janvorli
Copy link
Member Author

janvorli commented May 4, 2021

Something is broken in the build on many platforms, I am investigating it.

@janvorli
Copy link
Member Author

janvorli commented May 4, 2021

Hmm, the problem is that we don't have lld on our build machines / in the build docker images. And there is no lld on macOS.

@crummel
Copy link
Contributor

crummel commented May 27, 2021

I made a PR to add LLD to the images here. Do we just need to condition the linker for OSX? I don't have an M1 Mac to try this on so I don't know if the issue repros there.

@janvorli
Copy link
Member Author

janvorli commented May 27, 2021

@crummel we need lld in our docker images, but it turned out to be more involved than I've thought. I have created a PR adding it to the Ubuntu 16.04 images that we use for building, but there was a pushback that 16.04 is out of service and that we should use 18.04 images instead. Similarly for Alpine where we use 3.9 for building and @mthalman wanted to move to 3.12 for the same reasons. I didn't have a chance to get to modifying / testing images on this scale yet as I am currently strongly focusing on W^X support for .NET 6.
Edit:
I've mixed two things together, the pushback was for Alpine only.

@crummel
Copy link
Contributor

crummel commented Jun 10, 2021

In the meantime while you're on 6.0, anything we can help with?

@uweigand
Copy link
Contributor

uweigand commented Jul 5, 2021

I just learned of this suggestion to use lld everywhere. Unfortunately there is currently no support for s390x in lld, so it would be good if this could be made conditional on the architecture as well.

@janvorli
Copy link
Member Author

@uweigand thank you for pointing it out. I'll add exclusion for s390x.

Comment on lines 108 to 110
if (NOT CLR_CMAKE_HOST_ARCH_S390X)
add_linker_flag(-fuse-ld=lld)
endif ()
Copy link
Member

Choose a reason for hiding this comment

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

@janvorli, should we adjust this block accordingly to support all platforms:

if (NOT CLR_CMAKE_HOST_WIN32)
# detect linker
set(ldVersion ${CMAKE_C_COMPILER};-Wl,--version)
execute_process(COMMAND ${ldVersion}
ERROR_QUIET
OUTPUT_VARIABLE ldVersionOutput)
if("${ldVersionOutput}" MATCHES "GNU ld" OR "${ldVersionOutput}" MATCHES "GNU gold" OR "${ldVersionOutput}" MATCHES "GNU linkers")
set(LD_GNU 1)
elseif("${ldVersionOutput}" MATCHES "Solaris Link")
set(LD_SOLARIS 1)
else(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_MACCATALYST)
set(LD_OSX 1)
endif()
endif()

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, thank you, I've forgotten about this detection code

Copy link
Member Author

Choose a reason for hiding this comment

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

It actually gives a match for the LD_GNU:

LLD 10.0.0 (compatible with GNU linkers)

I wonder if we need to differentiate it.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps it would be better if the -fuse-ld=lld is moved to the same block to keep all linker-related configs in one place. Also, we can explicitly exclude CMAKE_C_COMPILER_ID MATCHES "GNU" from using lld (it would otherwise give errors in environment where we only have gcc-toolchain installed).

Aside, I think this line is unnecessary (and it's unique coreclr as everything is using shared or default configs):

set(CMAKE_REQUIRED_LIBRARIES -flto -fuse-ld=gold)

Copy link
Member Author

Choose a reason for hiding this comment

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

At least the -flto is needed for PGO. The -fuse-ld=gold should not be needed when the lld linker is used, as it should also support LTO IIRC.

@@ -105,6 +105,10 @@ elseif (CLR_CMAKE_HOST_UNIX)
# Use uppercase CMAKE_BUILD_TYPE for the string comparisons below
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE)

if (NOT CLR_CMAKE_HOST_ARCH_S390X AND NOT CLR_CMAKE_HOST_OSX AND NOT CLR_CMAKE_HOST_FREEBSD)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (NOT CLR_CMAKE_HOST_ARCH_S390X AND NOT CLR_CMAKE_HOST_OSX AND NOT CLR_CMAKE_HOST_FREEBSD)
if (NOT CLR_CMAKE_HOST_ARCH_S390X AND NOT CLR_CMAKE_HOST_OSX AND NOT CLR_CMAKE_HOST_FREEBSD AND NOT CMAKE_C_COMPILER_ID MATCHES "GNU")

Copy link
Member

Choose a reason for hiding this comment

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

and I still think

would be a better place for this to keep linker configs in one place (unless there is a reason not to).

Copy link
Member Author

Choose a reason for hiding this comment

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

So you are saying that instead of detecting the linker there for Linux, we would set this option at that place? We add a plenty of linker flags in the eng/native/configurecompiler.cmake already, so it seemed to make sense to have it there.

Copy link
Member

Choose a reason for hiding this comment

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

I was actually suggesting to move that condition after line 67 of configuretools.cmake (without deleting anything existing there), because that is the file which is included in all subsets including libraries. configurecompiler is only for coreclr and hosts. Unfortunately, it is not clear as we haven't finished the refactoring properly from my point of view but I paused it to avoid merge conflicts at the time.

I think you would agree that it is good idea to use same linker (whichever is selected) for all components of a given build rather than mixing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I agree with using the same linker for everything. As for moving the setting, it seemed strange that we would set the lld using the option and then right away run the linker detection and find that it is lld.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I was thinking I might have misunderstood what you've meant.

Copy link
Member

@am11 am11 Jul 15, 2021

Choose a reason for hiding this comment

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

We could be more explicit, e.g.

if (NOT CLR_CMAKE_HOST_WIN32)
  if (CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT CLR_CMAKE_HOST_ARCH_S390X AND NOT CLR_CMAKE_HOST_OSX AND NOT CLR_CMAKE_HOST_FREEBSD)
       add_linker_flag(-fuse-ld=lld)
       set(LD_GNU 1) # or maybe LD_LLVM and update the usages with `LD_GNU OR LD_LLVM` to be more explicit / future proof?
  else()
    # detect linker
    ... existing code ..
  endif()
endif()

janvorli added 7 commits July 15, 2021 12:39
Clang on ARM64 places the .rodata section into the same segment
as .text. On RHEL 8 ARM64, the kernel is configured for 64kB
memory pages. When we flip the page protection of the page containing
the GS cookie to RW and back to RO, we assume that the cookie lives
in a non-executable memory. This assumption is broken on RHEL 8 and
we end up setting protection of a part of the coreclr code to read
only instead of back to RX.

This change switches the linker we use to lld from the previously
used gnu linker. That linker places .rodata into a different segment
than .text by default. Moreover, I was planning to move to using
lld anyways to use all build tools from LLVM.
The lld linker has revealed that we were using absolute addresses in some
asm helpers and so load time relocation was necessary. This change fixes
it by replacing all of those by PC relative ones.
Use new images that have lld linker
There is no support for lld on that platform yet
Also update PGO stuff to not to use gold linker when
lld is present.
@janvorli
Copy link
Member Author

So it seems to be working except for a problem with our lab machines that build for Alpine. They use an old clang 5.0.1 (as they run Alpine 3.9). And the lld that's installed on those machines seems to have some bug that causes a build failure.
@crummel what was the lld version that you've installed on the build machines? I've read some note that lld until version 9 was not stable. So I think we will need to move to build on a newer Alpine version. The https://endoflife.date/alpine shows that support for 3.9 has ended about 6 months ago, 3.11 will end in 3 months, so it seems moving to 3.13 or the just released 3.14 would be reasonable. The only thing is that we would need to test that if we build on the latest version, it would still run on all the supported versions at the time of our release, that means at least 3.12.

@janvorli
Copy link
Member Author

I've just verified that Alpine build from 3.13 works fine on Alpine >=3.11. But for this PR, I am going to disable lld for MUSL so that we don't rush the decision on the Alpine version to use for building.

@karelz
Copy link
Member

karelz commented Jul 21, 2021

Http3_MsQuic test failures are tracked in #56090. Should be fixed and merged shortly. Sorry for the inconvenience!

@janvorli
Copy link
Member Author

I have decided to change the way we force the lld. The problem is that the way it is done now, the compiler detection code in cmake won't see the lld linker. While it is not a problem at the moment, I am preparing a change to cross build without the need to install gnu cross tools on the host. In that case, the compiler check fails, as the default linker it looks for is the cross tool one.
So I am working on updating this change to actually set the option on the cmake command line instead using the -DCMAKE_EXE_LINKER_FLAGS_INIT and -DCMAKE_SHARED_LINKER_FLAGS_INIT or the LDFLAGS env var that cmake parses into those two variables.

Copy link
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

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

LGTM with a few questions.

@@ -23,7 +23,10 @@ function(add_pgo TargetName)
else(CLR_CMAKE_HOST_WIN32)
if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO)
target_compile_options(${TargetName} PRIVATE -flto -fprofile-instr-generate)
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-ld=gold -fprofile-instr-generate")
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fprofile-instr-generate")
Copy link
Member

Choose a reason for hiding this comment

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

Just to confirm, LLD supports the same PGO linker flags as GOLD, correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct. I have verified that a release build with -pgoinstrument passes and that the compiler was really passed these options.

@@ -855,7 +855,6 @@ elseif(CLR_CMAKE_TARGET_ARCH_ARM64)
set(VM_SOURCES_DAC_AND_WKS_ARCH
${ARCH_SOURCES_DIR}/stubs.cpp
exceptionhandling.cpp
gcinfodecoder.cpp
Copy link
Member

Choose a reason for hiding this comment

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

Is this change intentionally part of this PR? It seems unrelated at a glance.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, there were some multiply defined symbols due to double inclusion of this file and LLD complained.

@janvorli janvorli merged commit 39803d4 into dotnet:main Jul 28, 2021
@janvorli janvorli deleted the fix-redhat-arm64 branch July 28, 2021 20:51
@@ -14,7 +14,7 @@ parameters:
# This is the default platform provided by Arcade, intended for use by a managed-only repo.
defaultManagedPlatform:
name: 'Managed'
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343'
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-20210714125435-9b5bbc2'
Copy link
Member

Choose a reason for hiding this comment

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

This will likely cause a merge conflict when the next time arcade folder is mirrored https://github.com/dotnet/arcade/blob/dde80826e2fe464ef34182d2f786a6a51121d9a6/eng/common/templates/jobs/source-build.yml#L17.

There was a proposal to send a heads-up comment from bot account on PR that is modifying eng/common and the author is not dotnet-bot. I think it can save the author the hassle of undoing-and-redoing-the-right-way (which has happened a few times in runtime, aspnetcore and other repos).

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, thank you for noticing this, I have not noticed this was in the common folder. I'll make the same change in arcade, that should fix the future issue, I believe (I did something like that in the past).

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, reading the comment in the file above the change, we can just revert the change in it as it is used for managed stuff only and lld is not needed in there. I've updated all references to the centos image I've found and haven't noticed the purpose.

@crummel
Copy link
Contributor

crummel commented Aug 12, 2021

@omajid I think 6.0.100-preview.7.21379.14 (and probably a couple of earlier versions) should have this fix in it. It doesn't look like there's an ARM64 RPM, is that something you can work with?

@omajid
Copy link
Member

omajid commented Aug 12, 2021

Missing RPM for aarch64 shouldn't be a problem. But this still doesn't work for me end-to-end:

$ cat /etc/os-release
NAME='Red Hat Enterprise Linux'
VERSION='8.4 (Ootpa)'
ID=rhel
ID_LIKE=fedora
VERSION_ID=8.4
PLATFORM_ID=platform:el8
PRETTY_NAME='Red Hat Enterprise Linux 8.4 (Ootpa)'
ANSI_COLOR='0;31'
CPE_NAME=cpe:/o:redhat:enterprise_linux:8.4:GA
HOME_URL=https://www.redhat.com/
DOCUMENTATION_URL=https://access.redhat.com/documentation/red_hat_enterprise_linux/8/
BUG_REPORT_URL=https://bugzilla.redhat.com/
REDHAT_BUGZILLA_PRODUCT='Red Hat Enterprise Linux 8'
REDHAT_BUGZILLA_PRODUCT_VERSION=8.4
REDHAT_SUPPORT_PRODUCT='Red Hat Enterprise Linux'
REDHAT_SUPPORT_PRODUCT_VERSION=8.4
$ git clone https://github.com/dotnet/runtime
$ cd runtime
$ git rev-parse HEAD
1011edc50c0ecdaf80bc9b1bc9c802f86583170f'
$ ./build.sh --subset clr+libs+libs.tests --test --runtimeconfiguration Release --librariesConfiguration Debug /p:WithoutCategories=IgnoreForCI /p:NoPgoOptimize=true
__DistroRid: linux-arm64
Downloading 'https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh'
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.

dotnet-install: Downloading primary link https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.100-preview.6.21355.2/dotnet-sdk-6.0.100-preview.6.21355.2-linux-arm64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.100-preview.6.21355.2/dotnet-sdk-6.0.100-preview.6.21355.2-linux-arm64.tar.gz
dotnet-install: Adding to current process PATH: `/home/tester/runtime/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
/home/tester/runtime/eng/common/tools.sh: line 459: 68406 Segmentation fault      (core dumped) "$_InitializeBuildTool" "$@"

It looks like dotnet-sdk-6.0.100-preview.6.21355.2-linux-arm64.tar.gz is still broken? Am I doing something wrong?

@tmds
Copy link
Member

tmds commented Aug 12, 2021

It looks like dotnet-sdk-6.0.100-preview.6.21355.2-linux-arm64.tar.gz is still broken? Am I doing something wrong?

The preview.6 SDK doesn't have the fix.

@crummel
Copy link
Contributor

crummel commented Aug 12, 2021

I changed it in global.json and installed the preview7 SDK and that got a bit further:

[crummel@DDARM64S-051 runtime]$ git diff
diff --git a/global.json b/global.json
index d234281fc93..2c99791695c 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
 {
   "sdk": {
-    "version": "6.0.100-preview.6.21355.2",
+    "version": "6.0.100-preview.7.21379.14",
     "allowPrerelease": true,
     "rollForward": "major"
   },
[crummel@DDARM64S-051 runtime]$ ./build.sh --subset clr+libs+libs.tests --test --runtimeconfiguration Release --librariesConfiguration Debug /p:WithoutCategories=IgnoreForCI /p:NoPgoOptimize=true
__DistroRid: linux-arm64
Downloading 'https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh'

dotnet-install: Downloading primary link https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.100-preview.6.21355.2/dotnet-sdk-6.0.100-preview.6.21355.2-linux-arm64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.100-preview.6.21355.2/dotnet-sdk-6.0.100-preview.6.21355.2-linux-arm64.tar.gz
dotnet-install: Adding to current process PATH: `/home/crummel/runtime/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
Could not execute because the application was not found or a compatible .NET SDK is not installed.
Possible reasons for this include:
  * You intended to execute a .NET program:
      The application 'msbuild' does not exist.
  * You intended to execute a .NET SDK command:
      A compatible installed .NET SDK for global.json version [6.0.100-preview.7.21379.14] from [/home/crummel/runtime/global.json] was not found.
      Install the [6.0.100-preview.7.21379.14] .NET SDK or update [/home/crummel/runtime/global.json] with an installed .NET SDK:
        6.0.100-preview.6.21355.2 [/home/crummel/runtime/.dotnet/sdk]
Build failed with exit code 145. Check errors above.
[crummel@DDARM64S-051 runtime]$ bash .dotnet/dotnet-install.sh -v 6.0.100-preview.7.21379.14  --install-dir .dotnet
dotnet-install: Downloading primary link https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.100-preview.7.21379.14/dotnet-sdk-6.0.100-preview.7.21379.14-linux-arm64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.100-preview.7.21379.14/dotnet-sdk-6.0.100-preview.7.21379.14-linux-arm64.tar.gz
dotnet-install: Adding to current process PATH: `/home/crummel/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
[crummel@DDARM64S-051 runtime]$ ./build.sh --restore --subset clr+libs+libs.tests --test --runtimeconfiguration Release --librariesConfiguration Debug /p:WithoutCategories=IgnoreForCI /p:NoPgoOptimize=true
__DistroRid: linux-arm64
  Determining projects to restore...
  Tool 'coverlet.console' (version '1.7.2') was restored. Available commands: coverlet
  Tool 'dotnet-reportgenerator-globaltool' (version '4.5.8') was restored. Available commands: reportgenerator
  Tool 'microsoft.dotnet.xharness.cli' (version '1.0.0-prerelease.21404.1') was restored. Available commands: xharness
  Tool 'microsoft.visualstudio.slngen.tool' (version '6.0.1') was restored. Available commands: slngen

  Restore was successful.
  All projects are up-to-date for restore.
  Determining projects to restore...
  All projects are up-to-date for restore.
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/installer.tasks/installer.tasks.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/AppleAppBuilder/AppleAppBuilder.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/WorkloadBuildTasks/WorkloadBuildTasks.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/RuntimeConfigParser/RuntimeConfigParser.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/WasmBuildTasks/WasmBuildTasks.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/RuntimeConfigParser/RuntimeConfigParser.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.csproj]
/home/crummel/.nuget/packages/microsoft.net.compilers.toolset/4.0.0-3.21376.12/tasks/netcoreapp3.1/Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.dll" exited with code 139. [/home/crummel/runtime/src/tasks/installer.tasks/installer.tasks.csproj]

Build FAILED.
    0 Warning(s)
    15 Error(s)

The binlog just says CompilerServer: server failed - server rejected the request 'Failed to connect to server' - 42f15c87-03bb-40d2-9e4f-6b98b2425f70. @janvorli does this seem like it should work? Any troubleshooting I can do?

@omajid
Copy link
Member

omajid commented Aug 12, 2021

Exit code 139 maps to the signal handler code 11 (= 139 - 128). 11 is SIGSEGV. We have a segfault. Maybe running it under a native debugger will help?

@crummel
Copy link
Contributor

crummel commented Aug 20, 2021

It looks like it's still using preview6 for some parts of the build:

*** Segmentation fault [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
 [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
Backtrace: [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0x5149d0)[0xffffa2e149d0] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0x34b83c)[0xffffa2c4b83c] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0x34da84)[0xffffa2c4da84] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0x34d968)[0xffffa2c4d968] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0x24fb4c)[0xffffa2b4fb4c] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0x24fd6c)[0xffffa2b4fd6c] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0x25036c)[0xffffa2b5036c] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0x24feb4)[0xffffa2b4feb4] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0x485104)[0xffffa2d85104] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0x4845ec)[0xffffa2d845ec] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0x484500)[0xffffa2d84500] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(+0xc1910)[0xffffa29c1910] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libcoreclr.so(coreclr_initialize+0x2e8)[0xffffa2978ff0] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libhostpolicy.so(+0x76f8)[0xffffa2ff76f8] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libhostpolicy.so(+0x13e80)[0xffffa3003e80] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/libhostpolicy.so(corehost_main+0xb4)[0xffffa300385c] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/host/fxr/6.0.0-preview.7.21377.19/libhostfxr.so(+0xef48)[0xffffa305ef48] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/host/fxr/6.0.0-preview.7.21377.19/libhostfxr.so(+0xdf78)[0xffffa305df78] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/host/fxr/6.0.0-preview.7.21377.19/libhostfxr.so(hostfxr_main_startupinfo+0xac)[0xffffa305ad18] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/dotnet(+0xcaa8)[0xaaaac790caa8] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/dotnet(+0xcce4)[0xaaaac790cce4] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/lib64/libc.so.6(__libc_start_main+0xe4)[0xffffa30d0be4] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
/home/crummel/runtime/.dotnet/dotnet(+0x347c)[0xaaaac790347c] [/home/crummel/runtime/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]

I'll look into this a bit more.

@crummel
Copy link
Contributor

crummel commented Aug 25, 2021

It appears that if the preview6 runtime is available the build prefers to use that instead of preview7. So in addition to my previous steps:

sed -i s/preview.6\.21355\.2/preview.7.21379.14/ global.json
./build.sh --subset clr+libs+libs.tests --test --runtimeconfiguration Release --librariesConfiguration Debug /p:WithoutCategories=IgnoreForCI /p:NoPgoOptimize=true
bash .dotnet/dotnet-install.sh -v 6.0.100-preview.7.21379.14  --install-dir .dotnet

there needs to be afterwards

rm -rf .dotnet/host/fxr/6.0.0-preview.6.21352.12/ .dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.6.21352.12/ .dotnet/shared/Microsoft.AspNetCore.App/6.0.0-preview.6.21355.2/

After that we get through the build but not tests:

(gdb)  r exec --runtimeconfig Microsoft.Extensions.DependencyModel.Tests.runtimeconfig.json --depsfile Microsoft.Extensions.DependencyModel.Tests.deps.json xunit.console.dll Microsoft.Extensions.DependencyModel.Tests.dll -xml testResults.xml -nologo -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing
Starting program: /home/crummel/runtime/artifacts/bin/testhost/net6.0-Linux-Debug-arm64/dotnet exec --runtimeconfig Microsoft.Extensions.DependencyModel.Tests.runtimeconfig.json --depsfile Microsoft.Extensions.DependencyModel.Tests.deps.json xunit.console.dll Microsoft.Extensions.DependencyModel.Tests.dll -xml testResults.xml -nologo -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Missing separate debuginfo for /home/crummel/runtime/artifacts/bin/testhost/net6.0-Linux-Debug-arm64/host/fxr/6.0.0/libhostfxr.so
Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/8f/abac9cabf9a7484147fc70723a16d78f9a8597.debug
Missing separate debuginfo for /home/crummel/runtime/artifacts/bin/testhost/net6.0-Linux-Debug-arm64/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.so
Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/ce/a929b4488a82742a8cd82b037ca518d03f0cc1.debug
[New Thread 0xffffbd89f1b0 (LWP 3372625)]
[New Thread 0xffffbd08f1b0 (LWP 3372626)]
[New Thread 0xffffbc87f1b0 (LWP 3372627)]
[New Thread 0xffffbc02f1b0 (LWP 3372628)]
[New Thread 0xffffbb7df1b0 (LWP 3372629)]
[New Thread 0xffffbafaf1b0 (LWP 3372630)]

Thread 1 "dotnet" received signal SIGSEGV, Segmentation fault.
LoadNativeStringResource (nativeStringResourceTable=..., iResourceID=9481, szBuffer=0xffffffffd878 u"", iMax=256, pcwchUsed=0xffffffffd5a4) at /home/crummel/runtime/src/coreclr/nativeresources/resourcestring.cpp:24
24      {
(gdb) bt
#0  LoadNativeStringResource (nativeStringResourceTable=..., iResourceID=9481, szBuffer=0xffffffffd878 u"", iMax=256, pcwchUsed=0xffffffffd5a4) at /home/crummel/runtime/src/coreclr/nativeresources/resourcestring.cpp:24
#1  0x0000ffffbde6db24 in CCompRC::LoadString (this=<optimized out>, eCategory=<optimized out>, langId=<optimized out>, iResourceID=9481, szBuffer=0xffffffffd878 u"", iMax=256, pcwchUsed=0xffffffffd5a4) at /home/crummel/runtime/src/coreclr/utilcode/ccomprc.cpp:538
#2  CCompRC::LoadString (this=<optimized out>, eCategory=<optimized out>, iResourceID=9481, szBuffer=0xffffffffd878 u"", iMax=256, pcwchUsed=0xffffffffd5a4) at /home/crummel/runtime/src/coreclr/utilcode/ccomprc.cpp:487
#3  0x0000ffffbde6fd24 in SString::LoadResourceAndReturnHR (this=0xffffffffd860, pResourceDLL=0xffffbe1b6128 <CCompRC::m_DefaultResourceDll>, eCategory=CCompRC::Debugging, resourceID=9481) at /home/crummel/runtime/src/coreclr/utilcode/sstring_com.cpp:62
#4  0x0000ffffbde6fc08 in SString::LoadResourceAndReturnHR (this=0xffffbe19b590 <nativeStringResourceTable_mscorrc>, eCategory=4294957176, resourceID=256) at /home/crummel/runtime/src/coreclr/utilcode/sstring_com.cpp:26
#5  SString::LoadResource (this=0xffffbe19b590 <nativeStringResourceTable_mscorrc>, eCategory=4294957176, resourceID=256) at /home/crummel/runtime/src/coreclr/utilcode/sstring_com.cpp:20
#6  0x0000ffffbdd6c5e0 in ProfilingAPIUtility::LogProfEventVA (iStringResourceID=<optimized out>, wEventType=<optimized out>, insertionArgs=...) at /home/crummel/runtime/src/coreclr/vm/profilinghelper.cpp:304
#7  0x0000ffffbdd6c800 in ProfilingAPIUtility::LogProfInfo (iStringResourceID=-1105611376) at /home/crummel/runtime/src/coreclr/vm/profilinghelper.cpp:365
#8  0x0000ffffbdd6cdb4 in ProfilingAPIUtility::AttemptLoadProfilerList () at /home/crummel/runtime/src/coreclr/vm/profilinghelper.cpp:772
#9  0x0000ffffbdd6c948 in ProfilingAPIUtility::InitializeProfiling () at /home/crummel/runtime/src/coreclr/vm/profilinghelper.cpp:440
#10 0x0000ffffbdfa19d4 in EEStartupHelper () at /home/crummel/runtime/src/coreclr/vm/ceemain.cpp:905
#11 0x0000ffffbdfa0e68 in EEStartup()::$_0::operator()(void*) const (this=<optimized out>, p=<optimized out>) at /home/crummel/runtime/src/coreclr/vm/ceemain.cpp:1153
#12 EEStartup () at /home/crummel/runtime/src/coreclr/vm/ceemain.cpp:1155
#13 0x0000ffffbdfa0d7c in EnsureEEStarted () at /home/crummel/runtime/src/coreclr/vm/ceemain.cpp:321
#14 0x0000ffffbdbe3878 in CorHost2::Start (this=0xaaaaaaaef3b0) at /home/crummel/runtime/src/coreclr/vm/corhost.cpp:101
#15 0x0000ffffbdb9c48c in coreclr_initialize (exePath=0xaaaaaaae4e10 "/home/crummel/runtime/artifacts/bin/testhost/net6.0-Linux-Debug-arm64/dotnet", appDomainFriendlyName=<optimized out>, propertyCount=<optimized out>, propertyKeys=<optimized out>, propertyValues=<optimized out>, hostHandle=<optimized out>, domainId=<optimized out>)
    at /home/crummel/runtime/src/coreclr/dlls/mscoree/unixinterface.cpp:251
#16 0x0000ffffbe217738 in ?? () from /home/crummel/runtime/artifacts/bin/testhost/net6.0-Linux-Debug-arm64/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.so
#17 0x0000ffffbe223ec0 in ?? () from /home/crummel/runtime/artifacts/bin/testhost/net6.0-Linux-Debug-arm64/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.so
#18 0x0000ffffbe22389c in corehost_main () from /home/crummel/runtime/artifacts/bin/testhost/net6.0-Linux-Debug-arm64/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.so
#19 0x0000ffffbe27ef48 in ?? () from /home/crummel/runtime/artifacts/bin/testhost/net6.0-Linux-Debug-arm64/host/fxr/6.0.0/libhostfxr.so
#20 0x0000ffffbe27df78 in ?? () from /home/crummel/runtime/artifacts/bin/testhost/net6.0-Linux-Debug-arm64/host/fxr/6.0.0/libhostfxr.so
#21 0x0000ffffbe27ad18 in hostfxr_main_startupinfo () from /home/crummel/runtime/artifacts/bin/testhost/net6.0-Linux-Debug-arm64/host/fxr/6.0.0/libhostfxr.so
#22 0x0000aaaaaaaacaa8 in ?? ()
#23 0x0000aaaaaaaacce4 in ?? ()
#24 0x0000ffffbe2f0be4 in __libc_start_main (main=0xaaaaaaaacc54, argc=17, argv=0xffffffffe7e8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>) at ../csu/libc-start.c:308
#25 0x0000aaaaaaaa347c in ?? ()
Backtrace stopped: not enough registers or memory available to unwind further

@crummel
Copy link
Contributor

crummel commented Sep 2, 2021

@janvorli Any idea where to go from here? Is this the same stack trace you were seeing?

@tmds
Copy link
Member

tmds commented Sep 2, 2021

@crummel I had a look, and I don't think these changes are on the v6.0.0-preview.7.21377.19 tag.

@tmds
Copy link
Member

tmds commented Sep 2, 2021

The 6.0-rc1 branch has the changes.

@crummel
Copy link
Contributor

crummel commented Sep 2, 2021

Thanks, I'll give it a try with that.

@crummel
Copy link
Contributor

crummel commented Sep 9, 2021

I got the same stacktrace in 6.0.100-rc.1.21411.2, and anything after that (commit dotnet/installer@cfe0456 and after) segfaults immediately:

 tar xzvf ../dotnet-sdk-6.0.100-rc.1.21458.32-linux-arm64.tar.gz
[crummel@DDARM64S-051 sdk]$ ./dotnet --info
Segmentation fault (core dumped)

I don't have the symbols for the bootstrap version so I have nothing useful yet:

(gdb) r --info
Starting program: /home/crummel/rc1/sdk/dotnet --info
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Missing separate debuginfo for /home/crummel/rc1/sdk/host/fxr/6.0.0-rc.1.21451.13/libhostfxr.so
Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/37/a89839ba43eb374036e875c0bed0a68f71eddb.debug
Missing separate debuginfo for /home/crummel/rc1/sdk/shared/Microsoft.NETCore.App/6.0.0-rc.1.21451.13/libhostpolicy.so
Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/80/8afacff48013e8cecdc1dd2adf771c9143c3ad.debug
Missing separate debuginfo for /home/crummel/rc1/sdk/shared/Microsoft.NETCore.App/6.0.0-rc.1.21451.13/libcoreclr.so
Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/de/9f71c740a81b858f92785369f8c1a3779ba3ca.debug
Missing separate debuginfo for /home/crummel/rc1/sdk/shared/Microsoft.NETCore.App/6.0.0-rc.1.21451.13/libcoreclrtraceptprovider.so
Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/cf/3e5829c7ac1a9fb54a42a480f0ec1f39148770.debug
[New Thread 0xffffbd89f1b0 (LWP 2038963)]
[New Thread 0xffffbd08f1b0 (LWP 2039007)]
[New Thread 0xffffbc87f1b0 (LWP 2039008)]
[New Thread 0xffffbc02f1b0 (LWP 2039010)]
[New Thread 0xffffbb7df1b0 (LWP 2039011)]
[New Thread 0xffffbafaf1b0 (LWP 2039012)]

Thread 1 "dotnet" received signal SIGSEGV, Segmentation fault.
0x0000ffffbe022aa0 in ?? () from /home/crummel/rc1/sdk/shared/Microsoft.NETCore.App/6.0.0-rc.1.21451.13/libcoreclr.so

I'm cross-building an ARM64 SDK now so I'll have the symbols and hopefully a better idea of what's going on.

@tmds
Copy link
Member

tmds commented Sep 9, 2021

@crummel can you check .text and .rodata are no longer in the same segment in your arm64 libcoreclr.so? see #43349 (comment).

@crummel
Copy link
Contributor

crummel commented Sep 9, 2021

That looks like the issue:

[crummel@DDARM64S-051 sdk]$ readelf -Wl ./shared/Microsoft.NETCore.App/6.0.0-rc.1.21451.13/libcoreclr.so

Elf file type is DYN (Shared object file)
Entry point 0x79f80
There are 8 program headers, starting at offset 64

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  LOAD           0x000000 0x0000000000000000 0x0000000000000000 0x64de98 0x64de98 R E 0x10000
  LOAD           0x64e750 0x000000000065e750 0x000000000065e750 0x03f9f0 0x0a4b30 RW  0x10000
  DYNAMIC        0x6705e0 0x00000000006805e0 0x00000000006805e0 0x0002b0 0x0002b0 RW  0x8
  NOTE           0x000200 0x0000000000000200 0x0000000000000200 0x000024 0x000024 R   0x4
  TLS            0x64e750 0x000000000065e750 0x000000000065e750 0x000000 0x0000e9 R   0x10
  GNU_EH_FRAME   0x564b3c 0x0000000000564b3c 0x0000000000564b3c 0x01fc9c 0x01fc9c R   0x4
  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW  0x10
  GNU_RELRO      0x64e750 0x000000000065e750 0x000000000065e750 0x0248b0 0x0248b0 R   0x1

 Section to Segment mapping:
  Segment Sections...
   00     .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_d .gnu.version_r .rela.dyn .rela.plt .init .plt .text .fini .rodata __tracepoints_strings .eh_frame_hdr .eh_frame .gcc_except_table
   01     .init_array .fini_array .jcr .data.rel.ro .dynamic .got .data __tracepoints __tracepoints_ptrs .bss
   02     .dynamic
   03     .note.gnu.build-id
   04     .tbss
   05     .eh_frame_hdr
   06
   07     .init_array .fini_array .jcr .data.rel.ro .dynamic .got

@tmds
Copy link
Member

tmds commented Sep 9, 2021

That looks like the issue:

This PR is meant to cause them to be in different sections. If we're sure the binaries were compiled with this change, we need to figure out why it didn't have an effect.

@crummel
Copy link
Contributor

crummel commented Sep 9, 2021

It does look like this PR commit is in the RC1 I'm using:

[crummel@DDARM64S-051 sdk]$ strings ./shared/Microsoft.NETCore.App/6.0.0-rc.1.21451.13/libcoreclr.so | egrep '[0-9A-Fa-f]{20}
@(#)Version 6.0.21.45113 @Commit: d7619cd4b165c13430484e381042f055d4c5a9c7
[crummel@DDARM64S-051 runtime]$ if `git merge-base --is-ancestor 39803d4 d7619cd4b165c13430484e381042f055d4c5a9c7`; then echo yes; else echo no; fi
yes

@janvorli Any idea why this fix wouldn't be working? Anything else I should check?

@janvorli
Copy link
Member Author

janvorli commented Sep 9, 2021

I think it would not work if for some reason the build machine didn't have the lld linker installed. Can we get a build log from the machine it was built on? Maybe I've missed an update in a part of the infra somewhere.

@janvorli
Copy link
Member Author

janvorli commented Sep 9, 2021

Hmm, this is weird, I can repro it with a local cross build for arm64 too. So maybe it got broken after my change or I've made some mistake in a final cleanup before finalizing the PR.

@crummel
Copy link
Contributor

crummel commented Sep 9, 2021

This is the runtime build in that SDK according to BAR: https://dev.azure.com/dnceng/internal/_build/results?view=results&buildId=1287635. Logs are only good for two more days.

@janvorli
Copy link
Member Author

janvorli commented Sep 9, 2021

I can repro it locally. Even with checking out the state of the repo right after my fix. So I must have made some mistake.

@janvorli
Copy link
Member Author

@crummel Fixed in #58959

@ghost ghost locked as resolved and limited conversation to collaborators Oct 10, 2021
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.

8 participants