Skip to content

Commit a47d6cf

Browse files
committed
Add cvar for disabling NaCl crash dumps
No one has requested it that I know of, but it seems like there ought to be a cvar.
1 parent fd2f571 commit a47d6cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/engine/framework/CrashDump.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4646

4747
static Log::Logger crashDumpLogs("common.breakpad", "", Log::Level::NOTICE);
4848

49+
static Cvar::Cvar<bool> enableNaclCrashDump("vm.nacl.crashDump", "save NaCl crash dumps", Cvar::NONE, true);
50+
4951
namespace Sys {
5052

5153
static std::string CrashDumpPath() {
@@ -70,6 +72,10 @@ bool CreateCrashDumpPath() {
7072
// Records a crash dump sent from the VM in minidump format. This is the same
7173
// format that Breakpad uses, but nacl minidump does not require Breakpad to work.
7274
void NaclCrashDump(const std::vector<uint8_t>& dump, Str::StringRef vmName) {
75+
if (!enableNaclCrashDump.Get()) {
76+
Log::Notice("Discarding %s crash dump because NaCl crash dumps are disabled", vmName);
77+
return;
78+
}
7379
const size_t maxDumpSize = (512 + 64) * 1024; // from http://src.chromium.org/viewvc/native_client/trunk/src/native_client/src/untrusted/minidump_generator/minidump_generator.cc
7480
if(dump.size() > maxDumpSize) { // sanity check: shouldn't be bigger than the buffer in nacl
7581
crashDumpLogs.Warn("Ignoring NaCl crash dump request: size too large");

0 commit comments

Comments
 (0)