MD_CONTEXT_CPU_MASK incorrect

32 views
Skip to first unread message

Ted Mielczarek

unread,
Aug 9, 2011, 2:37:50 PM8/9/11
to google-br...@googlegroups.com, Mark Mentovai
Apparently Breakpad's definition[1] of MD_CONTEXT_CPU_MASK is
incorrect. I was investigating a set of reports[2] where we seemed to
be missing an exception context from the minidump. Debugging showed
that the context_flags were 0x10005f. This is an x86_64 dump, so
MD_CONTEXT_AMD64= 0x00100000, and clearly there's a 0x5f stuck in
there as flags. Since our MD_CONTEXT_CPU_MASK = 0xffffffc0, we get
0x100040, which doesn't match the cpu type value. If I set
MD_CONTEXT_CPU_MASK = 0xffffff00 we can process the dump correctly,
but that's going to screw things up since MD_CONTEXT_ARM = 0x00000040.
I suppose we can invent a new value for ARM, since Microsoft is
clearly not honoring that one, but that will unfortunately break all
of my existing ARM dumps.

As an aside, I can't find what that 0x40 flag in context_flags is. The
WinNT.h I have in my Windows SDK 7.0 doesn't list any flag with that
value in the AMD64 section. There is this worrying bit in the i386
section:
#define CONTEXT_XSTATE (CONTEXT_i386 | 0x00000040L)
which would indicate that yes, they're using bits that low as flags.

Any thoughts?
-Ted

1. http://code.google.com/p/google-breakpad/source/browse/trunk/src/google_breakpad/common/minidump_format.h#105
2. https://bugzilla.mozilla.org/show_bug.cgi?id=677580

Ted Mielczarek

unread,
Aug 30, 2011, 11:44:15 AM8/30/11
to google-br...@googlegroups.com, Mark Mentovai
On Tue, Aug 9, 2011 at 2:37 PM, Ted Mielczarek <t...@mielczarek.org> wrote:
> As an aside, I can't find what that 0x40 flag in context_flags is. The
> WinNT.h I have in my Windows SDK 7.0 doesn't list any flag with that
> value in the AMD64 section. There is this worrying bit in the i386
> section:
> #define CONTEXT_XSTATE          (CONTEXT_i386 | 0x00000040L)
> which would indicate that yes, they're using bits that low as flags.

Just for reference, 0x40 is the XSTATE flag on both architectures
(it's support for Intel AVX):
http://msdn.microsoft.com/en-us/library/hh134240%28v=vs.85%29.aspx

-Ted

Reply all
Reply to author
Forward
0 new messages