Backed out 2 changesets (bug 1837907) for causing xpcshell failures in marSuccessPartialWhileBackgroundTaskRunning.js. CLOSED TREE

Backed out changeset ff3a75dbd146 (bug 1837907)
Backed out changeset a78b3fba98aa (bug 1837907)
This commit is contained in:
Stanca Serban 2023-11-03 17:25:27 +02:00
parent c5bb7cea30
commit 65229558a0
3 changed files with 8 additions and 52 deletions

View File

@ -115,6 +115,7 @@ static struct sigaction SIGQUIT_oldact;
static struct sigaction SIGILL_oldact;
static struct sigaction SIGABRT_oldact;
static struct sigaction SIGSEGV_oldact;
static struct sigaction SIGTERM_oldact;
void nsProfileLock::FatalSignalHandler(int signo
# ifdef SA_SIGINFO
@ -147,6 +148,9 @@ void nsProfileLock::FatalSignalHandler(int signo
case SIGSEGV:
oldact = &SIGSEGV_oldact;
break;
case SIGTERM:
oldact = &SIGTERM_oldact;
break;
default:
MOZ_ASSERT_UNREACHABLE("bad signo");
break;
@ -383,6 +387,7 @@ nsresult nsProfileLock::LockWithSymlink(nsIFile* aLockFile,
CATCH_SIGNAL(SIGILL);
CATCH_SIGNAL(SIGABRT);
CATCH_SIGNAL(SIGSEGV);
CATCH_SIGNAL(SIGTERM);
# undef CATCH_SIGNAL
}

View File

@ -43,7 +43,6 @@ using mozilla::widget::ScreenHelperGTK;
using mozilla::widget::ScreenManager;
#define NOTIFY_TOKEN 0xFA
#define QUIT_TOKEN 0xFB
LazyLogModule gWidgetLog("Widget");
LazyLogModule gWidgetDragLog("WidgetDrag");
@ -55,8 +54,6 @@ LazyLogModule gClipboardLog("WidgetClipboard");
static GPollFunc sPollFunc;
nsAppShell* sAppShell = nullptr;
// Wrapper function to disable hang monitoring while waiting in poll().
static gint PollWrapper(GPollFD* aUfds, guint aNfsd, gint aTimeout) {
if (aTimeout == 0) {
@ -143,17 +140,9 @@ gboolean nsAppShell::EventProcessorCallback(GIOChannel* source,
unsigned char c;
Unused << read(self->mPipeFDs[0], &c, 1);
switch (c) {
case NOTIFY_TOKEN:
self->NativeEventCallback();
break;
case QUIT_TOKEN:
self->Exit();
break;
default:
NS_ASSERTION(false, "wrong token");
break;
}
NS_ASSERTION(c == (unsigned char)NOTIFY_TOKEN, "wrong token");
self->NativeEventCallback();
return TRUE;
}
@ -299,30 +288,6 @@ void nsAppShell::StopDBusListening() {
}
#endif
void nsAppShell::TermSignalHandler(int signo) {
if (signo != SIGTERM) {
NS_WARNING("Wrong signal!");
return;
}
sAppShell->ScheduleQuitEvent();
}
void nsAppShell::InstallTermSignalHandler() {
struct sigaction act = {}, oldact;
act.sa_handler = TermSignalHandler;
sigfillset(&act.sa_mask);
if (NS_WARN_IF(sigaction(SIGTERM, nullptr, &oldact) != 0)) {
return;
}
if (oldact.sa_handler != SIG_DFL) {
NS_WARNING("SIGTERM signal handler is already set?");
}
sigaction(SIGTERM, &act, nullptr);
sAppShell = this;
}
nsresult nsAppShell::Init() {
mozilla::hal::Init();
@ -433,10 +398,6 @@ nsresult nsAppShell::Init() {
mTag = g_source_attach(source, nullptr);
g_source_unref(source);
if (XRE_IsParentProcess() && !PR_GetEnv("MOZ_DISABLE_SIG_HANDLER")) {
InstallTermSignalHandler();
}
return nsBaseAppShell::Init();
failed:
close(mPipeFDs[0]);
@ -457,8 +418,3 @@ bool nsAppShell::ProcessNextNativeEvent(bool mayWait) {
bool didProcessEvent = g_main_context_iteration(nullptr, mayWait);
return didProcessEvent;
}
void nsAppShell::ScheduleQuitEvent() {
unsigned char buf[] = {QUIT_TOKEN};
Unused << write(mPipeFDs[1], buf, 1);
}

View File

@ -48,11 +48,6 @@ class nsAppShell : public nsBaseAppShell {
static gboolean EventProcessorCallback(GIOChannel* source,
GIOCondition condition, gpointer data);
void InstallTermSignalHandler();
static void TermSignalHandler(int signo);
void ScheduleQuitEvent();
int mPipeFDs[2];
unsigned mTag;