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

Core file generation doesn't work on macOS 12.6 ARM64 #3054

Open
XVilka opened this issue Sep 30, 2022 · 5 comments
Open

Core file generation doesn't work on macOS 12.6 ARM64 #3054

XVilka opened this issue Sep 30, 2022 · 5 comments

Comments

@XVilka
Copy link
Member

XVilka commented Sep 30, 2022

Work environment

Questions Answers
OS/arch/bits (mandatory) macOS 12.6 ARM64 (M1)
File format of the file you reverse (mandatory) MachO
Architecture/bits of the file (mandatory) ARMv8 64
rizin -v full output, not truncated (mandatory) rizin 0.5.0 @ darwin-arm-64
commit: 7c0bd7c

Expected behavior

rizin -d $(which rz-ax)
[0x1045d4560]> dg
WARNING: core: Writing to file 'core.93555'
[0x1045d4560]>

Core file should be written and be loadable in Rizin afterwards

Actual behavior

rizin -d $(which rz-ax)
[0x1045d4560]> dg
WARNING: core: Writing to file 'core.93555'
^C

Even doesn't work, only kill -9 <rizin pid>

Generate core file successfully, which can be loaded

It's implemented in "native" debugger plugin, see these places:

  • librz/debug/p/debug_native.c in rz_debug_gcore() function
  • librz/debug/p/native/xnu/xnu_debug.c in xnu_generate_corefile() function
@marcograss
Copy link
Contributor

OS/arch/bits (mandatory) macOS 12.6 x64
File format of the file you reverse (mandatory) MachO
Architecture/bits of the file (mandatory) x64
rizin -v full output, not truncated (mandatory) rizin 0.5.0 @ darwin-x86-64
commit: 7c0bd7c
rizin -d $(which rz-ax)
 -- Add comments using the ';' key in visual mode or the 'CC' command from the rizin shell
[0x115cd3ae0]> dg
WARNING: core: Writing to file 'core.48978'
^C[1]    48977 killed     rizin -d $(which rz-ax)

it's stuck had to kill it, the generated core file is empty 0 bytes.

@thestr4ng3r
Copy link
Member

Strange, it "works" for me on both x86 and arm64. (Meaning it writes out some broken mach-o file at least)
Could you please attach a debugger to it when it is stuck and paste a stacktrace?

@marcograss
Copy link
Contributor

Do you have system integrity protection disabled?

@thestr4ng3r
Copy link
Member

thestr4ng3r commented Oct 1, 2022

Good point, yes it is currently disabled here at least on the arm64 machine.

Though this does not seem to be the relevant point here, after enabling it still goes through:
Bildschirmfoto 2022-10-01 um 10 11 37

@marcograss
Copy link
Contributor

I just tried another x64 machine on 12.6, it doesn't work there also, on commit 1ed4a3a

@XVilka XVilka added this to the 0.7.0 milestone Jun 15, 2023
@XVilka XVilka modified the milestones: 0.7.0, 0.8.0 Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants