Bug 56567 - Passing large struct into exception filter method crashes runtime with SIGSEGV
Summary: Passing large struct into exception filter method crashes runtime with SIGSEGV
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger (show other bugs)
Version: 5.0 (2017-02)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2017-05-17 14:39 UTC by daniil
Modified: 2017-05-23 09:05 UTC (History)
2 users (show)

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


Attachments
SIGSERV demo (1.15 KB, application/x-rar)
2017-05-17 14:39 UTC, daniil
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 daniil 2017-05-17 14:39:41 UTC
Created attachment 22233 [details]
SIGSERV demo

Hi, this is probably any problem with exception filtering support in desctop version of mono runtime.
#Here is simple code repro:

class Program
{
    static void Main( string[] args ) => Process();
 
    public static void Process()
    {
        try
        {
            throw new Exception();
        }
        catch ( Exception ) when ( ExceptionFilter( default( byte ), default( Foo ) ) )
        {
        }
    }

    [MethodImpl( MethodImplOptions.NoInlining )]
    private static bool ExceptionFilter( byte x, Foo item ) => true;

    public struct Foo
    {
        public long Part1 { get; }
        public long Part2 { get; }

        public byte Part3 { get; }
    }
}


#application falls only of sizeof( Foo ) > 16b

# bash for windows:
Ubuntu 14.04.5 LTS
Linux version 3.4.0-Microsoft (Microsoft@Microsoft.com) (gcc version 4.7 (GCC) ) #1 SMP PREEMPT Wed Dec 31 14:42:53 PST 2014

# ubuntu:
Ubuntu 16.04.2 LTS
Linux version 4.8.0-52-generic (buildd@lgw01-59) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #55~16.04.1-Ubuntu SMP Fri Apr 28 14:36:29 UTC 2017

#mono version:
Mono JIT compiler version 5.0.0 (Stable 5.0.0.100/9667aa6 Thu May 11 14:48:10 UTC 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen (concurrent by default)

#built with ms build 15.1.548.43366
Comment 1 Zoltan Varga 2017-05-19 00:46:21 UTC
https://github.com/mono/mono/pull/4903
Comment 2 Zoltan Varga 2017-05-19 15:40:01 UTC
Fixed in mono master afffab3b5c718a9241233a8c6747a3471b2171fc.
Comment 3 daniil 2017-05-23 09:05:33 UTC
thx