/usr/include/firefox/mozilla/IntentionalCrash.h is in firefox-dev 11.0+build1-0ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #include <string>
#include <sstream>
#include <stdlib.h>
#include <stdio.h>
#ifdef XP_WIN
#include <process.h>
#define getpid _getpid
#else
#include <unistd.h>
#endif
#ifndef mozilla_IntentionalCrash_h
#define mozilla_IntentionalCrash_h
namespace mozilla {
inline void
NoteIntentionalCrash(const char* processType)
{
char* f = getenv("XPCOM_MEM_BLOAT_LOG");
fprintf(stderr, "XPCOM_MEM_BLOAT_LOG: %s\n", f);
if (!f)
return;
std::string bloatLog(f);
bool hasExt = false;
if (bloatLog.size() >= 4 &&
0 == bloatLog.compare(bloatLog.size() - 4, 4, ".log", 4)) {
hasExt = true;
bloatLog.erase(bloatLog.size() - 4, 4);
}
std::ostringstream bloatName;
bloatName << bloatLog << "_" << processType << "_pid" << getpid();
if (hasExt)
bloatName << ".log";
fprintf(stderr, "Writing to log: %s\n", bloatName.str().c_str());
FILE* processfd = fopen(bloatName.str().c_str(), "a");
fprintf(processfd, "==> process %d will purposefully crash\n", getpid());
fclose(processfd);
}
} // namespace mozilla
#endif // mozilla_IntentionalCrash_h
|