WebKit Bugzilla
Attachment 342090 Details for
Bug 186369
: Add logging around internalError(const URL&)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186369-20180606161248.patch (text/plain), 5.74 KB, created by
Keith Rollin
on 2018-06-06 16:12:48 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Keith Rollin
Created:
2018-06-06 16:12:48 PDT
Size:
5.74 KB
patch
obsolete
>Subversion Revision: 232479 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 81d2c51125e4eb892900d7390c1ca3cf2bd83317..d417775ad10fbfde2cff7f65118b7533f748cfed 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,20 @@ >+2018-06-06 Keith Rollin <krollin@apple.com> >+ >+ Add logging around internalError(const URL&) >+ https://bugs.webkit.org/show_bug.cgi?id=186369 >+ <rdar://problem/40872046> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ There are times when we receive bug reports where the user says that >+ they are simply shown a page saying an internal error occurred. To >+ help understand the circumstances of that error, add some logging to >+ internalError() in WebErrors.cpp. This logging logs at the Error level >+ that internalError() was called and then logs a backtrace. >+ >+ * wtf/Assertions.cpp: >+ * wtf/Assertions.h: >+ > 2018-05-31 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r232212. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 7a011b83751cae67a5a6b36e0bf0ea4437cf1d85..4a296a103b6699b1f59d9a8939490b7e45d58c38 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2018-06-06 Keith Rollin <krollin@apple.com> >+ >+ Add logging around internalError(const URL&) >+ https://bugs.webkit.org/show_bug.cgi?id=186369 >+ <rdar://problem/40872046> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ There are times when we receive bug reports where the user says that >+ they are simply shown a page saying an internal error occurred. To >+ help understand the circumstances of that error, add some logging to >+ internalError() in WebErrors.cpp. This logging logs at the Error level >+ that internalError() was called and then logs a backtrace. >+ >+ * Shared/WebErrors.cpp: >+ (WebKit::internalError): >+ > 2018-06-04 Wenson Hsieh <wenson_hsieh@apple.com> > > [WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag >diff --git a/Source/WTF/wtf/Assertions.cpp b/Source/WTF/wtf/Assertions.cpp >index 6573a209bc0af12c0209a27850e100e242709458..9528bf4565b1f3faa3e79f5eef32446e8baca7b0 100644 >--- a/Source/WTF/wtf/Assertions.cpp >+++ b/Source/WTF/wtf/Assertions.cpp >@@ -547,6 +547,24 @@ void WTFInitializeLogChannelStatesFromString(WTFLogChannel* channels[], size_t c > } > } > >+void WTFReleaseLogStackTrace(WTFLogChannel* channel) >+{ >+ auto stackTrace = WTF::StackTrace::captureStackTrace(30, 0); >+ if (stackTrace && stackTrace->stack()) { >+ auto stack = stackTrace->stack(); >+ for (int frameNumber = 1; frameNumber < stackTrace->size(); ++frameNumber) { >+ auto stackFrame = stack[frameNumber]; >+ auto demangled = WTF::StackTrace::demangle(stackFrame); >+ if (demangled && demangled->demangledName()) >+ os_log(channel->osLogChannel, "%-3d %p %{public}s", frameNumber, stackFrame, demangled->demangledName()); >+ else if (demangled && demangled->mangledName()) >+ os_log(channel->osLogChannel, "%-3d %p %{public}s", frameNumber, stackFrame, demangled->mangledName()); >+ else >+ os_log(channel->osLogChannel, "%-3d %p", frameNumber, stackFrame); >+ } >+ } >+} >+ > } // extern "C" > > #if OS(DARWIN) && (CPU(X86_64) || CPU(ARM64)) >diff --git a/Source/WTF/wtf/Assertions.h b/Source/WTF/wtf/Assertions.h >index 731a4e1d9b1b0d14297b99e497e59ef0059af8a5..70054b1a93af8a99e6802532df9fb130e47ef5c6 100644 >--- a/Source/WTF/wtf/Assertions.h >+++ b/Source/WTF/wtf/Assertions.h >@@ -200,6 +200,7 @@ WTF_EXPORT_PRIVATE bool WTFWillLogWithLevel(WTFLogChannel*, WTFLogLevel); > WTF_EXPORT_PRIVATE void WTFGetBacktrace(void** stack, int* size); > WTF_EXPORT_PRIVATE void WTFReportBacktrace(void); > WTF_EXPORT_PRIVATE void WTFPrintBacktrace(void** stack, int size); >+WTF_EXPORT_PRIVATE void WTFReleaseLogStackTrace(WTFLogChannel*); > > WTF_EXPORT_PRIVATE bool WTFIsDebuggerAttached(void); > >@@ -459,6 +460,8 @@ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashWithSecurityImplication(v > > #define RELEASE_LOG_WITH_LEVEL(channel, level, ...) ((void)0) > #define RELEASE_LOG_WITH_LEVEL_IF(isAllowed, channel, level, ...) do { if (isAllowed) RELEASE_LOG_WITH_LEVEL(channel, level, __VA_ARGS__); } while (0) >+ >+#define RELEASE_LOG_STACKTRACE(channel) ((void)0) > #else > #define RELEASE_LOG(channel, ...) os_log(LOG_CHANNEL(channel).osLogChannel, __VA_ARGS__) > #define RELEASE_LOG_ERROR(channel, ...) os_log_error(LOG_CHANNEL(channel).osLogChannel, __VA_ARGS__) >@@ -478,6 +481,8 @@ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashWithSecurityImplication(v > if ((isAllowed) && LOG_CHANNEL(channel).level >= (logLevel)) \ > os_log(LOG_CHANNEL(channel).osLogChannel, __VA_ARGS__); \ > } while (0) >+ >+#define RELEASE_LOG_STACKTRACE(channel) WTFReleaseLogStackTrace(&LOG_CHANNEL(channel)) > #endif > > >diff --git a/Source/WebKit/Shared/WebErrors.cpp b/Source/WebKit/Shared/WebErrors.cpp >index e22f3bd50e064c2826f5ef84e1b979e3a5187af5..8f15cd30c5c569b297d10ffd48c72dcca8791bdf 100644 >--- a/Source/WebKit/Shared/WebErrors.cpp >+++ b/Source/WebKit/Shared/WebErrors.cpp >@@ -29,6 +29,7 @@ > #include "WebErrors.h" > > #include "APIError.h" >+#include "Logging.h" > #include <WebCore/LocalizedStrings.h> > #include <WebCore/ResourceRequest.h> > #include <WebCore/ResourceResponse.h> >@@ -75,6 +76,9 @@ ResourceError pluginWillHandleLoadError(const ResourceResponse& response) > > ResourceError internalError(const URL& url) > { >+ RELEASE_LOG_ERROR(Loading, "Internal error called"); >+ RELEASE_LOG_STACKTRACE(Loading); >+ > return ResourceError(API::Error::webKitErrorDomain(), API::Error::General::Internal, url, WEB_UI_STRING("WebKit encountered an internal error", "WebKitErrorInternal description")); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186369
:
342090
|
342094