[Mono-dev] Mono runtime segfault
Kornél Pál
kornelpal at hotmail.com
Tue Aug 23 09:36:27 EDT 2005
Yes. Infinite recursion allways has to cause stack overflow thus
StackOverflowException should be thrown.
Please include the code that causes stack overflow without a
StackOverflowException as well.
Kornél
----- Original Message -----
From: "David Carr" <dc at dcarr.org>
To: <mono-devel-list at lists.ximian.com>
Sent: Tuesday, August 23, 2005 3:33 PM
Subject: Re: [Mono-dev] Mono runtime segfault
> Feelite et at,
>
> Thanks for the help with my problem. Looks like I have a bit more
> learning to do...
> Should I file a bug report indicating that a StackOverflowException
> should be thrown in this situation?
>
> Thanks for your time,
> David Carr
>
> feelite qiu wrote:
>
>> hi David
>>
>> the code snippet
>>
>> int var
>> {
>> get { return var; }
>> set { var = value; }
>> }
>>
>>
>> creates an infinite loop as properties are internally implemented as
>> methods. So when you instantiate the object,
>>
>> Crash c = new Crash(10);
>>
>> This chain of action is what I understand
>>
>> new Crash(10) -> var = 10; -> set { var = 10; } -> get { return var;
>> } -> get { return var; } ->...
>>
>> the error lies in the fact that your property var does not refer to an
>> underlying field. You can try
>>
>> int Var;
>> int var
>> {
>> get { return Var; }
>> set { Var = value; }
>> }
>>
>>
>> regards
>> feelite
>>
>> On 8/23/05, *David Carr* <dc at dcarr.org <mailto:dc at dcarr.org>> wrote:
>>
>> I'm getting an unexpected segfault running the code below: Forgive
>> me
>> if its a silly mistake on my part.
>>
>> Thanks for any help,
>> David Carr
>>
>> david at Cadmium ~/Prog/c#/gcross $ mono Crash.exe
>> Segmentation fault
>>
>> Listing for Crash.cs:
>> public class Crash
>> {
>> int var
>> {
>> get { return var; }
>> set { var = value; }
>> }
>>
>> public Crash(int i)
>> {
>> var = i;
>> }
>>
>> public static void Main()
>> {
>> Crash c = new Crash(10);
>> }
>>
>> }
>>
>> mono --version
>> Mono JIT compiler version 1.1.8.3 <http://1.1.8.3>, (C) 2002-2005
>> Novell, Inc and
>> Contributors. www.mono-project.com <http://www.mono-project.com>
>> TLS: __thread
>> GC: Included Boehm (with typed GC)
>> SIGSEGV : normal
>> Globalization: normal
>>
>> compiled from source with:
>> gcc --version
>> gcc (GCC) 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1,
>> ssp-3.3.5.20050130-1 , pie-8.7.7.1)
>> Copyright (C) 2003 Free Software Foundation, Inc.
>> This is free software; see the source for copying
>> conditions. There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>> PURPOSE.
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> <mailto:Mono-devel-list at lists.ximian.com>
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>Mono-devel-list mailing list
>>Mono-devel-list at lists.ximian.com
>>http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
More information about the Mono-devel-list
mailing list