I used gdb generate-core-file to generate a core file for a process (mongod), but the process mmap many data files and the Res of this process is up to 36.1G.
after the core file consumed 34G space, no more space are available on disk, so I got:
warning: writing note section (No space left on device) Saved corefile core.12038
I want to know if all the mmap data will be dump to core file? What can I do if I only want to see some local variables?
background: we had an issue on production, and the binary on production don't have symbol info in it. so I want to generate core file and do some analyse offline.
Usually the kernel only dumps writable mmaps, but not read-only ones. However, this is configurable: see core(5) man page (the "Controlling which mappings are written to the core dump" part).
The "standard" approach is to debug such binaries remotely with
gdbserver
and connect to it withgdb
that does have access to full-debug binary.