Home > Software engineering >  Debug compiled binary without source code
Debug compiled binary without source code

Time:10-06

I am having issues with a certain compiled binary file that has to run as a health check for a certain container in a deployment pod. On AWS environment it runs as expected, but on premises the script fails with a vague error (it's no use even sharing it). I understand that perhaps the problem is in the kubernetes environment not being configured as expected by the script, but I do not know where exactly to look because I don't know what the script does and have no access to its source code.

I've read online about debugging utilities for linux, but none of them seem useful for this purpose, or I didn't understand how to use them properly. Is it possible to find which files are being accessed by the script? That would allow me to compare those files between the on-premises environment and the AWS env. and see what is different, so I can solve this problem.

CodePudding user response:

Solved, keeping this up for reference if anyone needs it in the future. You can list all files accessed by your program using strace /path/to/bin 2>&1 | grep openat. Very useful for debugging without source code.

  • Related