Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No backtrace info for x86_64 binary on AArch64 Windows 11 #82

Closed
cme opened this issue Dec 22, 2021 · 4 comments
Closed

No backtrace info for x86_64 binary on AArch64 Windows 11 #82

cme opened this issue Dec 22, 2021 · 4 comments

Comments

@cme
Copy link

cme commented Dec 22, 2021

I'm trying to get backtrace information for x86_64 executables on Windows, but the only Windows development environment I can really use to test this at the moment is Windows Insider Preview for AArch64 (running on an AArch64 Mac). It's an odd environment so there could be multiple reasons for this.

image

Some initial digging shows that libbacktrace is getting the same symbol addresses visible in objdump, but at run-time the function addresses are at higher memory locations.

Address space layout randomisation? x86 emulation?

@cme
Copy link
Author

cme commented Dec 22, 2021

Some further digging shows that the code at the higher addresses is indeed the same x86 code as the linked binary, at different page addresses, so it certainly looks like ASLR of some sort.

@BrettDong
Copy link

I tried adding -Wl,--disable-dynamicbase -Wl,--disable-high-entropy-va linker flags and then backtrace info returns normal:
image

So I guess it is ASLR.

wangliu-iscas pushed a commit to plctlab/patchwork-gcc that referenced this issue Dec 6, 2022
Any underflow which might happen, will be countered by an overflow in
dwarf.c.

Tested on x86_64-linux and i686-w64-mingw32.

-- >8 --

Fixes ianlancetaylor/libbacktrace#89 and
ianlancetaylor/libbacktrace#82.

	* pecoff.c (coff_add): Set the base_address of the module, to
	find the debug information on moved applications.

Signed-off-by: Björn Schäpers <bjoern@hazardy.de>
wangliu-iscas pushed a commit to plctlab/patchwork-gcc that referenced this issue Dec 6, 2022
Any underflow which might happen, will be countered by an overflow in
dwarf.c.

Tested on x86_64-linux and i686-w64-mingw32.

-- >8 --

Fixes ianlancetaylor/libbacktrace#89 and
ianlancetaylor/libbacktrace#82.

	* pecoff.c (coff_add): Set the base_address of the module, to
	find the debug information on moved applications.

Signed-off-by: Björn Schäpers <bjoern@hazardy.de>
@HazardyKnusperkeks
Copy link

I've created a patch series at https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608031.html which solves this issue.

wangliu-iscas pushed a commit to plctlab/patchwork-gcc that referenced this issue Jan 20, 2023
Any underflow which might happen, will be countered by an overflow in
dwarf.c.

Tested on x86_64-linux and i686-w64-mingw32.

-- >8 --

Fixes ianlancetaylor/libbacktrace#89 and
ianlancetaylor/libbacktrace#82.

	* pecoff.c (coff_add): Set the base_address of the module, to
	find the debug information on moved applications.

Signed-off-by: Björn Schäpers <bjoern@hazardy.de>
@ianlancetaylor
Copy link
Owner

The patch series was committed, so this should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants