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

[BUG] macos ventura arm64 segmentation fault on start #621

Open
0x-2a opened this issue Sep 19, 2023 · 10 comments
Open

[BUG] macos ventura arm64 segmentation fault on start #621

0x-2a opened this issue Sep 19, 2023 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@0x-2a
Copy link

0x-2a commented Sep 19, 2023

Describe the bug

Segfault on start on m1 macs running ventura

To Reproduce

Expected behavior

Runs without segfault

Screenshots

image

Info (please complete the following information):

  • btop++ version: 1.2.13
  • Binary: release download
  • Architecture: arm64
  • Platform: macos
  • (Linux) Kernel: 22.6.0
  • (OSX/FreeBSD) Os release version: Ventura 13.5.2
  • Terminal used: zsh
  • Font used: Andale Mono 12

Additional context

~/.config/btop/btop.log


2023/09/19 (10:11:44) | ===> btop++ v.1.2.13
2023/09/19 (10:11:44) | DEBUG: Starting in DEBUG mode!
2023/09/19 (10:11:44) | INFO: Logger set to DEBUG
2023/09/19 (10:11:44) | DEBUG: Using locale en_US.UTF-8
2023/09/19 (10:11:44) | INFO: Running on /dev/ttys002
2023/09/19 (10:11:44) | DEBUG: get_sensors(): show_coretemp=1 check_temp=1
2023/09/19 (10:11:44) | DEBUG: checking intel
2023/09/19 (10:11:44) | DEBUG: no intel sensors found

GDB Backtrace

If btop++ is crashing at start the following steps could be helpful:

(Extra helpful if compiled with make OPTFLAGS="-O0 -g")

  1. run (linux): gdb btop (macos): lldb btop
(lldb) target create "btop"
Current executable set to '/usr/local/bin/btop' (arm64).
(lldb) r
Process 57320 launched: '/usr/local/bin/btop' (arm64)
ERROR: Failed to get size of terminal!
Process 57320 exited with status = 1 (0x00000001) 
image

2... for backtracing I think I may need to disable SIP, let me know if it is needed

@0x-2a 0x-2a added the bug Something isn't working label Sep 19, 2023
@0x-2a 0x-2a changed the title [BUG] macos venture arm64 segmentation fault on start [BUG] macos ventura arm64 segmentation fault on start Sep 19, 2023
@imwints
Copy link
Contributor

imwints commented Sep 22, 2023

Debugging with LLDB doesn't work at all sadly and GDB doesn't support aarch64 as far as I know. Someone would probably need to printf-debug this

@antony-frolov
Copy link

Got the same issue on my m1 mac, installed as a nix package

@imwints
Copy link
Contributor

imwints commented Oct 14, 2023

Please provide a back trace of the error. LLDB works with this branch, see #627

@antony-frolov
Copy link

antony-frolov commented Oct 14, 2023

Not very familiar with it but did the same thing as the author of the issue

$ lldb btop                                                               ─╯
(lldb) target create "btop"
Current executable set to '/Users/lovanto/.nix-profile/bin/btop' (arm64).
(lldb) r
Process 60786 launched: '/Users/lovanto/.nix-profile/bin/btop' (arm64)
warning: (arm64) /nix/store/1b6i6r7gx86i8i9abax4j1qzsibcvmwx-btop-1.2.13/bin/btop(0x0000000100000000) address 0x0000000100000000 maps to more than one section: btop.__TEXT and btop.__TEXT
warning: (arm64) /nix/store/1b6i6r7gx86i8i9abax4j1qzsibcvmwx-btop-1.2.13/bin/btop(0x0000000100000000) address 0x00000001000ec000 maps to more than one section: btop.__DATA_CONST and btop.__DATA_CONST
warning: (arm64) /nix/store/1b6i6r7gx86i8i9abax4j1qzsibcvmwx-btop-1.2.13/bin/btop(0x0000000100000000) address 0x00000001000f0000 maps to more than one section: btop.__DATA and btop.__DATA
warning: (arm64) /nix/store/1b6i6r7gx86i8i9abax4j1qzsibcvmwx-btop-1.2.13/bin/btop(0x0000000100000000) address 0x0000000100000000 maps to more than one section: btop.__TEXT and btop.__TEXT
warning: (arm64) /nix/store/1b6i6r7gx86i8i9abax4j1qzsibcvmwx-btop-1.2.13/bin/btop(0x0000000100000000) address 0x00000001000ec000 maps to more than one section: btop.__DATA_CONST and btop.__DATA_CONST
warning: (arm64) /nix/store/1b6i6r7gx86i8i9abax4j1qzsibcvmwx-btop-1.2.13/bin/btop(0x0000000100000000) address 0x00000001000f0000 maps to more than one section: btop.__DATA and btop.__DATA
ERROR: Failed to get size of terminal!
Process 60786 exited with status = 1 (0x00000001)

@imwints
Copy link
Contributor

imwints commented Oct 14, 2023

LLDB is currently not able to debug your btop binary. You need to compile btop from source, especially from this branch, and then use the resulting binary to produce a back trace

@antony-frolov
Copy link

antony-frolov commented Oct 15, 2023

Using the branch provided i get this (also i'm running macos sonoma, not ventura)

$ lldb bin/btop                                                                                                                                   ─╯
(lldb) target create "bin/btop"
Current executable set to '/tmp/btop/bin/btop' (arm64).
(lldb) r
Process 56395 launched: '/tmp/btop/bin/btop' (arm64)
ERROR: Failed to get size of terminal!
Process 56395 exited with status = 1 (0x00000001)

@imwints
Copy link
Contributor

imwints commented Oct 16, 2023

That is odd. Can you also include your btop.log contents?

@antony-frolov
Copy link

Sorry for the delay, here's my btop.log

2023/10/23 (22:50:41) | ===> btop++ v.1.2.13
2023/10/23 (22:50:41) | WARNING: No UTF-8 locale detected! Some symbols might not display correctly.
2023/10/23 (22:50:43) | ERROR: Failed to get size of terminal!

@imwints
Copy link
Contributor

imwints commented Nov 22, 2023

That doesn't seem like you've compiled the right branch. The logs don't match. Did you git checkout lldb-term-size ?

@antony-frolov
Copy link

antony-frolov commented Nov 22, 2023

Yes, right, my bad. Here's what it looks like
Screenshot 2023-11-22 at 23 58 01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants