[
https://issues.apache.org/jira/browse/IMPALA-13472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18022928#comment-18022928
]
Joe McDonnell commented on IMPALA-13472:
----------------------------------------
Native-toolchain commit:
{noformat}
commit 7bb9bf4df2f8d1acdfb64e226fb5e2b38dc89921
Author: Joe McDonnell <[email protected]>
Date: Wed Sep 17 18:38:34 2025 -0700 IMPALA-13472: Patch breakpad to fix
minidump stacks for 64KB pages
When resolving minidumps from Redhat8 ARM machines, we found
that the stack traces were truncated, with only the top frame
available. The minidump_stackwalk output included this error
message:
minidump.cc:1391: INFO: MinidumpMemoryRegion request out of range:
0xfffee0aadf30+8/0xfffee0aa0000+0x8000
stackwalker_arm64.cc:dc: ERROR: Unable to read caller_fp from last_fp:
0xfffee0aadf30
The 0x8000 is 32KB, so the minidump contains 32KB of stack, but
that 32KB doesn't cover the memory pointed to by the stack pointer
register.
This is due to this logic in Breakpad's LinuxDumper::GetStackInfo():
// Move the stack pointer to the bottom of the page that it's in.
const uintptr_t page_size = getpagesize();
uint8_t* const stack_pointer =
reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
When Breakpad moves the stack pointer to the bottom of the page,
it is including unused stack memory (as the stack is top to bottom).
With a 64KB page size, since it only copies 32KB of the stack memory,
this memory usually doesn't contain any used stack memory. This
lines up with the observations from trying to process the minidump.
It is unclear why Breakpad moves the stack pointer to the bottom
of the page to include unused stack memory. There is a 128 byte
red zone on x86_64 which leaf functions can use without changing
the stack pointer, but that does not require the whole page (and
the rounding logic would not include it when near the boundary).
This changes the logic to explicitly include the 128 byte red
zone (respecting the boundary of the memory region). It then
rounds off the stack pointer to a 1KB boundary rather than a
whole OS page. This may not be necessary, but it is mostly
harmless and can be optimized more later.
Testing:
- Linked Impala with the modified Breakpad, sent SIGUSR1 to produce
a minidump, then resolved the minidump. ARM64 with 64KB pages
produces stack traces. x86_64 also continues to work.
Change-Id: Iaf19523e69628e78071636292b3cf464a7b626b8
Reviewed-on: http://gerrit.cloudera.org:8080/23443
Reviewed-by: Michael Smith <[email protected]>
Tested-by: Joe McDonnell <[email protected]>{noformat}
> Minidumps on ARM don't give the stack on Redhat8
> ------------------------------------------------
>
> Key: IMPALA-13472
> URL: https://issues.apache.org/jira/browse/IMPALA-13472
> Project: IMPALA
> Issue Type: Task
> Affects Versions: Impala 4.5.0
> Reporter: Fang-Yu Rao
> Assignee: zhangqianqiong
> Priority: Blocker
> Attachments: 75d667d8-3a76-4240-d95a63bd-01806ba9.dmp_dumpedv2,
> ce1d2431-ec45-4b30-8115d3a8-1c9b5e9e.dmp_dumpedv2,
> e85b9f26-2fd0-4beb-7823778e-cbed9c7b.dmp_dumpedv2
>
>
> Currently Minidumps for UBSAN on ARM don't give the stack as shown in
> [^e85b9f26-2fd0-4beb-7823778e-cbed9c7b.dmp_dumpedv2],
> [^ce1d2431-ec45-4b30-8115d3a8-1c9b5e9e.dmp_dumpedv2], and
> [^75d667d8-3a76-4240-d95a63bd-01806ba9.dmp_dumpedv2]. It would be good if the
> functions in each thread could be resolved.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]