[SERVER-15418] Signal to dump non-mapped memory Created: 26/Sep/14  Updated: 25/Jun/15  Resolved: 26/Sep/14

Status: Closed
Project: Core Server
Component/s: Diagnostics, Internal Code
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Critical - P2
Reporter: Charlie Page Assignee: Andy Schwerin
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:

 Description   

We need (Linux terminology is used in this ticket) a way to dump core that does not include the memory mapped files. This will become more critical as we move to better (and therefore complicated) algorithms where examining memory will yield information we cannot otherwise access and speed up the diagnostic process.

Having a core dump is the only way to have a historical record of a process state.

Currently this isn't possible as all signals are caught.

Having this internal to mongo such that development programs aren't installed would be ideal.



 Comments   
Comment by James Wahlin [ 26/Sep/14 ]

gcore and gdb don't respect /proc/PID/coredump_filter settings. They use the same underlying mechanism to dump memory and do not provide a way to skip dumping file-mapped memory space. (See https://sourceware.org/bugzilla/show_bug.cgi?id=16092)

Comment by Andy Schwerin [ 26/Sep/14 ]

OS tools exist for this purpose.

Comment by Matt Kangas [ 26/Sep/14 ]

It is possible today to trigger core dumps of MongoDB on Linux by running "gcore" or "gdb".

These dumps do not include memory mapped files by default. You can control this via /proc/PID/coredump_filter. For example, on my Ubuntu 12.04 box:

$ cat /proc/self/coredump_filter
00000023
 
           bit 0  Dump anonymous private mappings.
           bit 1  Dump anonymous shared mappings.
           bit 5 (since Linux 2.6.28)
                  Dump private huge pages.

Notably bits 2 and 3 are off, those control file-backed mappings. See "man core" for details.

Cross-platform, the story is more tricky Are you looking for something along the lines of Google Breakpad, which produces Windows-format minidumps on all supported platforms?

Generated at Thu Feb 08 03:37:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.