Bug 51756 - System.Threading.QueueUserWorkItemCallback related startup crash
Summary: System.Threading.QueueUserWorkItemCallback related startup crash
Status: RESOLVED NORESPONSE
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.0 (C8)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-01-25 09:20 UTC by diraar
Modified: 2017-08-23 20:38 UTC (History)
3 users (show)

Tags: bb
Is this bug a regression?: ---
Last known good build:

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 NORESPONSE

Description diraar 2017-01-25 09:20:59 UTC
In my application, running on a LG G3 D855, I get this error on when starting up, it happens usually when my application has not been started in a while, always restarting it after it crashes works fine:


E/linker  ( 2105): readlink('/proc/self/fd/28') failed: Permission denied [fd=28]
E/linker  ( 2105): warning: unable to get realpath for the library "/vendor/lib/egl/eglsubAndroid.so". Will use given name.
E/mono    ( 2105): 
E/mono    ( 2105): Unhandled Exception:
E/mono    ( 2105): System.NullReferenceException: Object reference not set to an instance of an object
E/mono    ( 2105):   at Dictionary.Fragments.SearchFragment+<>c__DisplayClass13_0.<PerformSearch>b__0 (System.Object x) [0x00050] in <88db5ed5788f4131a4894bb5620511e9>:0 
E/mono    ( 2105):   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x0000e] in <8552b98493c447d5a7a1f07bdaff39bb>:0 
E/mono    ( 2105):   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <8552b98493c447d5a7a1f07bdaff39bb>:0 
E/mono    ( 2105):   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <8552b98493c447d5a7a1f07bdaff39bb>:0 
E/mono    ( 2105):   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x0002a] in <8552b98493c447d5a7a1f07bdaff39bb>:0 
E/mono    ( 2105):   at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in <8552b98493c447d5a7a1f07bdaff39bb>:0 
E/mono    ( 2105):   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <8552b98493c447d5a7a1f07bdaff39bb>:0 


This is the code it fails on:

    private void PerformSearch(string input) {
      ThreadPool.QueueUserWorkItem( x => {
        if ( _tranService == null )
          _tranService = new TranslationService();

        var translations = _tranService.Translate( input );
        _transAdapter.Update( translations );
        Activity.RunOnUiThread( () => _transAdapter.NotifyDataSetChanged() );
      } );
    }

Please let me know what this is, its annoying me very much. Its also happening in another app I am making which uses the same kind of ThreadPool.QueueUserWorkItem() block.

My installation:

Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Professional

Microsoft Visual Studio Tools for Applications 2015   00322-40000-00000-AA309
Microsoft Visual Studio Tools for Applications 2015

Visual Basic 2015   00322-40000-00000-AA309
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA309
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA309
Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package   7.17.00119.9
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1   14.1.21111.0
ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.8.1   14.0.11123.0
Azure App Service Tools v2.8.1

Command Bus, Event Stream and Async Manager   Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.

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

Indent Guides   15
Indent Guides

Adds visual guides at each indentation level.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

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

Microsoft .NET Core Tools (Preview 2)   14.1.21111.0
Microsoft .NET Core Tools (Preview 2)

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

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

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Analysis Services   13.0.1605.88
Microsoft SQL Server Analysis Services Designer 
Version 13.0.1605.88

SQL Server Data Tools   14.0.60629.0
Microsoft SQL Server Data Tools

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 13.0.1601.5

SQL Server Reporting Services   13.0.1605.88
Microsoft SQL Server Reporting Services Designers 
Version 13.0.1605.88

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

Visual Studio Tools for Unity   2.8.0.0
Visual Studio Tools for Unity

Windows Installer XML Toolset   3.10.2.2516
Windows Installer XML Toolset version 3.10.2.2516
Copyright (c) Outercurve Foundation. All rights reserved.

Xamarin   4.2.2.11 (00fa5cc)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.2.42 (501e63c)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.3.1.8 (7beaef4)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Tom Opgenorth 2017-06-27 17:46:08 UTC
Thank you for taking the time to submit the bug. We are unable to reproduce this issue. Please attach a reproduction to the bug by starting with a clean Xamarin.Android project and adding just the code necessary to demonstrate the issue.
Comment 2 Cody Beyer (MSFT) 2017-08-23 20:38:02 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!