Skip to content

NET 9.0 Android Console App SIGSEGV Crash #111071

Open

Description

@truboxl

Description

Publish a console app using linux-bionic-arm64 and running on the phone causes Segmentation Fault.
I am not able to observe this issue on NET 8.0 SDK but on NET 9.0 SDK.

Reproduction Steps

  1. dotnet new console -o hello
  2. cd hello
  3. dotnet publish -r linux-bionic-arm64 --self-contained -f net9.0
  4. Copy all the contents in bin folder to phone
  5. Run bin/Release/net9.0/linux-bionic-arm64/hello on the phone using adb or Termux app
  6. Observe crash

Expected behavior

Should not crash. Prints Hello, World!

Actual behavior

Prints Segmentation Fault and crash. Attach logcat.txt for inspection.

Regression?

Works on NET 8.0 (8.0.11).

Known Workarounds

No response

Configuration

.NET SDK:
 Version:           9.0.101
 Commit:            eedb237549
 Workload version:  9.0.100-manifests.3068a692
 MSBuild version:   17.12.12+1cce77968

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /home/jylo/.dotnet/sdk/9.0.101/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.0
  Architecture: x64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
  8.0.404 [/home/jylo/.dotnet/sdk]
  9.0.101 [/home/jylo/.dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.11 [/home/jylo/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [/home/jylo/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.11 [/home/jylo/.dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [/home/jylo/.dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Other information

No response

Activity

  1. ghost added
    needs-area-label
    on Jan 3, 2025
  2. added
    untriaged
    on Jan 3, 2025
  3. added and removed
    needs-area-label
    on Jan 3, 2025
  4. dotnet-policy-service commented on Jan 3, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger
    See info in area-owners.md if you want to be subscribed.

  5. steveisok commented on Jan 3, 2025

    @steveisok
    Member

    From your logcat, it looks like the libraries aren't readable:

    NOTE: Function names and BuildId information is missing for some frames due
    01-04 02:10:40.015 12460 12460 F DEBUG   :   NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
    01-04 02:10:40.015 12460 12460 F DEBUG   :   NOTE: found under the lib/ directory are readable.
    01-04 02:10:40.015 12460 12460 F DEBUG   :   NOTE: On this device, run setenforce 0 to make the libraries readable.
    01-04 02:10:40.015 12460 12460 F DEBUG   :   NOTE: Unreadable libraries:
    01-04 02:10:40.015 12460 12460 F DEBUG   :   NOTE:   /data/data/com.termux/files/home/downloads/bin/Release/net9.0/linux-bionic-arm64/hello
    01-04 02:10:40.015 12460 12460 F DEBUG   :   NOTE:   /data/data/com.termux/files/home/downloads/bin/Release/net9.0/linux-bionic-arm64/libcoreclr.so
    01-04 02:10:40.015 12460 12460 F DEBUG   :   NOTE:   /data/data/com.termux/files/home/downloads/bin/Release/net9.0/linux-bionic-arm64/libhostfxr.so
    01-04 02:10:40.015 12460 12460 F DEBUG   :   NOTE:   /data/data/com.termux/files/home/downloads/bin/Release/net9.0/linux-bionic-arm64/libhostpolicy.so
    
  6. truboxl commented on Jan 5, 2025

    @truboxl
    Author

    I believe that is expected from an unrooted Android phone. I will try to find an emulator set-up and reproduce the issue to recapture logs if possible.

  7. truboxl commented on Jan 16, 2025

    @truboxl
    Author

    I have yet to find a proper aarch64 emulator that can run on x86_64 host.

    I assume dotnet downloads the binaries from https://www.nuget.org/packages/Microsoft.NETCore.App.Runtime.linux-bionic-arm64
    Since the binaries are stripped I doubt I can find any usable backtrace.
    I will try to build from source instead.

  8. truboxl commented on Jul 5, 2025

    @truboxl
    Author

    I ended up revert da5bd2b and fixed SIGSEGV

  9. BrzVlad commented on Jul 10, 2025

    @BrzVlad
    Member

    @truboxl If you are building from source do you have a stacktrace of the crash you were getting ? cc @elinor-fung

  10. removed
    untriaged
    on Jul 10, 2025
  11. added this to the 11.0.0 milestone on Jul 10, 2025
  12. truboxl commented on Jul 13, 2025

    @truboxl
    Author
  13. modified the milestones: 11.0.0, 12.0.0 on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions