Bug 61261 - threads.c:3016, condition `internal' not met
Summary: threads.c:3016, condition `internal' not met
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: Debugger ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Joaquin Jares
URL:
Depends on:
Blocks:
 
Reported: 2018-03-12 09:21 UTC by francescosaf
Modified: 2018-03-23 18:27 UTC (History)
9 users (show)

Tags:
Is this bug a regression?: Yes
Last known good build: 4.8.0.760

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description francescosaf 2018-03-12 09:21:37 UTC
I cannot able to debug my application in Android after upgraded to latest Xamarin 

I can see on Application Output this error

[] * Assertion at /Users/builder/jenkins/workspace/xamarin-android-d15-6/xamarin-android/external/mono/mono/metadata/threads.c:3016, condition `internal' not met
[libc] Fatal signal 6 (SIGABRT), code -6 in tid 10454 (Thread-45)

This only happens when running in the debugger; release builds work fine. I see the same problem on various android version including emulators and real device

=== Visual Studio Community 2017 for Mac ===

Version 7.4 (build 1033)
Installation UUID: 035025e3-312b-4a20-8ed4-ac0492db70b9
Runtime:
	Mono 5.8.0.129 (2017-10/835a98d8559) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 508000129

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.0.5
	2.0.0
	1.1.1
	1.0.4
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK Versions:
	2.1.4
	2.0.0
	1.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.8.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.1
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 8.2.0.15 (Visual Studio Community)
Android SDK: /Users/Francescosaf/Library/Android/sdk
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)
		7.0    (API level 24)
		7.1    (API level 25)
		8.0    (API level 26)
		8.1    (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 27.0.1
SDK Build Tools Version: 26.0.2

Java SDK: /usr
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Apple Developer Tools ===

Xcode 9.2 (13772)
Build 9C40b

=== Xamarin.Mac ===

Version: 4.2.0.20 (Visual Studio Community)

=== Xamarin.iOS ===

Version: 11.8.0.20 (Visual Studio Community)
Hash: 1c6f300e
Branch: d15-6
Build date: 2018-02-07 23:42:40-0500

=== Xamarin Inspector ===

Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 704001033
Git revision: 053991068f3c88497d3e5cc52fe7fdf57c28b62f
Build date: 2018-02-28 05:02:28-05
Xamarin addins: cc3283953e0af0b8bfab1bdfdf847d9e403c4606
Build lane: monodevelop-lion-d15-6

=== Operating System ===

Mac OS X 10.13.3
Darwin 17.4.0 Darwin Kernel Version 17.4.0
    Sun Dec 17 09:19:54 PST 2017
    root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Android Signature Tool 2.1.2
Gist Ide Information 1.1.0
NuGet Package Explorer 0.2
NuGet Package Management Extensions 0.12.2
Internet of Things (IoT) development (Preview) 7.1
Comment 1 Douglas Henke 2018-03-13 15:20:20 UTC
I am encountering the same error. Like francescosaf, I see it in the debugger only -- release builds work fine.

See https://forums.xamarin.com/discussion/comment/323163 for my initial report.

I can reproduce this 100% reliably using the Zebra EMDK barcode scanning API sample application from here:
   http://techdocs.zebra.com/emdk-for-xamarin/2-7/samples/barcode/

(Note that you will need a supported device such as a TC70, TX75 or WT6000.)

Steps to reproduce: 
1. Download (from above link), unzip and open solution.
2. Change build mode from "Release" to "Debug".
3. Clean solution.
4. Build solution.
5. Connect target device via USB cable. Ensure USB debugging is enabled and that your target device model appears next to the "Run" in the toolbar.
6. Launch application in debugger.
7. When UI appears, check "continuous" box, then press "Start" button.
8. Press and release scan trigger a few times. (Two is usually enough. Ten always is.)

This appears to be a regression introduced in or around Xamarin 4.9.0.749. The same code worked perfectly in the debugger until I installed the latest Xamarin update.

I get the same result using Microsoft Visual Studio Professional 2015, Version 14.0.25431.01 Update 3, and with VS2017.

I see the same crash regardless of the target framework. (I've tried everything from 4.4 KitKat to 8.1 Oreo.)

The problem does not depend on the version of the Zebra EMDK used. I've reproduced it with everything from 2.4.0.87 (the default version that comes with the sample app) to 2.7.0.76 (the latest prerelease that's a NuGet package).
Comment 2 francescosaf 2018-03-14 12:23:06 UTC
Yes, It is not related to Zebra SDK but to Xamarin/Mono (also because I'm working with Google Maps sdk and not Zebra SDK :( )
Comment 3 Giovanni 2018-03-19 11:10:48 UTC
Hello to all,
I have the same problem with visual studio 2017 for Windows 10.

Is there a solution ?

The my versions:
Microsoft Visual Studio Professional 2017 
Versione 15.6.2
VisualStudio.15.Release/15.6.2+27428.2005
Microsoft .NET Framework
Versione 4.7.02556

Edizione installata: Professional

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

Mono Debugging for Visual Studio   4.9.11-pre (71eb098)
Support for debugging Mono processes with Visual Studio.

Pacchetto host dell'adattatore di debug di Visual Studio Code   1.0
Livello di interoperabilità per l'hosting degli adattatori di debug di Visual Studio Code in Visual Studio

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   4.9.0.749 (9b0fce36d)
Estensione di Visual Studio per consentire lo sviluppo per Xamarin.iOS e Xamarin.Android.

Xamarin Designer   4.10.58 (cee1369d0)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK   8.2.0.15 (HEAD/22d97e153)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   11.8.0.20 (1c6f300)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 4 stefff 2018-03-22 06:35:39 UTC
I run into this problem as well, with the same configuration as Giovanni.
Comment 5 Douglas Henke 2018-03-22 16:14:54 UTC
This bug is a regression. This bug manifests every time with Xamarin 4.9.0.749. When I build the exact same project using Xamarin 4.8.0.760, it works fine.

I don't seem to be able to update the "regression" flag in the bug header, so I'd take it as a kindness if someone with the appropriate access would do so. Thanks.
Comment 6 Giovanni 2018-03-22 16:33:34 UTC
I confirm with the Xamarin version 4.8.0.760 works
Comment 7 francescosaf 2018-03-22 16:34:27 UTC
just done Douglas Henke
Comment 8 randyhovdestad 2018-03-23 02:28:13 UTC
I too am seeing the same problem with VS 2017 15.6.4; however, the issue does not happen consistently in the same spot in the code - seems to be somewhat random.

Microsoft Visual Studio Enterprise 2017  (2)
Version 15.6.4
VisualStudio.15.Release/15.6.4+27428.2015
Microsoft .NET Framework
Version 4.7.02556

Installed Version: Enterprise

Visual F# Tools 10.1 for F# 4.1   00369-60000-00001-AA343
Microsoft Visual F# Tools 10.1 for F# 4.1

Application Insights Tools for Visual Studio Package   8.11.10212.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.40314.0
ASP.NET and Web Tools 2017

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

Azure App Service Tools v3.0.0   15.0.40215.0
Azure App Service Tools v3.0.0

C# Tools   2.7.0-beta3-62715-05. Commit Hash: db02128e6e3c4bdfc93e6ec425ac9162b4d4fe80
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.

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    Build 111.0.20171218.133305
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 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 Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   4.9.11-pre (71eb098)
Support for debugging Mono processes with Visual Studio.

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

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

SettingsWindow Extension   1.0
SettingsWindow Visual Studio Extension Detailed Info

SQL Server Data Tools   15.1.61801.210
Microsoft SQL Server Data Tools

StylerPackage Extension   1.0
StylerPackage Visual Stuido Extension Detailed Info

TypeScript Tools   15.6.20202.3
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   2.7.0-beta3-62715-05. Commit Hash: db02128e6e3c4bdfc93e6ec425ac9162b4d4fe80
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

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.27428.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.9.0.752 (0faa808ee)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   4.10.58 (cee1369d0)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK   8.2.0.16 (HEAD/a78295902)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   11.8.1.28 (3979d08)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 9 Brendan Zagaeski (Xamarin Team, assistant) 2018-03-23 03:49:45 UTC
Thank you for the report and testing steps. I was able to reproduce this issue using the information from Comment 1 with a Zebra barcode scanner device, and it looks like there is 1 particular commit in the Mono framework that introduced the problem, so I have filed the issue for further tracking in the GitHub Issues tracker for the open source Mono repository: https://github.com/mono/mono/issues/7786.

I would recommend to follow that GitHub issue for updates on the technical investigation or vote and follow the corresponding report on Developer Community for updates and fix notifications:
https://developercommunity.visualstudio.com/content/problem/221192/android-application-crashing-with-condition-intern.html

If by chance anyone on this bug report can share a small sample project that reproduces the problem without the Zebra API or device, feel free to attach it on GitHub or Developer Community. A project that demonstrates the problem across more Android devices might facilitate a quicker investigation and resolution of the issue.

I will mark this Bugzilla issue as RESOLVED to direct further updates about the issue onto those GitHub and Developer Community locations:
https://github.com/mono/mono/issues/7786
https://developercommunity.visualstudio.com/content/problem/221192/android-application-crashing-with-condition-intern.html

Thanks again!
Comment 10 Giovanni 2018-03-23 14:04:46 UTC
Thanks for the reply Brendan Zagaeski.
I just wanted to specify that the problem is present not only on Visual Studio for Mac 2017 but also on Visual Studio 2017 for Windows 10.
Comment 11 Brendan Zagaeski (Xamarin Team, assistant) 2018-03-23 18:27:29 UTC
Thanks!  Since the involved Mono framework threads.c code is shared across all of the Xamarin SDKs in this case, the team will be targeting the fix to Xamarin.Android, Xamarin.iOS, and Xamarin.Mac on both Mac and Windows (as well as desktop the Mono framework MDK on Mac), so this fix will definitely be tracked into both the Mac and Windows versions of the Xamarin SDKs.