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

Regression: fixed (char*) crash: condition `ins->opcode >= MONO_CEE_LAST' not met #1177

Closed
xen2 opened this issue Jan 10, 2018 · 2 comments
Closed

Comments

@xen2
Copy link

xen2 commented Jan 10, 2018

Not sure if this should be reported here or in https://github.com/mono/mono/issues

Steps to Reproduce

  1. Update to latest VS (15.5.2)
  2. Create a new Android project
  3. Add the following code in MainActivity.OnCreate
            string s = " test";
            fixed (char* t = s)
            {
            }
  1. Run the app

Expected Behavior

Program works fine

Actual Behavior

Crash:

01-10 14:37:21.682  2328  2328 E mono    : converting method void App3.MainActivity:OnCreate (Android.OS.Bundle)
01-10 14:37:21.683  2328  2328 F         : * Assertion at /Users/builder/jenkins/workspace/xamarin-android-d15-5/xamarin-android/external/mono/mono/mini/method-to-ir.c:13203, condition `ins->opcode >= MONO_CEE_LAST' not met
01-10 14:37:21.683  2328  2328 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 2328 (App3.App3)

I investigated little bit with a previously working program and noticed the following difference in IL codegen:
Working IL with previous version of VS: stloc.1 ldloc.1 conv.i
IL that triggers the bug with latest VS: stloc.1 ldloc.1 conv.u (probably a recent change in Roslyn?)

Version Information

Microsoft Visual Studio Professional 2017
Version 15.5.2
VisualStudio.15.Release/15.5.2+27130.2010
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Professional

Visual Basic 2017 00370-20001-67423-AA348
Microsoft Visual Basic 2017

Visual C# 2017 00370-20001-67423-AA348
Microsoft Visual C# 2017

Visual C++ 2017 00370-20001-67423-AA348
Microsoft Visual C++ 2017

Visual F# 4.1 00370-20001-67423-AA348
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package 8.10.01106.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017 15.0.31125.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services 1.0
Provides languages services for ASP.NET Core Razor.

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

Azure App Service Tools v3.0.0 15.0.31106.0
Azure App Service Tools v3.0.0

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

Fix File Encoding 1.3.1
Prevents Visual Studio from adding BOM to UTF-8 files.

JavaScript Language Service 2.0
JavaScript Language Service

JavaScript Project System 2.0
JavaScript Project System

JavaScript UWP Project System 2.0
JavaScript UWP Project System

JetBrains ReSharper Ultimate 2017.3.1 Build 111.0.20171221.145902
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2018 JetBrains, Inc.

Merq 1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.51120.3

Microsoft Continuous Delivery Tools for Visual Studio 0.3
Simplifying the configuration of continuous build integration and continuous build delivery 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 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 4.8.4-pre (3fe64e3)
Support for debugging Mono processes with Visual Studio.

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

SQL Server Data Tools 15.1.61710.120
Microsoft SQL Server Data Tools

TypeScript Tools 15.5.11025.1
TypeScript Tools for Microsoft Visual Studio

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 Universal Windows Apps 15.0.27128.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 4.8.0.753 (6575bd113)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 4.8.188 (c5813fa34)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK 8.1.0.25 (HEAD/d8c6e504f)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK 11.6.1.2 (6857dfc)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Xenko.VisualStudio.Package 2.0
Xenko VisualStudio Package

@xen2 xen2 changed the title fixed (char*) crash: condition `ins->opcode >= MONO_CEE_LAST' not met Regression: fixed (char*) crash: condition `ins->opcode >= MONO_CEE_LAST' not met Jan 10, 2018
@grendello
Copy link
Contributor

This issue was fixed in Xamarin.Android 8.1.3.0, please update. You can find more information on this issue in https://bugzilla.xamarin.com/show_bug.cgi?id=60625

@xen2
Copy link
Author

xen2 commented Jan 12, 2018

Sorry, didn't notice that one.
Everything working good, thanks!

jonpryor added a commit to jonpryor/xamarin-android that referenced this issue Mar 23, 2021
jonpryor added a commit that referenced this issue Mar 24, 2021
jonpryor pushed a commit to jonpryor/xamarin-android that referenced this issue Mar 29, 2021
…cations. (dotnet#5708)

Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1288717
Context: xamarin/monodroid@83de4b4

Changes: xamarin/monodroid@b2a750a...4163ee9

  * xamarin/monodroid@4163ee947: [Xamarin.Android.Build.Tasks] Support FastDev for System Apps (dotnet#1177) (dotnet#1186)
  * xamarin/monodroid@947c6ef72: Bump to xamarin/xamarin-android/d16-9@877f5727 (dotnet#1183)

The new fast deployment system (xamarin/monodroid@767f6471) broke
fast deployment for system-installed applications.

This is fixed in xamarin/monodroid@4163ee94.

Adds unit tests to stop this kind of regression in the future.

In order to install a `system` application we need a few things:

 1. The emulator MUST be started with the `-system-writable` argument

 2. The `.apk` needs to be signed with a platform keystore, found at:
    https://github.com/aosp-mirror/platform_build/tree/master/target/product/security

 3. `AndroidManifest.xml` must set
    [`/manifest/@android:sharedUserId`][0] to `android.uid.system`:

        <manifest xmlns:android="http://schemas.android.com/apk/res/android"
            android:sharedUserId="android.uid.system"
            …>
        </manifest>

See also:

  * https://medium.com/xrpractices/android-system-apps-development-d73bedfb8def

[0]: https://developer.android.com/guide/topics/manifest/manifest-element#uid
jonpryor pushed a commit that referenced this issue Mar 30, 2021
…cations. (#5708)

Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1288717
Context: xamarin/monodroid@83de4b4

Changes: xamarin/monodroid@b2a750a...4163ee9

  * xamarin/monodroid@4163ee947: [Xamarin.Android.Build.Tasks] Support FastDev for System Apps (#1177) (#1186)
  * xamarin/monodroid@947c6ef72: Bump to xamarin/xamarin-android/d16-9@877f5727 (#1183)

The new fast deployment system (xamarin/monodroid@767f6471) broke
fast deployment for system-installed applications.

This is fixed in xamarin/monodroid@4163ee94.

Adds unit tests to stop this kind of regression in the future.

In order to install a `system` application we need a few things:

 1. The emulator MUST be started with the `-system-writable` argument

 2. The `.apk` needs to be signed with a platform keystore, found at:
    https://github.com/aosp-mirror/platform_build/tree/master/target/product/security

 3. `AndroidManifest.xml` must set
    [`/manifest/@android:sharedUserId`][0] to `android.uid.system`:

        <manifest xmlns:android="http://schemas.android.com/apk/res/android"
            android:sharedUserId="android.uid.system"
            …>
        </manifest>

See also:

  * https://medium.com/xrpractices/android-system-apps-development-d73bedfb8def

[0]: https://developer.android.com/guide/topics/manifest/manifest-element#uid
@ghost ghost locked as resolved and limited conversation to collaborators Jun 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants