Re: enable_irq() unbalanced from 00000005

Andrea Arcangeli (andrea@e-mind.com)
Wed, 3 Feb 1999 02:00:43 +0100 (CET)


On Tue, 2 Feb 1999, MOLNAR Ingo wrote:

>
> On Tue, 2 Feb 1999, Andrea Arcangeli wrote:
>
> > > vd> What does it mean :
> > > vd> enable_irq() unbalanced from 00000005
> > > vd> ?
> >
> > No a module it would be seen as an address of 0xc???????
>
> nope, the thing is that irq.c is being compiled with -fomit-frame-pointer,

The whole kernel is compiled with -fomit-frame-pointer.

> which breaks __builtin_return_address(0).

Here __builtin_return_address(0) doesn't use the frame-pointer (%ebp) at
all. It gets the address of the caller from %esp that obviously has to
remain valid since first or before you have to run `ret`. So as you are
able to run `ret` you are able to grab the return address of the function
at any time even without a frame pointer.

egcs-1.1.1 implements __builtin_return_address(0) on enable_irq() this way
on i386:

0xc010a458 <enable_irq+80>: movl 0xc(%esp,1),%eax
0xc010a45c <enable_irq+84>: pushl %eax
0xc010a45d <enable_irq+85>: pushl $0xc0190f20
0xc010a462 <enable_irq+90>: call 0xc01141d0 <printk>
0xc010a467 <enable_irq+95>: addl $0x8,%esp

I checked that it gets generated the right asm (as above) compiling with
both egcc -O2 -O3 and gcc-2.7.2 -O2 and -O3.

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/