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 (show other bugs)
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)

See Also:
Is this bug a regression?: ---
Last known good build:


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!

Note You need to log in before you can comment on or make changes to this bug.