[Bug 2065178] Re: bundled libunwind is used

Mateus Rodrigues de Morais 2065178 at bugs.launchpad.net
Wed May 8 16:40:19 UTC 2024


I have tested enabling CLR_CMAKE_USE_SYSTEM_LIBUNWIND on dotnet8 in a
PPA [0].

The build succeeds for amd64 and s390x. It fails for arm64 during
crossgen:

```
           crossgen2 -> /<<PKGBUILDDIR>>/src/runtime/artifacts/source-build/self/src/artifacts/bin/coreclr/linux.arm64.Release/crossgen2/crossgen2.dll
           /<<PKGBUILDDIR>>/previously-built-dotnet/sdk/8.0.104/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(470,5): error : /<<PKGBUILDDIR>>/src/runtime/artifacts/source-build/self/src//dotnet.sh: line 27: 56852 Segmentation fault      (core dumped) ${dotnetPath} "$@" [/<<PKGBUILDDIR>>/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/crossgen2/crossgen2.csproj]
           /<<PKGBUILDDIR>>/previously-built-dotnet/sdk/8.0.104/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(358,5): error NETSDK1096: Optimizing assemblies for performance failed. You can either exclude the failing assemblies from being optimized, or set the PublishReadyToRun property to false. [/<<PKGBUILDDIR>>/src/runtime/artifacts/source-build/self/src/src/coreclr/tools/aot/crossgen2/crossgen2.csproj]
           
           Build FAILED.
```

This is the ldd output on an amd64 machine for validation:

$ ldd /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.4/libcoreclr.so 
        linux-vdso.so.1 (0x00007fffbc398000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x000074a7fbdae000)
        libunwind-x86_64.so.8 => /lib/x86_64-linux-gnu/libunwind-x86_64.so.8 (0x000074a7fbd92000)
        libunwind.so.8 => /lib/x86_64-linux-gnu/libunwind.so.8 (0x000074a7fbd77000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x000074a7fb200000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x000074a7fb517000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x000074a7fae00000)
        /lib64/ld-linux-x86-64.so.2 (0x000074a7fbde2000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x000074a7fbd43000)

[0] https://launchpad.net/~mateus-morais/+archive/ubuntu/dotnet-
libunwind

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dotnet8 in Ubuntu.
https://bugs.launchpad.net/bugs/2065178

Title:
  bundled libunwind is used

Status in dotnet7 package in Ubuntu:
  Triaged
Status in dotnet8 package in Ubuntu:
  Triaged

Bug description:
  It seems to me that dotnet7 and dotnet8 packages do not use the system
  libunwind library.

  ldd /usr/lib/dotnet/shared/Microsoft.NETCore.App/*/libcoreclr.so
  /usr/lib/dotnet/shared/Microsoft.NETCore.App/6.0.27/libcoreclr.so:
      linux-vdso.so.1 (0x00007ffce9bdc000)
      libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007c022f3fe000)
      libunwind-x86_64.so.8 => /lib/x86_64-linux-gnu/libunwind-x86_64.so.8 (0x00007c022f3e2000)
      libunwind.so.8 => /lib/x86_64-linux-gnu/libunwind.so.8 (0x00007c022f3c6000)
      libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007c022e800000)
      libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007c022eb15000)
      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007c022e400000)
      /lib64/ld-linux-x86-64.so.2 (0x00007c022f437000)
      liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007c022f392000)
  /usr/lib/dotnet/shared/Microsoft.NETCore.App/7.0.16/libcoreclr.so:
      linux-vdso.so.1 (0x00007fffb24d5000)
      libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007320c345a000)
      libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007320c2800000)
      libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007320c336f000)
      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007320c2400000)
      /lib64/ld-linux-x86-64.so.2 (0x00007320c3493000)
  /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.2/libcoreclr.so:
      linux-vdso.so.1 (0x00007ffd91bea000)
      libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x0000737a5eff7000)
      libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x0000737a5e400000)
      libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x0000737a5e715000)
      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000737a5e000000)
      /lib64/ld-linux-x86-64.so.2 (0x0000737a5f030000)

  Note that only 6.0.27/libcoreclr.so list the following:

      libunwind-x86_64.so.8 => /lib/x86_64-linux-gnu/libunwind-x86_64.so.8 (0x00007c022f3e2000)
      libunwind.so.8 => /lib/x86_64-linux-gnu/libunwind.so.8 (0x00007c022f3c6000)

  The build logs also indicate to me that the bundled version is used.

  [ Other ]

  * dotnet6 lists "libunwind-dev [amd64]" as Build-Depends, but the
  dotnet7 and dotnet8 packages list "libunwind-dev", (without the
  "[amd64]")

  * dotnet6 had a patch remove-libunwind-build.patch which is not
  present in dotnet7/dotnet8. This patch disabled the bundled libunwind
  build for non-arm64 architectures to use the system library. The patch
  needs to be adapted for .NET 7 & 8, because the project structure has
  changed and the patch does not apply cleanly. Additionally we now
  build .NET 8 for s390x and plan to build for ppc64el. So we have to
  look into how this could work for that platform.

  * A possible solution could be patching
  src/runtime/src/coreclr/pal/src/CMakeLists.txt to set
  CLR_CMAKE_USE_SYSTEM_LIBUNWIND

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dotnet7/+bug/2065178/+subscriptions




More information about the foundations-bugs mailing list