Bug 44715 - App crash within parallel foreach loop containing LINQ
Summary: App crash within parallel foreach loop containing LINQ
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-09-24 16:24 UTC by steveo275
Modified: 2017-10-11 17:37 UTC (History)
6 users (show)

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 GitHub or Developer Community 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:

Description steveo275 2016-09-24 16:24:59 UTC
I think I may have found a bug with parallel foreach loops containing a LINQ query. I have the problem code wrapped with try/catch and the app crashes without throwing an exception.  I have a SQLite database called "transactions" that contains a field which is a key (PROD_KEY) to another database called "products".  

     Parallel.ForEach(transactions, transaction =>
          var productQuery = from q in products.Table<Models.Products>()
                             where q.PROD_KEY.Equals(transaction.PROD_KEY)
                             select q;

          //Everything fine to this point.
               var test = productQuery.FirstOrDefault().PROD_S1UNIT;
          catch (Exception ex)


          //App terminates without exception. 

 Built in Visual Studio Pro 2015.  VS and Xamarin are both current.  The only output I get after the app crashes is "The app has been terminated."
Comment 1 Vincent Dondain [MSFT] 2016-09-29 17:30:36 UTC
Please include your full build logs, *symbolicated* crash reports (if any), test case (to reproduce) and all version informations.

The easiest way to get exact version information is to use the "Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" button and copy/paste the version informations (you can use the "Copy Information" button).
Comment 2 Rodrigo Kumpera 2017-10-11 17:37:49 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and reopen the bug report.

Thank you!