[Mono-dev] Segfault on base class method access

Paul Melis paul at science.uva.nl
Wed Nov 28 11:28:35 EST 2007


Hello Robert,

Robert Jordan wrote:

>Paul Melis wrote:
>  
>
>>When running the code below mono 1.2.5.2 segfaults. The stack trace is 
>>not enlightening.
>>    
>>
>
>This is a stack overflow. When mono was compiled w/out "alt stack"
>support, stack overflows are reported this way.
>  
>
I read that if auto-detection fails this feature will not be enabled. Is 
it unavailable on linux (my platform), will enabling this cause trouble?

>>class C : B
>>{
>>    public override string ToString()
>>    {
>>        return String.Format("({0}) C", (this as A).ToString());
>>    }
>>};
>>    
>>
>
>You cannot do this, since even if you cast to a base class, the
>overridden method will be taken. That's why a "base" call is necessary.
>  
>
Yes, I see that now, I was mislead by the segfault (which I don't 
actually consider a form of "reporting" as it doesn't give any clue as 
to what part of user code is at fault).

Paul



More information about the Mono-devel-list mailing list