Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gdb debug remote core dump

I have a server written in C++ crashing in the production environment to which I have no direct access to. The crash generates a huge core dump ~34G which I cannot copy locally. I need to analyze the core dump but don't know how it can be done without copying it over. I tried running gdbserver on target but it doesn't take a core file as a parameter and seems only good for debugging running remote applications from a host machine. Is there a way this can be done?

like image 314
user1444800 Avatar asked Nov 12 '22 10:11

user1444800


1 Answers

I need to analyze the core dump but don't know how it can be done without copying it over.

You can't. You'll need to get the core dump to where you can run GDB.

I cannot ssh to the remote machine but can ask the sys admin to run something like gdbserver for me but he cannot analyze and debug the core file.

You don't need sysadmin to analyze anything. You just need to ask him to run a series of GDB commands, and send you the output. E.g.

where
thread apply all where
info registers
disas

... will get you a long way to understanding the problem, and will take your sysadmin less than 5 minutes.

I still will need to uncompress it to run it on gdb which I don't want to do on my local machine.

Also, talk to your manager. Your development setup is unreasonable. You have to be able to analyze production crashes locally, and that means you have to have access to a sufficiently beefy machine.

like image 171
Employed Russian Avatar answered Nov 15 '22 05:11

Employed Russian