Added mozilla-1158578-recursion-fix patch and update to 52.1.0

This commit is contained in:
Jan Horak 2017-05-02 10:55:03 +02:00
parent 8b090b664f
commit 8073cfb09d
2 changed files with 160 additions and 5 deletions

View File

@ -0,0 +1,147 @@
# vim: se ft=diff :
# HG changeset patch
# User Jan Horak <jhorak>
# Date 2017-04-26 02:36
# Parent 540cd06b1aea0bfa6f906b86393f5480914c01c2
Bug 1158578 - fix crash when compacting IMAP account. r=jorgk
diff --git a/mailnews/base/src/nsMsgFolderCompactor.cpp b/mailnews/base/src/nsMsgFolderCompactor.cpp
--- a/mailnews/base/src/nsMsgFolderCompactor.cpp
+++ b/mailnews/base/src/nsMsgFolderCompactor.cpp
@@ -31,16 +31,17 @@
#include "nsIMsgStatusFeedback.h"
#include "nsMsgBaseCID.h"
#include "nsIMsgFolderNotificationService.h"
#include "nsIMsgPluggableStore.h"
#include "nsMsgFolderCompactor.h"
#include <algorithm>
#include "nsIOutputStream.h"
#include "nsIInputStream.h"
+#include "nsPrintfCString.h"
//////////////////////////////////////////////////////////////////////////////
// nsFolderCompactState
//////////////////////////////////////////////////////////////////////////////
NS_IMPL_ISUPPORTS(nsFolderCompactState, nsIMsgFolderCompactor, nsIRequestObserver, nsIStreamListener, nsICopyMessageStreamListener, nsIUrlListener)
@@ -1096,16 +1097,24 @@ nsOfflineStoreCompactState::OnStopReques
// check for it specifically and don't terminate the compaction.
if (NS_FAILED(rv) && rv != NS_MSG_ERROR_MSG_NOT_OFFLINE)
goto done;
uri = do_QueryInterface(ctxt, &rv);
if (NS_FAILED(rv)) goto done;
rv = GetMessage(getter_AddRefs(msgHdr));
if (NS_FAILED(rv)) goto done;
+ // This is however an unexpected condition, so let's print a warning.
+ if (rv == NS_MSG_ERROR_MSG_NOT_OFFLINE) {
+ nsAutoCString spec;
+ uri->GetSpec(spec);
+ nsPrintfCString msg("Message expectedly not available offline: %s", spec.get());
+ NS_WARNING(msg.get());
+ }
+
if (msgHdr)
{
if (NS_SUCCEEDED(status))
{
msgHdr->SetMessageOffset(m_startOfNewMsg);
char storeToken[100];
PR_snprintf(storeToken, sizeof(storeToken), "%lld", m_startOfNewMsg);
msgHdr->SetStringProperty("storeToken", storeToken);
diff --git a/mailnews/imap/src/nsImapProtocol.cpp b/mailnews/imap/src/nsImapProtocol.cpp
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -9500,35 +9500,66 @@ nsresult nsImapMockChannel::ReadFromMemC
// Content is modified so return an error so we try to open it the
// old fashioned way.
rv = NS_ERROR_FAILURE;
}
return rv;
}
+class nsReadFromImapConnectionFailure : public mozilla::Runnable
+{
+public:
+ nsReadFromImapConnectionFailure(nsImapMockChannel *aChannel)
+ : mImapMockChannel(aChannel)
+ {}
+
+ NS_IMETHOD Run()
+ {
+ if (mImapMockChannel) {
+ mImapMockChannel->RunOnStopRequestFailure();
+ }
+ return NS_OK;
+ }
+private:
+ RefPtr<nsImapMockChannel> mImapMockChannel;
+};
+
+
+nsresult nsImapMockChannel::RunOnStopRequestFailure()
+{
+ if (m_channelListener) {
+ m_channelListener->OnStopRequest(this, m_channelContext,
+ NS_MSG_ERROR_MSG_NOT_OFFLINE);
+ }
+ return NS_OK;
+}
+
// the requested url isn't in any of our caches so create an imap connection
// to process it.
nsresult nsImapMockChannel::ReadFromImapConnection()
{
nsresult rv = NS_OK;
nsCOMPtr<nsIImapUrl> imapUrl = do_QueryInterface(m_url);
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(m_url);
bool localOnly = false;
imapUrl->GetLocalFetchOnly(&localOnly);
if (localOnly)
{
// This will cause an OnStartRunningUrl, and the subsequent close
// will then cause an OnStopRunningUrl with the cancel status.
NotifyStartEndReadFromCache(true);
Cancel(NS_MSG_ERROR_MSG_NOT_OFFLINE);
- if (m_channelListener)
- m_channelListener->OnStopRequest(this, m_channelContext,
- NS_MSG_ERROR_MSG_NOT_OFFLINE);
+
+ // Dispatch error notification, so ReadFromImapConnection() returns *before*
+ // the error is sent to the listener's OnStopRequest(). This avoids
+ // endless recursion where the caller relies on async execution.
+ nsCOMPtr<nsIRunnable> event = new nsReadFromImapConnectionFailure(this);
+ NS_DispatchToCurrentThread(event);
return NS_MSG_ERROR_MSG_NOT_OFFLINE;
}
nsCOMPtr <nsILoadGroup> loadGroup;
GetLoadGroup(getter_AddRefs(loadGroup));
if (!loadGroup) // if we don't have one, the url will snag one from the msg window...
mailnewsUrl->GetLoadGroup(getter_AddRefs(loadGroup));
diff --git a/mailnews/imap/src/nsImapProtocol.h b/mailnews/imap/src/nsImapProtocol.h
--- a/mailnews/imap/src/nsImapProtocol.h
+++ b/mailnews/imap/src/nsImapProtocol.h
@@ -714,16 +714,17 @@ public:
NS_DECL_NSIIMAPMOCKCHANNEL
NS_DECL_NSICHANNEL
NS_DECL_NSIREQUEST
NS_DECL_NSICACHEENTRYOPENCALLBACK
NS_DECL_NSITRANSPORTEVENTSINK
nsImapMockChannel();
static nsresult Create (const nsIID& iid, void **result);
+ nsresult RunOnStopRequestFailure();
protected:
virtual ~nsImapMockChannel();
nsCOMPtr <nsIURI> m_url;
nsCOMPtr<nsIURI> m_originalUrl;
nsCOMPtr<nsILoadGroup> m_loadGroup;
nsCOMPtr<nsILoadInfo> m_loadInfo;

View File

@ -63,13 +63,13 @@
%endif %endif
%define tb_version 45.6.0 %define tb_version 45.6.0
%define tarballdir thunderbird-52.0 %define tarballdir thunderbird-52.1.0
%define thunderbird_app_id \{3550f703-e582-4d05-9a08-453d09bdfdc6\} %define thunderbird_app_id \{3550f703-e582-4d05-9a08-453d09bdfdc6\}
# Bump one with each minor lightning release # Bump one with each minor lightning release
%define gdata_version 3.3 %define gdata_version 3.3
# BUMP VERSION THERE: # BUMP VERSION THERE:
%define gdata_version_internal 0.1 %define gdata_version_internal 0.2
%global gdata_extname %{_libdir}/mozilla/extensions/{3550f703-e582-4d05-9a08-453d09bdfdc6}/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc} %global gdata_extname %{_libdir}/mozilla/extensions/{3550f703-e582-4d05-9a08-453d09bdfdc6}/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}
# The tarball is pretty inconsistent with directory structure. # The tarball is pretty inconsistent with directory structure.
@ -91,14 +91,14 @@
Summary: Mozilla Thunderbird mail/newsgroup client Summary: Mozilla Thunderbird mail/newsgroup client
Name: thunderbird Name: thunderbird
Version: 52.0 Version: 52.1.0
Release: 2%{?dist} Release: 1%{?dist}
URL: http://www.mozilla.org/projects/thunderbird/ URL: http://www.mozilla.org/projects/thunderbird/
License: MPLv1.1 or GPLv2+ or LGPLv2+ License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Applications/Internet Group: Applications/Internet
Source0: ftp://ftp.mozilla.org/pub/thunderbird/releases/%{version}%{?pre_version}/source/thunderbird-%{version}%{?pre_version}.source.tar.xz Source0: ftp://ftp.mozilla.org/pub/thunderbird/releases/%{version}%{?pre_version}/source/thunderbird-%{version}%{?pre_version}.source.tar.xz
%if %{build_langpacks} %if %{build_langpacks}
Source1: thunderbird-langpacks-%{version}-20170404.tar.xz Source1: thunderbird-langpacks-%{version}-20170502.tar.xz
%endif %endif
# Locales for lightning # Locales for lightning
Source2: l10n-lightning-%{version}.tar.xz Source2: l10n-lightning-%{version}.tar.xz
@ -139,6 +139,9 @@ Patch400: rhbz-966424.patch
Patch403: rhbz-1400293-fix-mozilla-1324096.patch Patch403: rhbz-1400293-fix-mozilla-1324096.patch
# libvpx no longer has compat defines, use the current ones # libvpx no longer has compat defines, use the current ones
# Upstream patches
Patch500: mozilla-1158578-recursion-fix.patch
%if %{official_branding} %if %{official_branding}
# Required by Mozilla Corporation # Required by Mozilla Corporation
@ -274,6 +277,7 @@ cd ..
%patch305 -p1 -b .fix-dupes %patch305 -p1 -b .fix-dupes
%patch105 -p1 -b .bad-langs %patch105 -p1 -b .bad-langs
%patch200 -p1 -b .addons %patch200 -p1 -b .addons
%patch500 -p1 -b .1158578-recursion-fix
%if %{official_branding} %if %{official_branding}
@ -720,6 +724,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#=============================================================================== #===============================================================================
%changelog %changelog
* Tue May 2 2017 Jan Horak <jhorak@redhat.com> - 52.1.0-1
- Update to 52.1.0
- Added patch for rhbz#1442903 - crash when compacting folder
* Wed Apr 12 2017 Jan Horak <jhorak@redhat.com> - 52.0-2 * Wed Apr 12 2017 Jan Horak <jhorak@redhat.com> - 52.0-2
- Added fix for rhbz#1441601 - problems with TLS server certificates - Added fix for rhbz#1441601 - problems with TLS server certificates