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

Error relocating dotnet - missing symbol _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev #1723

Closed
trylek opened this issue Jan 14, 2020 · 37 comments
Labels
area-Infrastructure-coreclr untriaged New issue has not been triaged by the area owner

Comments

@trylek
Copy link
Member

trylek commented Jan 14, 2020

Platform: Linux_musl arm64 release
Pipeline: runtime-libraries outerloop, runtime-libraries outerloop-linux
Example run: https://dev.azure.com/dnceng/public/_build/results?buildId=482386&view=logs&j=6c926a84-4f53-5790-1d4c-92b88465ec72&t=bc0eac9e-2cde-5709-c96e-4455fef1ffb5

Proximate diagnostic info:

/root/helix/work/workitem /root/helix/work/workitem
Error relocating /root/helix/work/correlation/dotnet: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found
/root/helix/work/workitem
----- end Tue Jan 14 11:46:26 UTC 2020 ----- exit code 127 ----------------------------------------------------------
Looking around for any Linux dump...
... found no dump in /root/helix/work/workitem
+ export '_commandExitCode=127'
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Jan 14, 2020
@ericstj
Copy link
Member

ericstj commented Jan 15, 2020

Seems like a mismatch between the C runtime we build against vs what we run against?

@janvorli
Copy link
Member

We are building Linux MUSL arm64 on Alpine 3.9, this test was running on 3.8. It used to work fine when I was testing it in the past, but maybe we've updated the testing docker images since and a standard C++ library update in 3.9 that we've pulled into the new image has broken the backwards compatibility.
Btw, the mangled name represents std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()
The support for Alpine 3.8 ends on May 1st 2020, so if we officially support it for arm64, it would be good to fix it. However, I am not sure how to do that as the Alpine 3.8 cannot be used for building .NET core - there are some library dependency issues around openssl that were fixed in 3.9, but never back-ported to 3.8.

@janvorli
Copy link
Member

janvorli commented Jan 20, 2020

There was a problem in building rootfs for Alpine. Specifying the edge/main and edge/testing repos for all the packages lead to an unintended installation of libstdc++.so.6.0.27. The libstdc++.so.6.0.25 from 3.9/main should be installed instead, otherwise the binaries we build have unresolved dependency to std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream() that got apparently added in the latest version of the library.

I've created a PR in arcade to fix that (dotnet/arcade#4657). Once that gets merged and propagated to https://github.com/dotnet/dotnet-buildtools-prereqs-docker, we can regenerate the docker images there and update our lab scripts to use the new image name for building Alpine stuff. That will fix the problem.

@safern
Copy link
Member

safern commented Jan 27, 2020

@janvorli it seems like the way we build rootfs in dotnet-buildtools-prereqs-docker, arcade doesn't need to flow as when we call build-rootfs.sh it clones arcade and uses that fresh clone for the cross scripts: https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/master/src/ubuntu/build-scripts/build-rootfs.sh#L35

Since we commented the helix-queues here and the way libraries do testing is not resilient to skipping the send to helix job when the queues are empty, all CI jobs are failing with an error due to the queues being empty.

Can this be fixed already or should I put up a PR to disable the test run for musl arm64?

@janvorli
Copy link
Member

I've realized that too. There was a recent change in the https://github.com/dotnet/dotnet-buildtools-prereqs-docker repo (4 days ago), so there should be new images will be generated due to that and we can just use them.
@MichaelSimons do the new images get automatically generated for docker repo PRs or do you need to trigger their build manually?

@MichaelSimons
Copy link
Member

@janvorli - the builds automatically run when a PR is merged. The entire set of images do not get rebuilt, only the Dockerfiles affected by the PR are built.

Unfortunately there was an infrastructure issue that impacted updating the versions repo with the latest images. If you tell me which image you are looking for I can look up the latest version and let you know.

@janvorli
Copy link
Member

@MichaelSimons the image we need to get is the new version of mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-406629a-20191023143847. We need the rootfs in it to be rebuilt based on a recent change in the Arcade repo. As there was no change in the related Dockerfile, based on what you've said above I am not sure if it got built.

@MichaelSimons
Copy link
Member

@janvorli - the most recent image is ubuntu-16.04-cross-arm64-alpine-406629a-20200121150126. It was rebuilt as a result of merging this change. If you need a newer build, let me know and I can trigger the build.

@janvorli
Copy link
Member

@MichaelSimons I've checked the image you've mentioned and it doesn't have the necessary change in the rootfs. Could you please trigger a build of a newer one?

@MichaelSimons
Copy link
Member

The build completed. The newest tag is now ubuntu-16.04-cross-arm64-alpine-406629a-20200127195039

@janvorli
Copy link
Member

@MichaelSimons awesome, I have verified that the crossfs now contains the necessary change.
@safern could you please try to update our yml files to use this new image for building for arm64 alpine?

@safern
Copy link
Member

safern commented Jan 27, 2020

@safern could you please try to update our yml files to use this new image for building for arm64 alpine?

Yes, I'll work on that and spin a new CI build to see if we still hit those build errors.

@safern
Copy link
Member

safern commented Jan 27, 2020

I have a build going with the change here: https://dev.azure.com/dnceng/public/_build/results?buildId=498569

@janvorli
Copy link
Member

It is strange, the failure is still there and I can see that coreclr build has used the right docker image.
However, there is something strange. The installer build has failed at the packaging time, so it is not clear to me where it has taken the dotnet binary for running the tests from. If it uses some previously built dotnet sdk for it, that would explain the fact that the problem persists. It is executed from /root/helix/work/correlation/dotnet

The failure is still there but I can see that coreclr build has used the right docker image now.

I've downloaded the libraries_bin_Linux_musl_arm64_release.tar.gz build artifact and checked the commit hash of the dotnet and then commit hash of the libcoreclr.so from the shared/Microsoft.NETCore.App/5.0.0. They are different. The libcoreclr.so is from the current PR, but the dotnet is from commit 8743c312a9d1ce4035140046d44bb959c44f194f and I have found that it came from the old core-setup repo: dotnet/core-setup@8743c31. No wonder is has failed, that commit was merged in on Nov 14, 2019.

I can also see there is another problem. The installer build has failed at the packaging time and I can see that it is due to a bug in our scripts. The problem is caused by the fact that the native components are built into a directory that doesn't contain "musl" in its subpath (the subfolder is linux-arm64 and not linux-musl-arm64). See this from the native build in the log:

2020-01-28T02:02:33.8023052Z   -- Installing: /root/runtime/artifacts/bin/linux-arm64.Release/corehost/apphost

This location is expected, the subpath has never been linux-musl-arm64.Release.

As you can see, the packager tries to get it from /root/runtime/artifacts/bin/linux-musl-arm64.Release/corehost/ instead

2020-01-28T02:03:20.8400417Z   Microsoft.NETCore.DotNetAppHost -> /root/runtime/artifacts/packages/Release/specs/Microsoft.NETCore.DotNetAppHost.nuspec
2020-01-28T02:03:21.0257559Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error : Error when creating nuget lib package from /root/runtime/artifacts/packages/Release/specs/runtime.linux-musl-arm64.Microsoft.NETCore.DotNetAppHost.nuspec. System.IO.DirectoryNotFoundException: Could not find a part of the path '/root/runtime/artifacts/bin/linux-musl-arm64.Release/corehost'. [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]
2020-01-28T02:03:21.0260095Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error :    at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound) [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]
2020-01-28T02:03:21.0262228Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error :    at System.IO.Enumeration.FileSystemEnumerator`1.Init() [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]
2020-01-28T02:03:21.0264834Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error :    at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized) [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]
2020-01-28T02:03:21.0266929Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error :    at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options) [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]
2020-01-28T02:03:21.0268656Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error :    at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options) [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]
2020-01-28T02:03:21.0270344Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error :    at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption) [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]
2020-01-28T02:03:21.0271751Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error :    at NuGet.Common.PathResolver.PerformWildcardSearch(String basePath, String searchPath, Boolean includeEmptyDirectories, String& normalizedBasePath) [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]
2020-01-28T02:03:21.0273081Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error :    at NuGet.Packaging.PackageBuilder.ResolveSearchPattern(String basePath, String searchPath, String targetPath, Boolean includeEmptyDirectories) [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]
2020-01-28T02:03:21.0275533Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error :    at NuGet.Packaging.PackageBuilder.AddFiles(String basePath, String source, String destination, String exclude) [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]
2020-01-28T02:03:21.0277226Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error :    at NuGet.Packaging.PackageBuilder.PopulateFiles(String basePath, IEnumerable`1 files) [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]
2020-01-28T02:03:21.0279040Z /root/runtime/.packages/microsoft.dotnet.build.tasks.packaging/5.0.0-beta.20071.3/build/Packaging.targets(1260,5): error :    at Microsoft.DotNet.Build.Tasks.Packaging.NuGetPack.Pack(String nuspecPath, String nupkgPath, Manifest manifest, Boolean packSymbols) in /_/src/Microsoft.DotNet.Build.Tasks.Packaging/src/NuGetPack.cs:line 256 [/root/runtime/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj]

@safern
Copy link
Member

safern commented Jan 28, 2020

We get the host here:
https://github.com/dotnet/runtime/blob/master/src/libraries/restore/runtime/runtime.depproj#L50

I just put up a PR to update the version to use the latest produced host from dotnet/runtime. I will update that in the branch where I update the container and queue another build.

@safern
Copy link
Member

safern commented Jan 28, 2020

I queued: https://dev.azure.com/dnceng/public/_build/results?buildId=499531

Thanks for the investigation @janvorli. @dagood might know faster than I do what we should update for packaging to work on the installer side.

@dagood
Copy link
Member

dagood commented Jan 28, 2020

[...] the commit hash of the dotnet and then commit hash of the libcoreclr.so from the shared/Microsoft.NETCore.App/5.0.0. They are different. The libcoreclr.so is from the current PR, but the dotnet is from commit 8743c312a9d1ce4035140046d44bb959c44f194f

This sounds like a failure for the Installer jobs to properly find the live bits, and getting it from packages instead. (Matching the rest of the comment.) @jkoritzinsky might know something about how this is happening silently since he wrote the live build override code.

The problem is caused by the fact that the native components are built into a directory that doesn't contain "musl" in its subpath (the subfolder is linux-arm64 and not linux-musl-arm64).

I encountered something related where OutputRID wasn't being set properly--that property in particular must be linux-musl-arm64 to produce the proper packages. It's set manually in the Installer jobs rather than in MSBuild:

- ${{ if and(eq(parameters.osSubgroup, '_musl'), eq(parameters.osGroup, 'Linux')) }}:
# Set output RID manually: musl isn't properly detected. Make sure to also convert linux to
# lowercase for RID format. (Detection normally converts, but we're preventing it.)
- name: OutputRidArg
value: /p:OutputRid=linux-musl-${{ parameters.archType }}

It seems plausible that it's being used somewhere it shouldn't be (or vice versa) but I don't see why it would suddenly start failing when building the pkgproj...

@dagood
Copy link
Member

dagood commented Jan 28, 2020

On a recent official build, the corehost ended up where it's expected fine:

  -- Installing: /root/runtime/artifacts/bin/linux-musl-arm64.Release/corehost/apphost
  -- Installing: /root/runtime/artifacts/bin/linux-musl-arm64.Release/corehost/dotnet
...

https://dev.azure.com/dnceng/internal/_build/results?buildId=499150&view=logs&j=1c5cde80-30dc-5a19-5a62-3435737b176e&t=ca6580f5-e0e5-5a44-ef57-d2e78cef564b&l=275

@dagood
Copy link
Member

dagood commented Jan 28, 2020

The build args are identical (except build version), but the first few lines of the native build are different:

- Official
+ CI build above
- __DistroRid: linux-musl-arm64
+ __DistroRid: linux-arm64
- __RuntimeId: linux-musl-arm64
+ __RuntimeId: linux-arm64

It looks like RID detection has gone bad due to changes in the container...

@safern
Copy link
Member

safern commented Jan 28, 2020

This sounds like a failure for the Installer jobs to properly find the live bits, and getting it from packages instead. (Matching the rest of the comment.) @jkoritzinsky might know something about how this is happening silently since he wrote the live build override code.

I don't think it is related to the live build. @janvorli meant the dotnet that we use to run libraries tests, which is always acquired from a NuGet package in runtime.depproj. We have an issue to move libraries tests to use the live built host.

@dagood
Copy link
Member

dagood commented Jan 28, 2020

The new container probably broke this detection, checking...

# Check for musl-based distros (e.g Alpine Linux, Void Linux).
if "${rootfsDir}/usr/bin/ldd" --version 2>&1 | grep -q musl; then
distroRid="linux-musl-${buildArch}"
fi

@dagood
Copy link
Member

dagood commented Jan 28, 2020

The command output changed:

# Old
#> docker run --rm mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-406629a-20191023143847 /crossrootfs/arm64/usr/bin/ldd --version
/crossrootfs/arm64/usr/bin/ldd: 2: exec: /lib/ld-musl-aarch64.so.1: not found

# New
#> docker run --rm mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-406629a-20200127195039 /crossrootfs/arm64/usr/bin/ldd --version
standard_init_linux.go:211: exec user process caused "exec format error"

We could add the old detection method back in, it still looks like it works: #1363 (comment)

#> docker run --rm mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-406629a-20191023143847 cat /crossrootfs/arm64/etc/os-release
...
ID=alpine
...

#> docker run --rm mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-406629a-20200127195039 cat /crossrootfs/arm64/etc/os-release
...
ID=alpine
...

@safern
Copy link
Member

safern commented Jan 28, 2020

I don't think it is related to the live build. @janvorli meant the dotnet that we use to run libraries tests, which is always acquired from a NuGet package in runtime.depproj. We have an issue to move libraries tests to use the live built host.

Given this, I believe what we should do is, update the docker container image (keep tests disabled), fix the RID detection, then wait for an official build to produce a new host package, update the version to that one so that it contains @janvorli fixes in the rootfs folder and then run the tests using that host and see what happens.

@safern
Copy link
Member

safern commented Jan 29, 2020

What I don't understand is that coreclr build for linux arm on the same build, using the same docker container, set the RID correctly:

__w/1/s/src/coreclr/build.sh release arm64 cross -ci -skipnuget -clang9 -stripsymbols
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /__w/_temp/c2d6d877-4e05-4bc8-94c5-5c5ad6f8d6a4.sh
Commencing CoreCLR Repo build
__DistroRid: linux-arm64
__RuntimeId: linux-arm64

@dagood how would that be any different?

I just tried running the Init RID script that we use in a container using the new image and it prints the right output.

Here is from my build using the same docker container locally:

/root/runtime/src/installer/corehost/build.sh Release arm64 -apphostver "5.0.0-ci" -hostver "5.0.0-ci" -fxrver "5.0.0-ci" -policyver "5.0.0-ci" -commithash "960caafb12576b448e646265787a760539c2b9fd" -cross -stripsymbols
  calling build-commons.sh
  Cross build 1
  CrossBuild -- /crossrootfs/arm64
  Running musl check
  rootfsdir: /crossrootfs/arm64
  musl libc (aarch64)
  It is musl
  __DistroRid: linux-musl-arm64
  __RuntimeId: linux-musl-arm64
  Setting up directories for build

@dagood
Copy link
Member

dagood commented Jan 29, 2020

What I don't understand is that coreclr build for linux arm on the same build

The issue is the musl part, Linux arm (implicitly glibc) is not affected.

Here is from my build using the same docker container locally:

I can't explain that. I'd suggest trying the commands in init-distro-rid.sh to try to see why they might be working differently in your environment than mine (and presumably the build machines').

@dagood
Copy link
Member

dagood commented Jan 29, 2020

May have found a missing bit of context--this isn't quite right:

[linux-arm64.Release] is expected, the subpath has never been linux-musl-arm64.Release.

It has always been linux-musl-arm64.Release for Core-Setup/Installer.

@safern
Copy link
Member

safern commented Jan 29, 2020

The issue is the musl part, Linux arm (implicitly glibc) is not affected.

You’re right probably since I got confused enough from my local environment, I just wanted to read -musl-arm64 and my mind betrayed me, haha.

I can't explain that. I'd suggest trying the commands in init-distro-rid.sh to try to see why they might be working differently in your environment than mine (and presumably the build machines').

Yeah, I’ll keep digging a little bit.

@am11 any ideas?

This is the failing build: https://dev.azure.com/dnceng/public/_build/results?buildId=498569

@dagood
Copy link
Member

dagood commented Jan 29, 2020

Found something interesting. The ldd in the new image is a symlink, not a binary. I don't know why this would be the case, but it probably explains why the error is different. Some sort of difference makes sense because dotnet/arcade#4657 changed some native tooling versions.

$ for d in 20191023143847 20200127195039; do
  echo --- $d ---
  docker run --rm mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-406629a-$d bash -c '
    set -x
    file /crossrootfs/arm64/usr/bin/ldd
    /crossrootfs/arm64/usr/bin/ldd --version
    /crossrootfs/arm64/lib/ld-musl-aarch64.so.1 --version'
done

--- 20191023143847 ---
+ file /crossrootfs/arm64/usr/bin/ldd
/crossrootfs/arm64/usr/bin/ldd: POSIX shell script, ASCII text executable
+ /crossrootfs/arm64/usr/bin/ldd
/crossrootfs/arm64/usr/bin/ldd: 2: exec: /lib/ld-musl-aarch64.so.1: not found
+ /crossrootfs/arm64/lib/ld-musl-aarch64.so.1 --version
bash: line 4: /crossrootfs/arm64/lib/ld-musl-aarch64.so.1: cannot execute binary file: Exec format error
--- 20200127195039 ---
+ file /crossrootfs/arm64/usr/bin/ldd
/crossrootfs/arm64/usr/bin/ldd: symbolic link to ../../lib/ld-musl-aarch64.so.1
+ /crossrootfs/arm64/usr/bin/ldd
bash: line 3: /crossrootfs/arm64/usr/bin/ldd: cannot execute binary file: Exec format error
+ /crossrootfs/arm64/lib/ld-musl-aarch64.so.1 --version
bash: line 4: /crossrootfs/arm64/lib/ld-musl-aarch64.so.1: cannot execute binary file: Exec format error

@janvorli
Copy link
Member

May have found a missing bit of context--this isn't quite right:

[linux-arm64.Release] is expected, the subpath has never been linux-musl-arm64.Release.

You are right, I was mistaken in this - it is that way for coreclr / libraries, but not for installer.

@janvorli
Copy link
Member

The ldd in the new image is a symlink, not a binary

That's the reason for the failure. The link is relative, so it ends up trying to execute the aarch64 binary in the rootfs (the crossrootfs/arm64/lib/ld-musl-aarch64.so.1). In the previous image, it was a shell script that tried to load /lib/ld-musl-aarch64.so.1 using absolute path, so it was looking for it out of the rootfs and didn't find it.

@am11
Copy link
Member

am11 commented Jan 29, 2020

ldd(1) is an executable program that is even available in the minimal base systems of various distros, symlink'ing it to an so library is something that should be avoided? What was the reason to create this symlink, is it caused by some typo?

@dagood
Copy link
Member

dagood commented Jan 29, 2020

It looks like ldd was officially a symlink to the library in Alpine until https://gitlab.alpinelinux.org/alpine/aports/commit/d4a7955cc72b9395779c20755df88f983763c43b changed it to an executable script, if I'm reading that commit and the context right. From the linked email thread, seems like it was considered a bug.

I don't know exactly what versions are involved here... dotnet/arcade#4657 does seem to have been a downgrade of some things, but not sure if that's directly related.

@janvorli
Copy link
Member

.. dotnet/arcade#4657 does seem to have been a downgrade of some things

It was a fix - we were accidentally pulling in some stuff from the edge/main and edge/testing repositories like the latest libstdc++ into the Alpine rootfs. So that obviously pulled in the new way of ldd as a script.

@am11
Copy link
Member

am11 commented Jan 29, 2020

@dagood, you are right, just realized that .so itself is an executable file. 😅

interestingly, i am unable to reproduce this issue:

docker run -it mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-406629a-20200127195039 bash -c /crossrootfs/arm64/usr/bin/ldd --version

musl libc (aarch64)
Version 1.1.20
Dynamic Program Loader
Usage: /crossrootfs/arm64/usr/bin/ldd [options] [--] pathname

@janvorli
Copy link
Member

I am unable to repro it myself locally too. But I believe the reason is that I have qemu installed that can run the aarch64 code on my x64 Ubuntu. This is from my x64 machine:

file ~/rootfs/arm64.musl/lib/ld-musl-aarch64.so.1
/home/janvorli/rootfs/arm64.musl/lib/ld-musl-aarch64.so.1: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, stripped

~/rootfs/arm64.musl/lib/ld-musl-aarch64.so.1
musl libc (aarch64)
Version 1.1.18
Dynamic Program Loader
Usage: /home/janvorli/rootfs/arm64.musl/lib/ld-musl-aarch64.so.1 [options] [--] pathname [args]

@am11
Copy link
Member

am11 commented Jan 29, 2020

Ah, tested it in a fresh VM and was able to reproduce the issue. added a fallback condition: #2336.

@safern
Copy link
Member

safern commented Jan 31, 2020

I ran a new build with the dotnet host that was produced with this new container and the issue is fixed 🎉. The only test that failed now was a true failure:

* ExceptionTests - reported call stack:
   at System.Tests.ExceptionTests.ThrowException() in /_/src/libraries/System.Runtime/tests/System/ExceptionTests.cs:line 143
   at System.Tests.ExceptionTests.ThrowAndRethrowOtherMethod(ValueTuple`3& rethrownExceptionStackFrame) in /_/src/libraries/System.Runtime/tests/System/ExceptionTests.cs:line 130
   at System.Tests.ExceptionTests.ThrowStatementDoesNotResetExceptionStackLineOtherMethod() in /_/src/libraries/System.Runtime/tests/System/ExceptionTests.cs:line 118
    System.Tests.ExceptionTests.ThrowStatementDoesNotResetExceptionStackLineOtherMethod [FAIL]
      Assert.Equal() Failure
      Expected: 131
      Actual:   130
      Stack Trace:
        /_/src/libraries/System.Runtime/tests/System/ExceptionTests.cs(154,0): at System.Tests.ExceptionTests.VerifyCallStack(ValueTuple`3 expectedStackFrame, String reportedCallStack, Int32 skipFrames)
        /_/src/libraries/System.Runtime/tests/System/ExceptionTests.cs(122,0): at System.Tests.ExceptionTests.ThrowStatementDoesNotResetExceptionStackLineOtherMethod()
  Finished:    System.Runtime.Tests
=== TEST EXECUTION SUMMARY ===

I'll close once I merge my PR.

@safern safern closed this as completed Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-coreclr untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

8 participants