Backed out changeset 8b5b058bf71f (bug 1270686) for crashes. r=backout on a CLOSED TREE

This commit is contained in:
Sebastian Hengst 2016-05-25 20:46:31 +02:00
parent 131c04194a
commit aeeebc9c3a
5 changed files with 4 additions and 68 deletions

View File

@ -17,13 +17,10 @@
#include <windows.h>
#include <winternl.h>
#include <io.h>
#define PSAPI_VERSION 1
#include <psapi.h>
#pragma warning( push )
#pragma warning( disable : 4275 4530 ) // See msvc-stl-wrapper.template.h
#include <map>
#include <vector>
#pragma warning( pop )
#include "nsAutoPtr.h"
@ -546,15 +543,11 @@ static wchar_t* lastslash(wchar_t* s, int len)
return nullptr;
}
#ifdef NIGHTLY_BUILD
static std::vector<DllLoadInfo> gDllLoadInfos;
static LoadCallBackFn gLoadInfoCallback;
#endif
static NTSTATUS NTAPI
patched_LdrLoadDll (PWCHAR filePath, PULONG flags, PUNICODE_STRING moduleFileName, PHANDLE handle)
{
// We have UCS2 (UTF16?), we want ASCII, but we also just want the filename portion
#define DLLNAME_MAX 128
char dllName[DLLNAME_MAX+1];
wchar_t *dll_part;
char *dot;
@ -742,40 +735,14 @@ continue_loading:
return STATUS_DLL_NOT_FOUND;
}
}
NTSTATUS ret = stub_LdrLoadDll(filePath, flags, moduleFileName, handle);
#if defined(NIGHTLY_BUILD) && !defined(_WIN64)
if (!ret) {
MODULEINFO moduleInfo;
if (GetModuleInformation(GetCurrentProcess(), *(HMODULE*)handle, &moduleInfo, sizeof(moduleInfo))) {
DllLoadInfo info;
strcpy(info.name, dllName);
info.lpBaseOfDll = moduleInfo.lpBaseOfDll;
info.SizeOfImage = moduleInfo.SizeOfImage;
if (gLoadInfoCallback) {
gLoadInfoCallback(info);
} else {
gDllLoadInfos.push_back(info);
}
}
}
#endif
return ret;
return stub_LdrLoadDll(filePath, flags, moduleFileName, handle);
}
WindowsDllInterceptor NtDllIntercept;
} // namespace
#ifdef NIGHTLY_BUILD
MFBT_API void
RegisterDllLoadCallback(LoadCallBackFn aCallback) {
gLoadInfoCallback = aCallback;
for (DllLoadInfo &info : gDllLoadInfos) {
aCallback(info);
}
}
#endif
MFBT_API void
DllBlocklist_Initialize()
{

View File

@ -34,17 +34,5 @@ class MOZ_RAII AutoSetXPCOMLoadOnMainThread
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};
#define DLLNAME_MAX 128
#ifdef NIGHTLY_BUILD
struct DllLoadInfo
{
char name[DLLNAME_MAX+1];
LPVOID lpBaseOfDll;
DWORD SizeOfImage;
};
typedef void (*LoadCallBackFn)(DllLoadInfo&);
MFBT_API void RegisterDllLoadCallback(LoadCallBackFn);
#endif // NIGHTLY_BUILD
#endif // defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
#endif // mozilla_windowsdllblocklist_h

View File

@ -52,7 +52,6 @@ if not CONFIG['JS_STANDALONE']:
]
DISABLE_STL_WRAPPING = True
OS_LIBS += [
'psapi',
'version',
]

View File

@ -1437,17 +1437,6 @@ ChildFilter(void* context)
return result;
}
#if defined(XP_WIN) && defined(NIGHTLY_BUILD)
static void DllLoadCallback(DllLoadInfo& info)
{
nsAutoCString note;
note.AppendPrintf("%s-%p-%x\n", info.name, info.lpBaseOfDll, info.SizeOfImage);
CrashReporter::AppendAppNotesToCrashReport(note);
}
#endif
nsresult SetExceptionHandler(nsIFile* aXREDirectory,
bool force/*=false*/)
{
@ -1685,10 +1674,6 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory,
mozalloc_set_oom_abort_handler(AnnotateOOMAllocationSize);
#if defined(XP_WIN) && defined(NIGHTLY_BUILD)
RegisterDllLoadCallback(DllLoadCallback);
#endif
return NS_OK;
}

View File

@ -45,10 +45,7 @@ function run_test()
function(mdump, extra) {
do_check_eq(extra.TestKey, "TestValue");
do_check_eq(extra["\u2665"], "\u{1F4A9}");
// we spam the crash dumps with dlls loading so temporarily disable
// this check on windows
if (!is_windows)
do_check_eq(extra.Notes, "JunkMoreJunk");
do_check_eq(extra.Notes, "JunkMoreJunk");
do_check_true(!("TelemetrySessionId" in extra));
});
}