Bug 320356 (MONO77580) - [GMCS] Segmentation fault when loading generic program
Summary: [GMCS] Segmentation fault when loading generic program
Status: RESOLVED FIXED
Alias: MONO77580
Product: Mono: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-17 19:48 UTC by Patrick Aussems
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Test case (309 bytes, text/plain)
2006-02-17 19:49 UTC, Thomas Wiest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:49:09 UTC


---- Reported by paussems@dti-be.com 2006-02-17 12:48:24 MST ----

Description of Problem:
I encountered this bug in a program that has been developped using Visual 
C# Express, and that runs fine on windows platform. When I tried it on a 
Linux machine using mono it crashed, so I tried to narrow down the problem 
and ended up with this small test case. It has been tested with today's 
SVN version, and version 1.1.13.2

Steps to reproduce the problem:
1. Get the attached test.cs file
2. Compile it using "gmcs test.cs"
3. Run with "mono test.exe"
4. In the test case, there are three comments (1, 2, 3).
   If any of those lines are commented out, the program runs fine...

Actual Results:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Stacktrace:

in <0xffffffff> XXX:.ctor ()
in <0xb> XXX:.ctor ()
in <0x34> Crash:Main ()
in <0x568e27> (wrapper runtime-invoke) System.Object:runtime_invoke_void 
(object,intptr,intptr,intptr)

Native stacktrace:

        /usr/lib/libmono.so.0(mono_handle_native_sigsegv+0xe5) 
[0xb7dca485]
        /usr/lib/libmono.so.0 [0xb7d8b4dd]
        [0xffffe440]
        /usr/lib/libmono.so.0(mono_field_from_token+0x2a9) [0xb7e6ddc9]
        /usr/lib/libmono.so.0 [0xb7d9a6da]
        /usr/lib/libmono.so.0(mini_method_compile+0x246) [0xb7da6816]
        /usr/lib/libmono.so.0 [0xb7da84db]
        /usr/lib/libmono.so.0(mono_compile_method+0x24) [0xb7e0cc64]
        /usr/lib/libmono.so.0(mono_magic_trampoline+0x25) [0xb7de0285]
        [0xb7f2c032]
        [0xb783fcc5]
        [0xb783fabe]
        /usr/lib/libmono.so.0 [0xb7da88c0]
        /usr/lib/libmono.so.0(mono_runtime_invoke+0x33) [0xb7e0c8c3]
        /usr/lib/libmono.so.0(mono_runtime_exec_main+0x6b) [0xb7e0f82b]
        /usr/lib/libmono.so.0(mono_runtime_run_main+0x18c) [0xb7e12d0c]
        /usr/lib/libmono.so.0(mono_jit_exec+0x8e) [0xb7dbb9fe]
        /usr/lib/libmono.so.0(mono_main+0x1100) [0xb7dbcbc0]
        /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xd0) [0xb7b44eb0]
        /usr/bin/cli [0x8048471]
Aborted


Expected Results:
No crash :)



---- Additional Comments From paussems@dti-be.com 2006-02-17 12:49:34 MST ----

Created an attachment (id=169294)
Test case




---- Additional Comments From paussems@dti-be.com 2006-03-04 06:37:20 MST ----

Any update on this one? This is for us a showstopper bug, and it will
force us to use a Windows machine with .NET 2.0 runtime from Microsoft
instead of the planned Linux server if it's not fixed by the time we
have to deliver the system (which is in about 2 weeks).

Best regards,

Patrick Aussems, DTI sa



---- Additional Comments From atsushi@ximian.com 2006-03-07 11:33:19 MST ----

simplified testcase (less generics):

public class BaseList<SubType>
{
        // without this field instantiation everything works fine.
        object obj = new object ();
}

public class XXX : BaseList<object>
{
}

public class Crash
{
        public static void Main()
        {
                // After creating an array, instantiation got broken.
                XXX [] arr = new XXX [0];
                // this array creation is OK
                // BaseList<object> [] arr = new BaseList<object> [0];

                new BaseList<object> (); // even this causes SISSEGV
        }
}




---- Additional Comments From martin@ximian.com 2006-03-24 14:30:40 MST ----

Fixed in SVN.

Imported an attachment (id=169294)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>Debian unstable</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".