How to debug a segfault within DirectAdmin

If you get a message "A segmentation fault has occurred", this is a program error generally due to either incompatible binaries for your OS, or incorrect handling of data.

The first thing you should do is go to:
Admin Level -> Licenses/Updates
and check to ensure that the OS the binaries were compiled for match the OS you're using.

To debug it, the first thing you should do is check your:
/var/log/directadmin/error.log
to see what the problem is.  There will be a segfault message with a program location.

To further debug the error, mainly for reporting to us, you'd need to install "gdb" to debug the binary.
You'll also need to be able to reliably dulicate the segfault.

1) Login to DA normally, and go the page such that you're one click away from generating the segfault.

2) Login to ssh as root and type:

cd /usr/local/directadmin
killall -9 directadmin
gdb directadmin
run s

This will have loaded up a single process non-forked copy of DirectAdmin.  It only gets 1 call to it, then it will quit.

3) Go back to your "1 click away" browser, and submit the form to generate the segfault.  You'll probably not get any output which is fine.

4) Back to ssh again, gdb should have pointed out that the program sefaulted.  Type

bt full

to dump the memory for the programs location.  Copy/paste that entire output and send it to us.


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 9375