Bug 876110 - Manually set fennec process ptraceable on non release builds. r=kats

This commit is contained in:
Mike Hommey 2013-05-28 09:44:57 +02:00
parent 5e525728fb
commit 052dbe5e55

View File

@ -27,6 +27,7 @@
#include "APKOpen.h"
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/prctl.h>
#include "Zip.h"
#include "sqlite3.h"
#include "SQLiteBridge.h"
@ -39,6 +40,20 @@
#define RUSAGE_THREAD 1
#endif
#ifndef RELEASE_BUILD
/* Official builds have the debuggable flag set to false, which disables
* the backtrace dumper from bionic. However, as it is useful for native
* crashes happening before the crash reporter is registered, re-enable
* it on non release builds (i.e. nightly and aurora).
* Using a constructor so that it is re-enabled as soon as libmozglue.so
* is loaded.
*/
__attribute__((constructor))
void make_dumpable() {
prctl(PR_SET_DUMPABLE, 1);
}
#endif
extern "C" {
/*
* To work around http://code.google.com/p/android/issues/detail?id=23203