bundled libunwind is used

Bug #2065178 reported by Dominik Viererbe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dotnet7 (Ubuntu)
Triaged
Low
Unassigned
dotnet8 (Ubuntu)
Triaged
Low
Unassigned

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

Revision history for this message
Dominik Viererbe (dviererbe) wrote :
Changed in dotnet8 (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Mateus Rodrigues de Morais (mateus-morais) wrote (last edit ):

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.