Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: thread_read_stack: invalid frame pointer in sample



On Jan 15, 2008, at 12:52, James Walker wrote:

What does it mean when a sample (taken by Activity Monitor) has a slew of lines saying:

sample[222] thread_read_stack: invalid frame pointer: 00000136

While the ABI (application binary interface) recommends that the frame pointer register (e.g., %ebp on i386) contain the address of the current stack frame, it is not mandatory. A called routine is only required to save and restore the register. Otherwise, it is free to use the register for other purposes. Since there are so few registers on Intel processors, it is very tempting to use the frame pointer register for other things.


The stack frame is mostly needed only by meta-tools: debuggers, performance samplers, and so on. It might be needed for some things inside a program, such as exception handling. However, a called routine that wants to throw an exception could restore the register and then throw the exception. Debuggers, samplers, and similar tools may try to use the frame pointer register to unwind the stack, but they should be prepared to accept failure if it is not valid.

These messages are telling you the sampler encountered a frame pointer register being used for something else, so it cannot gather further information about that particular sample. The sampler should at least collect the program counter where this occurred, from which the executing routine can be determined.

GCC usually maintains the frame pointer register as a frame pointer but can be told not to with the -fomit-frame-pointer and -momit-leaf- frame-pointer options. High-performance routines may be compiled this way, since making the extra register available can reduce register spill. Routines in the Accelerate library commonly use the register for other purposes.

				— edp (Eric Postpischil)
				http://edp.org

Man is most nearly himself when he achieves the seriousness of a child at play. — Heraclitus

_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden
References: 
 >thread_read_stack: invalid frame pointer in sample (From: James Walker <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.