Bug 15644 - sgen thread local storage segfault
Summary: sgen thread local storage segfault
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: GC ()
Version: 3.2.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-10-24 05:19 UTC by Karl Bergström
Modified: 2013-10-24 13:29 UTC (History)
3 users (show)

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


Attachments
stacktrace (3.06 KB, text/plain)
2013-10-24 05:19 UTC, Karl Bergström
Details


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:
Status:
RESOLVED FIXED

Description Karl Bergström 2013-10-24 05:19:06 UTC
Created attachment 5228 [details]
stacktrace

We've been developing a relatively high-volume C# async socket server that crashes reproducibly on mono when faced with load from our test clients. Reproduced with mono x64 3.2.0 as well as 3.2.3 on linux. Application is built with the Visual Studio 2012 compiler for .NET 4.5.

The crash does not occur when running the program with --gc=boehm. From looking at the stack trace and a brief look through the mono source, it looks like it has something to do with thread local storage, which we use extensively in this application in the form of thread static buffers to avoid allocations/contention when processing messages and logging. 
The crash happens as soon as I launch a thousand+ test clients that attempt to connect and authenticate simultaneously.
Comment 1 Zoltan Varga 2013-10-24 05:55:18 UTC
Does the app use thread local storage with structs ? If it is, this might be fixed in mono master by 
90690f50363e534b534b36dd008acf91d097d696.
Comment 2 Karl Bergström 2013-10-24 07:00:08 UTC
I tried recompiling 3.2.3 with the fix in that commit and it no longer crashes. Great timing on that, thanks a lot!
Comment 3 Zoltan Varga 2013-10-24 13:29:15 UTC
-> fixed.