On Wed, 7 May 2003 13:14:14 -0700, Dave Hansen wrote:> Jörn Engel wrote:> >>The stack overflow checking in -mjb uses gcc's mcount mechanism to> >>detect overflows. It should get called on every single function call.> > > > Nice trick. Do you have better documentation on that machanism than> > man gcc? The paragraph to -p is quite short and I cannot make the> > connection to the rest of the patch immediately.> > It is a nice trick, but I didn't write it :) I stole the code from Ben> LaHaise, around 2.5.20. All that I've needed to know to maintain the> patch is that a "jmp mcount" gets placed in the critical places.

Sure. But exactly that information is not contained in the manpage (asof Debians 3.2.3). I guess I'll have to dig deeper.

> I've attached a fairly recent version of the stack check patch. If you> need some more examples, check out kernprof's use of it. It's acg> functionality used mcount as well.

Oh, kernprof was too advanced already. It basically worked out of thebox for me, porting it to ppc took maybe one hour, not counting alinker problem that was loosely related to that patch. Never botheredto really understand what it does. :(

If I read this correctly, your patch doesn't catch everything, ifthere are functions remaining that use stack frames >0x200ul. Ok,tell me I'm wrong and should go through the assembler code first.

Jörn

-- Fantasy is more important than knowlegde. Knowlegde is limited,while fantasy embraces the whole world.-- Albert Einstein-To unsubscribe from this list: send the line "unsubscribe linux-kernel" inthe body of a message to majordomo@vger.kernel.orgMore majordomo info at http://vger.kernel.org/majordomo-info.htmlPlease read the FAQ at http://www.tux.org/lkml/