Alex Rivera | Logout

What is a canonical way to produce a segmentation fault in C#?

Asked 2010-09-22T03:32:04.337
11

I am interested in the shortest, neatest piece of C# code around that will reliably produce a segfault - ideally without directly calling any unmanaged code.

Edit
Report

1 Answer

10

What you're after is somewhat unclear but I suppose this is as good as any answer so far, and it is about as minimal as you can get.

System.Runtime.InteropServices.Marshal.ReadInt32(IntPtr.Zero);

answered 2010-09-22T04:00:18.003

Your Answer