Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 84530 - Bad stacks on PowerPC
Bad stacks on PowerPC
Product: eCos
Classification: Retired
Component: Kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jonathan Larmour
Jonathan Larmour
Depends On:
  Show dependency treegraph
Reported: 2003-02-18 10:16 EST by Gary Thomas
Modified: 2007-04-18 12:51 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-06-20 12:18:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gary Thomas 2003-02-18 10:16:48 EST
Description of problem:

Enabling CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT causes the stack frames
to confuse GDB.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
2. Stop at a breakpoint or ^C
3. GDB 'bt' command will fail
Actual results:

Expected results:

Additional info:
Comment 1 Jonathan Larmour 2003-02-18 12:37:45 EST
From further discussion on ecos-discuss:
Gary D. Thomas wrote:

> On Tue, 2003-02-18 at 09:27, Jonathan Larmour wrote:
>> I know you've identified the stack checking as the reason, but it's not
really the cause (other than GDB's stack guesswork), so there's still another
interesting issue with this: the stub shouldn't barf. There's meant to be code
to catch this (see cyg_hal_exception_handler() in
hal/powerpc/arch/current/src/hal_misc.c - look at the stuff at the top about
>> If it correctly caught the exception the backtrace would likely work using
GDB's admittedly ramshackle heuristics. *That's* the problem, not the stack
checking itself.
>> I'll add this to the bug.
> I agree that GDB should not barf - certainly that's a problem.
> However, I think that the stack checking code is breaking the
> EABI and putting stuff on the stack that is, in essence, invalid.
> The PowerPC ABIs really suck (thanks, IBM) in that there needs
> to be some space (I don't recall how much) *above* the stack
> that belongs to the current frame.  This means that the last
> stack frame (the ending one, hopefully) can't have those
> 0xDEADBEEF markers immediately adjacent (IIRC). 
> We should probably look at the ABI and make sure that what we
> do with the stack for checking is legal.

Well if there's a problem it's with the HAL. HAL_THREAD_INIT_CONTEXT is called
_after_ all the padding is added, and it's that which should add any relevant
space. For the powerpc, it already leaves CYGARC_PPC_STACK_FRAME_SIZE which is a
whole 56 bytes (which looking at the eABI I saw, looks like overkill). However I
also note that area isn't initialized to anything. But then we'd see it without
the stack frame checking enabled either.

Comment 2 Alex Schuilenburg 2003-06-20 12:18:51 EDT
This bug has moved to http://bugs.ecos.sourceware.org/show_bug.cgi?id=84530

Note You need to log in before you can comment on or make changes to this bug.