Debug compiled binary without source code

9/26/2021

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.

-- xtda4664
amazon-eks
binaryfiles
debugging
kubernetes

1 Answer

9/26/2021

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.

-- xtda4664
Source: StackOverflow