dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 529 forks source link

SIGSEGV crash in AccessibilityService when using HttpClient #2904

Closed AdmiralSnyder closed 6 months ago

AdmiralSnyder commented 5 years ago

Steps to Reproduce

Error occurs in Emulator, Android 8.1 - API 27.

Context: I build an AccessibilityService that sends its event to another system via HttpClient.PostAsync.

The service must be activated in adb shell with $ settings put secure enabled_accessibility_services App2.App2/App2.ResearchAccessibilityService

App2.zip

Expected Behavior

Don't crash, or at least give me a C# stacktrace.

Actual Behavior

After a couple of successful POSTs, it randomly crashes (Got a SIGSEGV while executing native code.), but the managed stacktrace errors with "domain required for stack walk" (which originates from https://github.com/mono/mono/blob/master/mono/mini/mini-exceptions.c, because some domain is not given --> is this another error needing another Issue?)

the last line of the output is: 03-31 13:10:53.031 F/libc ( 8639): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x50 in tid 8690 (OkHttp Dispatch), pid 8639 (App2.App2)

The problem occurs both when I use the Android HttpClient implementation and the Managed one.

Version Information

I'm on windows, so what should be pasted here?

Windows 10 1809, 17763.402

Microsoft Visual Studio Enterprise 2019 Preview Version 16.0.0 Preview 4.4 VisualStudio.16.Preview/16.0.0-pre.4.4+28721.148 Microsoft .NET Framework Version 4.7.03190

Installed Version: Enterprise

Architecture Diagrams and Analysis Tools 00435-60000-00000-AA436 Microsoft Architecture Diagrams and Analysis Tools

Visual C++ 2019 00435-60000-00000-AA436 Microsoft Visual C++ 2019

ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools

Application Insights Tools for Visual Studio Package 9.0.20307.1 Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019 16.0.12307.51536 ASP.NET and Web Tools 2019

ASP.NET Core Blazor Language Services 16.0.19154.02

ASP.NET Web Frameworks and Tools 2019 16.0.12307.51536 For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.0.12307.51536 Azure App Service Tools v3.0.0

Azure Data Lake Node 1.0 This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.3.8000.0 Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 16.0.12307.51536 Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.3.8000.0 Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 3.0.0-beta4-19170-01+1deafee3682da88bf07d1c18521a99f47446cee8 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.1.77 (master@24013d5) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

GitHub.VisualStudio 2.8.1.7307 A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

Microsoft Azure HDInsight Azure Node 2.3.8000.0 HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service 2.3.8000.0 Language service for Hive query

Microsoft Azure Stream Analytics Language Service 2.3.8000.0 Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node 1.0 Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.0.0

Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 1.0 Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers 1.1 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.0.300 (573eda3) Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.0.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 16.0.28628.00 Microsoft Office Developer Tools for Visual Studio

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0 ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0 ResourcePackage Visual Studio Extension Detailed Info

Snapshot Debugging Extension 1.0 Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.61903.21090 Microsoft SQL Server Data Tools

Syntax Visualizer 1.0 An extension for visualizing Roslyn SyntaxTrees.

Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

ToolWindowHostedEditor 1.0 Hosting json editor into a tool window

TypeScript Tools 16.0.10306.2001 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.0.0-beta4-19170-01+1deafee3682da88bf07d1c18521a99f47446cee8 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Linux Development 1.0.9.28711 Visual C++ for Linux Development

Visual F# Tools 10.4 for F# 4.6 16.0.0.0. Commit Hash: 809f41207b74a1356208f11b8fa3a15233734050. Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake

Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake

Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers

Visual Studio Tools for Unity 4.0.0.5 Visual Studio Tools for Unity

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

Workflow Manager Tools 1.0 1.0 This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin 16.0.0.513 (d16-0@aebc6bdb5) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 4.17.4.413 (remotes/origin/d16-0@db42fb8b0) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.1.43 (fe3ade5) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 9.2.0.5 (HEAD/292d27fa) Xamarin.Android Reference Assemblies and MSBuild support. Mono: mono/mono/2018-08-rc@5ad371dab1b Java.Interop: xamarin/java.interop/d16-0@c987483 LibZipSharp: grendello/LibZipSharp/master@44de300 LibZip: nih-at/libzip/rel-1-5-1@b95cf3f MXE: xamarin/mxe/xamarin@b9cbb535 ProGuard: xamarin/proguard/master@905836d SQLite: xamarin/sqlite/3.26.0@325e91a Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-0@0a7edd6

Xamarin.iOS and Xamarin.Mac SDK 12.6.0.23 (ad57f87) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Log File

what should be used on windows where there is no pbcopy?

adb.log

jpobst commented 6 months ago

With support for Classic Xamarin.Android ended May 1st, 2024, this issue is likely no longer relevant.

If this still persists in .NET 8+, please open a new issue with updated information based on net8.0-android or greater. Please include a link to this issue for context.