Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 15054 [details]
The C# code to reproduce the error
I've come across this bug in mono 2.11.4, 3.2.1 and 3.12.1.
Whenever Console.ReadLine() is executed in a background thread while the application is exiting, segmentation faults can occur.
I've made a bash loop script to try it out multiple times since the segfault doesn't seem to occur every time.
Sometimes it takes 500 attempts and sometimes only 5.
The code can be compiled with mcs or in visual studio with .net, both generate the error.
Created attachment 15055 [details]
Bash loop script
Added bash loop script for testing.
No longer reproducible with 4.2 or HEAD on Debian x64 or OSX after ~1500 iterations.
I can reproduce the segfault on Mono 3.12, Mono 4.0 and Mono 4.2 using the Mono Docker images and with 4.2 on the Ubuntu 14.04 x64 host VM (though it took about ~2500 iterations there).
I was also able to repro it using master/f558ee9 too so the bug is definitely still there.
I've attached a stack trace from the core dump of the master build and assigning to Aleksey since you already took a look earlier, please feel to reassign to someone more appropriate :)
Created attachment 15123 [details]
gdb log from core dump
We have changed how threads are stopped so this might be fixed with latest version of Mono. Can you still reproduce with Mono 184.108.40.206 (2017-06/6425f06) or later? Thank you
Please reopen if you can still reproduce. Thank you