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

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

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

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 Karl Bergström 2013-10-24 05:19:06 UTC
Created attachment 5228 [details]

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 
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.