Bug 37256 - runtime test failures on wrench after a705a45de2622678a6340605a6e551bcf3ddcfdb
Summary: runtime test failures on wrench after a705a45de2622678a6340605a6e551bcf3ddcfdb
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-12-23 05:42 UTC by Zoltan Varga
Modified: 2016-01-25 01:26 UTC (History)
2 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 Zoltan Varga 2015-12-23 05:42:01 UTC
The tests in mono/tests started failing after a705a45de2622678a6340605a6e551bcf3ddcfdb. It looks like the commit has nothing to do with the failure, it just changes the code generated by the c compiler and that exposes the problem.

Can be reproduced with the master packages from wrench.

It looks like the crash happens because the stack protection check generated by gcc fails at the end of mono_jit_runtime_invoke (), the
stack marker appears correct, but rbp is not the same values as at the beginning of the function, so the stack check loads the value from the
wrong location. This only happens on amd64.

using System;
using System.Threading;
using System.Runtime.CompilerServices;

class Tests {

        public int test_exception () {
                Monitor.Exit (this);
                throw new Exception ("A");

        static public int Main (String[] args) {
                Tests b = new Tests ();
                try {
                        b.test_exception ();
                catch (SynchronizationLockException ex) {
			Console.WriteLine ("A: " + ex);
                        // OK
                catch (Exception ex) {
			Console.WriteLine ("B: " + ex);
                        // The other exception should be overwritten by the lock one
                        return 1;
                return 0;
Comment 1 Zoltan Varga 2016-01-25 01:26:49 UTC
This doesn't seem to happen anymore.