Bug 826029 - Assertion in mozPoisonWriteMac due to Mac camera code trying to write a defaults file on exit | Assertion failure: ok, at ../../../xpcom/build/mozPoisonWriteMac.cpp:90. r=ehsan.

This commit is contained in:
Rafael Ávila de Espíndola 2013-01-04 10:27:41 -05:00
Родитель 47cf762c14
Коммит 9eb5cdb511
3 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -111,6 +111,7 @@ XRE_SetupDllBlocklistType XRE_SetupDllBlocklist;
XRE_TelemetryAccumulateType XRE_TelemetryAccumulate;
XRE_StartupTimelineRecordType XRE_StartupTimelineRecord;
XRE_mainType XRE_main;
XRE_DisableWritePoisoningType XRE_DisableWritePoisoning;
static const nsDynamicFunctionLoad kXULFuncs[] = {
{ "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath },
@ -122,6 +123,7 @@ static const nsDynamicFunctionLoad kXULFuncs[] = {
{ "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate },
{ "XRE_StartupTimelineRecord", (NSFuncPtr*) &XRE_StartupTimelineRecord },
{ "XRE_main", (NSFuncPtr*) &XRE_main },
{ "XRE_DisableWritePoisoning", (NSFuncPtr*) &XRE_DisableWritePoisoning },
{ nullptr, nullptr }
};
@ -387,5 +389,19 @@ int main(int argc, char* argv[])
}
XPCOMGlueShutdown();
#ifdef XP_MACOSX
// Allow writes again. While we would like to catch writes from static
// destructors to allow early exits to use _exit, we know that there is
// at least one such write that we don't control (see bug 826029). For
// now we enable writes again and early exits will have to use exit instead
// of _exit.
// Currently write poisoning is only available on OS X. Since on OS X we never
// unload XUL, it is safe to call this function after XPCOMGlueShutdown.
XRE_DisableWritePoisoning();
#endif
return result;
}

Просмотреть файл

@ -4080,6 +4080,11 @@ XRE_mainMetro(int argc, char* argv[], const nsXREAppData* aAppData)
void SetWindowsEnvironment(WindowsEnvironmentType aEnvID);
#endif // MOZ_METRO || !defined(XP_WIN)
void
XRE_DisableWritePoisoning(void) {
mozilla::DisableWritePoisoning();
}
int
XRE_main(int argc, char* argv[], const nsXREAppData* aAppData, uint32_t aFlags)
{

Просмотреть файл

@ -452,6 +452,8 @@ XRE_API(void,
XRE_API(void,
XRE_InitOmnijar, (nsIFile* greOmni,
nsIFile* appOmni))
XRE_API(void,
XRE_DisableWritePoisoning, (void))
#ifdef XP_WIN
/**