AW: [Mono-list] Segmentation fault / StackOverflowExcept

Varga Zoltan vargaz@freemail.hu
Tue, 15 Jul 2003 10:51:18 +0200 (CEST)


                                              Hi,

   What about write protecting the last few frames of the
stack, and
catching the protection fault ? Can that work ?

                    Zoltan

Simon Kitching <simon@ecnetwork.co.nz> =EDrta:

> Well, Sun's Java Virtual Machine on Linux manages to
detect stack
> overflow and throw an exception so it must be possible.
>=20
>=20
> On Mon, 2003-07-14 at 22:51, Dietmar Maurer wrote:
> > > -----Urspr=FCngliche Nachricht-----
> > > Von: Michael Levy [mailto:mlevy@wardium.homeip.net]=20
> > > Gesendet: Freitag, 11. Juli 2003 22:29
> > > An: mono-list@lists.ximian.com
> > > Betreff: [Mono-list] Segmentation fault /=20
> > > StackOverflowException not thrown
> > >=20
> > >=20
> > > Hello,
> > > =09I am fairly new to C# (and mono) but I think that I may=20
> > > have found a potential bug. I have attached a short
peice of=20
> > > (silly) code which shows the problem. The code basically=20
> > > causes a method (or property, depending on what you have=20
> > > un-commented) to recursivly call itsel until it blows the=20
> > > stack. I would expect that this sort of pathological=20
> > > recursion should generate=20
> > > a StackoverflowException when executed, but it simpley
causes=20
> > > a Segmentation fault. I have not been able to confirm
this=20
> > > behaviour on Windows. I am using the lates release of
mono (0.25).
> >=20
> > The problem is that Unix has no real support to catch
stack overflow, i.e.
> > it is highly system specific. So we decided to do a
Segmentation fault in
> > that case.
> >=20
> > Anyways, it should be possible to detect simple cases at
compile time -  so
> > the c# compiler could emit a warning in that case.
> >=20
> > - Dietmar
> > =20
> >=20
> > _______________________________________________
> > Mono-list maillist  -  Mono-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> >=20
>=20
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>=20
>=20
>=20