QWebView崩溃 “Qt5WebKitd.dll!WTFCrash() 行 345C++” 的解决

  今天使用 QWebView 来做个简易的浏览器,出现了几个崩溃的问题,我的 Qt 版本是最新的5.4.2,相信 5.3.2 或者更低版本也会出现这些问题。

  问题重现:

  1、QWebView::load(URL),当界面还没加载完的时候,双击此控件会出现崩溃;

  2、当 load() 过程中,界面出现垂直滚动条而又未完全加载完成的时间,使用鼠标滑轮或者直接拖动滚动条至最顶或者最底时出现崩溃(有些页面出现)。

  崩溃的堆栈如下:

Qt5WebKitd.dll!WTFCrash() 行 345C++ Qt5WebKitd.dll!WebCore::NoExceptionAssertionChecker::~NoExceptionAssertionChecker() 行 48C++ Qt5WebKitd.dll!WebCore::Range::Range(WTF::PassRefPtr<WebCore::Document> ownerDocument, WTF::PassRefPtr<WebCore::Node> startContainer, int startOffset, WTF::PassRefPtr<WebCore::Node> endContainer, int endOffset) 行 96C++ Qt5WebKitd.dll!WebCore::Range::create(WTF::PassRefPtr<WebCore::Document> ownerDocument, WTF::PassRefPtr<WebCore::Node> startContainer, int startOffset, WTF::PassRefPtr<WebCore::Node> endContainer, int endOffset) 行 101C++ Qt5WebKitd.dll!WebCore::SimplifiedBackwardsTextIterator::range() 行 1368C++ Qt5WebKitd.dll!WebCore::previousBoundary(const WebCore::VisiblePosition & c, unsigned int (const wchar_t *, unsigned int, unsigned int, WebCore::BoundarySearchContextAvailability, bool &) * searchFunction) 行 513C++ Qt5WebKitd.dll!WebCore::startOfWord(const WebCore::VisiblePosition & c, WebCore::EWordSide side) 行 639C++ Qt5WebKitd.dll!WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity(WebCore::TextGranularity granularity) 行 299C++ Qt5WebKitd.dll!WebCore::VisibleSelection::validate(WebCore::TextGranularity granularity) 行 418C++ Qt5WebKitd.dll!WebCore::VisibleSelection::expandUsingGranularity(WebCore::TextGranularity granularity) 行 198C++ Qt5WebKitd.dll!WebCore::EventHandler::selectClosestWordFromHitTestResult(const WebCore::HitTestResult & result, WebCore::AppendTrailingWhitespace appendTrailingWhitespace) 行 495C++ Qt5WebKitd.dll!WebCore::EventHandler::selectClosestWordFromMouseEvent(const WebCore::MouseEventWithHitTestResults & result) 行 508C++ Qt5WebKitd.dll!WebCore::EventHandler::handleMousePressEventDoubleClick(const WebCore::MouseEventWithHitTestResults & event) 行 543C++ Qt5WebKitd.dll!WebCore::EventHandler::handleMousePressEvent(const WebCore::MouseEventWithHitTestResults & event) 行 708C++ Qt5WebKitd.dll!WebCore::EventHandler::handleMousePressEvent(const WebCore::PlatformMouseEvent & mouseEvent) 行 1636C++ Qt5WebKitd.dll!QWebPageAdapter::mouseDoubleClickEvent(QMouseEvent * ev) 行 547C++ Qt5WebKitWidgetsd.dll!QWebPage::event(QEvent * ev) 行 2564C++ Qt5WebKitWidgetsd.dll!QWebView::mouseDoubleClickEvent(QMouseEvent * ev) 行 886C++ Qt5Widgetsd.dll!QWidget::event(QEvent * event) 行 8662C++ Qt5WebKitWidgetsd.dll!QWebView::event(QEvent * e) 行 734C++ Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) 行 3720C++ Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) 行 3280C++ Qt5Cored.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) 行 935C++>Qt5Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) 行 231C++ Qt5Widgetsd.dll!QApplicationPrivate::sendMouseEvent(QWidget * receiver, QMouseEvent * event, QWidget * alienWidget, QWidget * nativeWidget, QWidget * * buttonDown, QPointer<QWidget> & lastMouseReceiver, bool spontaneous) 行 2751C++ Qt5Widgetsd.dll!QWidgetWindow::handleMouseEvent(QMouseEvent * event) 行 543C++ Qt5Widgetsd.dll!QWidgetWindow::event(QEvent * event) 行 211C++ Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) 行 3720C++ Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) 行 3164C++ Qt5Cored.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) 行 935C++ Qt5Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) 行 231C++ Qt5Guid.dll!QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent * e) 行 1812C++ Qt5Guid.dll!QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent * e) 行 1573C++ Qt5Guid.dll!QWindowSystemInterface::sendWindowSystemEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) 行 572C++ qwindowsd.dll!QWindowsGuiEventDispatcher::sendPostedEvents() 行 82C++ Qt5Cored.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned int wp, long lp) 行 414C++ [外部代码] [下面的框架可能不正确和/或缺失,,没有为 user32.dll 加载符号] Qt5Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) 行 807C++ qwindowsd.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) 行 73C++ Qt5Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) 行 129C++ Qt5Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) 行 204C++ Qt5Cored.dll!QCoreApplication::exec() 行 1188C++ Qt5Guid.dll!QGuiApplication::exec() 行 1508C++ Qt5Widgetsd.dll!QApplication::exec() 行 2957C++ MiniBrowser.exe!main(int argc, char * * argv) 行 39C++ MiniBrowser.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) 行 113C++ [外部代码] Qt5WebKitd.dll!WTFCrash() 行 345C++ Qt5WebKitd.dll!WebCore::RenderLayer::updateLayerPositionsAfterScroll(WebCore::RenderGeometryMap * geometryMap, unsigned int flags) 行 812C++ Qt5WebKitd.dll!WebCore::RenderLayer::updateLayerPositionsAfterScroll(WebCore::RenderGeometryMap * geometryMap, unsigned int flags) 行 816C++ Qt5WebKitd.dll!WebCore::RenderLayer::updateLayerPositionsAfterScroll(WebCore::RenderGeometryMap * geometryMap, unsigned int flags) 行 816C++ Qt5WebKitd.dll!WebCore::RenderLayer::updateLayerPositionsAfterScroll(WebCore::RenderGeometryMap * geometryMap, unsigned int flags) 行 816C++ Qt5WebKitd.dll!WebCore::RenderLayer::updateLayerPositionsAfterScroll(WebCore::RenderGeometryMap * geometryMap, unsigned int flags) 行 816C++ Qt5WebKitd.dll!WebCore::RenderLayer::updateLayerPositionsAfterScroll(WebCore::RenderGeometryMap * geometryMap, unsigned int flags) 行 816C++ Qt5WebKitd.dll!WebCore::RenderLayer::updateLayerPositionsAfterDocumentScroll() 行 763C++ Qt5WebKitd.dll!WebCore::FrameView::repaintFixedElementsAfterScrolling() 行 2071C++ Qt5WebKitd.dll!WebCore::ScrollView::scrollTo(const WebCore::IntSize & newOffset) 行 398C++ Qt5WebKitd.dll!WebCore::FrameView::scrollTo(const WebCore::IntSize & newOffset) 行 3113C++ Qt5WebKitd.dll!WebCore::ScrollView::setScrollOffset(const WebCore::IntPoint & offset) 行 379C++ Qt5WebKitd.dll!WebCore::ScrollableArea::scrollPositionChanged(const WebCore::IntPoint & position) 行 147C++ Qt5WebKitd.dll!WebCore::ScrollableArea::setScrollOffsetFromAnimation(const WebCore::IntPoint & offset) 行 191C++ Qt5WebKitd.dll!WebCore::ScrollAnimator::notifyPositionChanged(const WebCore::FloatSize & delta) 行 143C++ Qt5WebKitd.dll!WebCore::ScrollAnimator::scroll(WebCore::ScrollbarOrientation orientation, WebCore::ScrollGranularity __formal, float step, float multiplier) 行 73C++ Qt5WebKitd.dll!WebCore::ScrollAnimator::handleWheelEvent(const WebCore::PlatformWheelEvent & e) 行 115C++ Qt5WebKitd.dll!WebCore::ScrollableArea::handleWheelEvent(const WebCore::PlatformWheelEvent & wheelEvent) 行 177C++ Qt5WebKitd.dll!WebCore::FrameView::wheelEvent(const WebCore::PlatformWheelEvent & wheelEvent) 行 4188C++ Qt5WebKitd.dll!WebCore::EventHandler::handleWheelEvent(const WebCore::PlatformWheelEvent & e) 行 2463C++ Qt5WebKitd.dll!QWebPageAdapter::wheelEvent(QWheelEvent * ev, int wheelScrollLines) 行 616C++ Qt5WebKitWidgetsd.dll!QWebPage::event(QEvent * ev) 行 2614C++ Qt5WebKitWidgetsd.dll!QWebView::wheelEvent(QWheelEvent * ev) 行 922C++ Qt5Widgetsd.dll!QWidget::event(QEvent * event) 行 8666C++ Qt5WebKitWidgetsd.dll!QWebView::event(QEvent * e) 行 734C++ Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) 行 3720C++ Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) 行 3339C++ Qt5Cored.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) 行 935C++>Qt5Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) 行 231C++ Qt5Widgetsd.dll!QWidgetWindow::handleWheelEvent(QWheelEvent * event) 行 715C++ Qt5Widgetsd.dll!QWidgetWindow::event(QEvent * event) 行 238C++ Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) 行 3720C++ Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) 行 3164C++ Qt5Cored.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) 行 935C++ Qt5Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) 行 231C++ Qt5Guid.dll!QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent * e) 行 1845C++ Qt5Guid.dll!QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent * e) 行 1576C++ Qt5Guid.dll!QWindowSystemInterface::sendWindowSystemEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) 行 572C++ qwindowsd.dll!QWindowsGuiEventDispatcher::sendPostedEvents() 行 82C++ Qt5Cored.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned int wp, long lp) 行 414C++ [外部代码] [下面的框架可能不正确和/或缺失,没有为 user32.dll 加载符号] Qt5Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) 行 807C++ qwindowsd.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) 行 73C++ Qt5Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) 行 129C++ Qt5Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) 行 204C++ Qt5Cored.dll!QCoreApplication::exec() 行 1188C++ Qt5Guid.dll!QGuiApplication::exec() 行 1508C++ Qt5Widgetsd.dll!QApplication::exec() 行 2957C++ MiniBrowser.exe!main(int argc, char * * argv) 行 39C++ MiniBrowser.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) 行 113C++ [外部代码]

  从以上可以看到,最后崩的地方都是:Qt5WebKitd.dll!WTFCrash() 行 345

  解决方法:

  load() 之前使用 hide() 隐藏控件,当 loadFinished(bool ok) 事件触发的时候才显示出来,就不会崩溃了。

  最后,广告时间,帮朋友推广网站:无忧仓库

版权声明:本文为博主原创文章,未经博主允许不得转载。

始终调整好自己观风景的心态,

QWebView崩溃 “Qt5WebKitd.dll!WTFCrash() 行 345C++” 的解决

相关文章:

你感兴趣的文章:

标签云: