This issue might appear if the dump is missing the segments with metadata.
Since kernel 2.6.23, the Linux-specific
/proc/[pid]/coredump_filter file can be used to control which
memory segments are written to the core dump file in the event
that a core dump is performed for the process with the
corresponding process ID.
See core man section "Controlling which mappings are written to the core dump" for more information.
In order to get a proper dump of the dotNet process coredump_filter should be set to at least 0x3f.
You can check what the current filter set for your process by executing:
cat /proc/<pid>/coredump_filter
To set the proper coredump_filter type:
echo "0x3f" > /proc/<pid>/coredump_filter
<pid> should be replaced with your process ID, for example:
echo "0x3f" > /proc/144/coredump_filter
UPDATE: May 10, 2023
I've managed to collect a full dump with all the necessary information by using createdump
utility:
createdump -u -f /tmp/coredump <pid>
The -u
option tells createdump
to generate a full memory dump, including all memory-mapped files. Note that this will result in a very large dump file for applications that use a lot of memory or have many memory-mapped files.
Example:
docker container exec -it \
-u root --privileged \
<container-id> \
/usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.16/createdump -u -f /tmp/coredump <pid>
docker cp <container-id>:/tmp/coredump .