Debugger not working correctly on Aarch64 Linux
Closed this issue · 4 comments
Version and Platform (required):
- Binary Ninja Version: 4.1.5278-dev, 83324703
- OS: ubuntu
- OS Version: 22.04
- CPU Architecture: arm64
Internal binary major dine favor
.
I can set a breakpoint at DjiCore_SetSerialNumber
in gdb and quickly get to the function.
When I try to do this in BN it
- Stops in
_start
. - Starts to analyze the binary, even though I have the database open.
- Gets stuck in analysis for a while.
- Gives me the this screenshot. It's probably related to the function I want since I see a serial number in the debugger window
![Screenshot 2024-05-15 at 5 02 59 PM](https://private-user-images.githubusercontent.com/18791/330836436-344d9b4c-50f1-4ab7-8f64-5c0296f47c54.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU2NjE4NzksIm5iZiI6MTcyNTY2MTU3OSwicGF0aCI6Ii8xODc5MS8zMzA4MzY0MzYtMzQ0ZDliNGMtNTBmMS00YWI3LThmNjQtNWMwMjk2ZjQ3YzU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA2VDIyMjYxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRmMWYwYzBjMGMyNzE3ZWJmYWY1NWNjMDQxMDVkMjIyYzYxN2NkNjQ3ZmMxZDg5MTcwOWI5Y2JlMjJhYjg5MmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.j6gsVmoU96KfiTXKMDR9hkkuuFXjM13476l_Z7p_a-U)
- Gives me this when I try to continue
![Screenshot 2024-05-15 at 5 03 35 PM](https://private-user-images.githubusercontent.com/18791/330836911-01e980df-3309-48f1-b396-1f9808c92a2d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU2NjE4NzksIm5iZiI6MTcyNTY2MTU3OSwicGF0aCI6Ii8xODc5MS8zMzA4MzY5MTEtMDFlOTgwZGYtMzMwOS00OGYxLWIzOTYtMWY5ODA4YzkyYTJkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA2VDIyMjYxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAxOTA0MTQ5NWM4ZDdjMjM5ODk1YTNjZDM5YjQ2NDc0MjA1YWFjZmVjMGFmNWIyYzQ4OGVjYTE5YjQwMzdhYWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.vZZu7-t6RZJpyzuusbUzup7jE2Ta1uhKVmyO9WHnlWM)
- Sometimes gives me this afterwards
![Screenshot 2024-05-15 at 5 00 16 PM](https://private-user-images.githubusercontent.com/18791/330837072-96a6fe97-a3f7-46d7-979d-aea32b14d56f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU2NjE4NzksIm5iZiI6MTcyNTY2MTU3OSwicGF0aCI6Ii8xODc5MS8zMzA4MzcwNzItOTZhNmZlOTctYTNmNy00NmQ3LTk3OWQtYWVhMzJiMTRkNTZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA2VDIyMjYxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk3M2NhOTQ4OGQ4MzNhMzM5ZDI1ZmIxZmZiY2ZlZDE3ZGEwOGMyMTA0NTc5ODZjOGYxNWY2NTFjNmQyNzBlODMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.j8qeaFDJpGnFiFE8-nF7shBGkpbRcQx7wMFxaNjDz5Q)
-
Stops as if the binary being debugged exited with code 255 but I have to kill the binary in the terminal since it's still running.
-
Prints this to the log
[Default] Unknown system register 55303 @ 0xfffff7d59098: S3_3_c0_c0_7, using generic system register instead
There is not enough information to work on this issue. A few things that are actually expected (but it could be surprising to a user):
- The debugger creates a fresh binary view every time it debugs, so it is not unexpected when it needs to do some analysis. That said, the analysis should finish pretty fast.
- When the target stops at a location that is not originally in the database, e.g., in a library function, then the analysis can take significantly longer, since it needs to analyze a lot of new code
- The user needs to understand what has happened and where has the target stopped at. From the screenshot you send, I am not 100% sure but chances are the target has stopped at an unusual location, you will need to understand what has happened and why the debugger stops there. There are many possible reasons, e.g., exceptions, anti-debugging, or a bug in our debugger. Without further information, there is no way to understand what happened and see if it is a bug in our debugger
Internal binary major dine favor
, mea culpa.
Please try debugging it.
There's nothing fancy going on. No protection and no jumps to external libraries.
I have tested in an aarch64 Ubuntu 22.04 VM running on top of apple silicon. Everything seems to be working fine for me:
Screen.Recording.2024-05-29.at.1.01.52.PM.mov
Closing this for now -- the debugger passes our CI and unit test on arm64 Linux