gpt4 book ai didi

javascript - Google Chrome 崩溃内存泄漏或任何渲染问题

转载 作者:行者123 更新时间:2023-12-03 02:24:49 26 4
gpt4 key购买 nike

我们有一个在 Chrome 浏览器上运行的 SPA。使用应用程序一段时间后,它会间歇性崩溃。我收到了 Aw Snap 错误页面。

enter image description here

我在 Chrome 中启用了日志,并在日志文件中找到了以下信息。此外,即使在 Chrome 中启用转储文件设置后,Google Chrome 也不会生成转储文件。

Chrome 日志中的错误消息

[0226/100630:INFO:SkScalerContext.cpp(170)] --- no context for glyph 6f
[0226/100630:INFO:SkScalerContext.cpp(170)] --- no context for glyph b3
[0226/100630:INFO:SkScalerContext.cpp(170)] --- no context for glyph 11b
[0226/100630:INFO:SkScalerContext.cpp(170)] --- no context for glyph bf
[0226/100630:INFO:SkScalerContext.cpp(170)] --- no context for glyph 48
[0226/100630:INFO:SkScalerContext.cpp(170)] --- no context for glyph 46
[0226/100630:INFO:SkScalerContext.cpp(170)] --- no context for glyph 23
[0226/100630:INFO:SkCanvas.cpp(747)] Unable to create device for layer.
[0226/100630:INFO:SkCanvas.cpp(747)] Unable to create device for layer.
[0226/100630:INFO:SkCanvas.cpp(747)] Unable to create device for layer.

任何人都可以指出错误消息“无法为图层创 build 备。”“没有字形上下文”的含义以及可能是什么出现此错误消息的可能原因是什么?

由于使用该应用程序一段时间后发生崩溃,我怀疑内存泄漏。是否有可能是由于内存泄漏而发生错误?

编辑1:

随着 Javascript 内存的增加,似乎存在内存泄漏。此外,堆分配显示不断增加的内存并未被清除。然而,SPA 本身并不复杂,并且有很多对象,我将分析哪些对象正在阻止其他对象进行 GC。

此外,Chrome 还会在 CrashReports 文件夹中创建一个 0Kb 转储文件。

此外,我还使用 windbg 进行了进程转储并进行了分析。以下是 !analyze-v 命令的输出。我正在分析内存转储,从 Windbg 看来,似乎引发了访问冲突异常,并且似乎没有内存可用于分配位图。此转储信息是否还指向任何其他有用的信息?

FAULTING_IP: 
chrome_1490000!skia::CrashForBitmapAllocationFailure+70 [c:\b\build\slave\chrome-official\build\src\skia\ext\platform_canvas_win.cc @ 46]
01956d67 mov dword ptr ds:[3],0

EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 01956d67 (chrome_1490000!skia::CrashForBitmapAllocationFailure+0x00000070)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000001
Parameter[1]: 00000003
Attempt to write to address 00000003

PROCESS_NAME: chrome.exe

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.

EXCEPTION_PARAMETER1: 00000001

EXCEPTION_PARAMETER2: 00000003

WRITE_ADDRESS: 00000003

FOLLOWUP_IP:
chrome_1490000!skia::CrashForBitmapAllocationFailure+70 [c:\b\build\slave\chrome-official\build\src\skia\ext\platform_canvas_win.cc @ 46]
01956d67 mov dword ptr ds:[3],0

MOD_LIST: <ANALYSIS/>

NTGLOBALFLAG: 0

APPLICATION_VERIFIER_FLAGS: 0

FAULTING_THREAD: 00002fac

BUGCHECK_STR: APPLICATION_FAULT_NULL_CLASS_PTR_DEREFERENCE_INVALID_POINTER_WRITE

PRIMARY_PROBLEM_CLASS: NULL_CLASS_PTR_DEREFERENCE

DEFAULT_BUCKET_ID: NULL_CLASS_PTR_DEREFERENCE

LAST_CONTROL_TRANSFER: from 014ef4ed to 01956d67

STACK_TEXT:
003deb9c 014ef4ed 000004cc 000000d6 00000057 chrome_1490000!skia::CrashForBitmapAllocationFailure+0x70 [c:\b\build\slave\chrome-official\build\src\skia\ext\platform_canvas_win.cc @ 46]
003debc0 0160893b 000004cc 000000d6 00000001 chrome_1490000!skia::PlatformCanvas::initialize+0x97 [c:\b\build\slave\chrome-official\build\src\skia\ext\platform_canvas_win.cc @ 107]
003debe4 016086ef 000004cc 000000d6 003ded54 chrome_1490000!TransportDIB::GetPlatformCanvas+0x3f [c:\b\build\slave\chrome-official\build\src\ui\gfx\surface\transport_dib_win.cc @ 74]
003dec04 0160696b 035f4774 000000d6 003dedd8 chrome_1490000!RenderProcessImpl::GetDrawingCanvas+0x4d [c:\b\build\slave\chrome-official\build\src\content\renderer\render_process_impl.cc @ 169]
003ded80 01606488 035f4700 017ec98a 003def0c chrome_1490000!RenderWidget::DoDeferredUpdate+0x49b [c:\b\build\slave\chrome-official\build\src\content\renderer\render_widget.cc @ 843]
003ded88 017ec98a 003def0c 035f4700 03606ab8 chrome_1490000!RenderWidget::DoDeferredUpdateAndSendInputAck+0x8 [c:\b\build\slave\chrome-official\build\src\content\renderer\render_widget.cc @ 731]
003dedb4 017ec725 015d826f 1d660a04 035f4700 chrome_1490000!RenderWidget::OnUpdateRectAck+0xe1 [c:\b\build\slave\chrome-official\build\src\content\renderer\render_widget.cc @ 383]
003dedb8 015d826f 1d660a04 035f4700 035f4700 chrome_1490000!IPC::Message::Dispatch<RenderWidget,RenderWidget>+0x1a [c:\b\build\slave\chrome-official\build\src\ipc\ipc_message.h @ 138]
003def0c 015c10c8 1d660a04 1d660a04 1d660a04 chrome_1490000!RenderWidget::OnMessageReceived+0xb0 [c:\b\build\slave\chrome-official\build\src\content\renderer\render_widget.cc @ 201]
003df420 0154d34f 1d660a04 03613d84 0154d329 chrome_1490000!RenderViewImpl::OnMessageReceived+0x1381 [c:\b\build\slave\chrome-official\build\src\content\renderer\render_view_impl.cc @ 764]
003df42c 0154d329 1d660a04 0150aed5 1d660a04 chrome_1490000!MessageRouter::RouteMessage+0x23 [c:\b\build\slave\chrome-official\build\src\content\common\message_router.cc @ 47]
003df434 0150aed5 1d660a04 003df510 00000000 chrome_1490000!MessageRouter::OnMessageReceived+0x1b [c:\b\build\slave\chrome-official\build\src\content\common\message_router.cc @ 39]
003df490 014c39f0 1d660a04 00000002 014c0c8a chrome_1490000!ChildThread::OnMessageReceived+0x178 [c:\b\build\slave\chrome-official\build\src\content\common\child_thread.cc @ 201]
003df49c 014c0c8a 1d6609f0 00000000 1d6609f4 chrome_1490000!base::internal::Invoker<2,base::internal::BindState<base::internal::RunnableAdapter<void (__thiscall quota::QuotaManagerProxy::*)(GURL const &)>,void __cdecl(quota::QuotaManagerProxy *,GURL const &),void __cdecl(quota::QuotaManagerProxy *,GURL)>,void __cdecl(quota::QuotaManagerProxy *,GURL const &)>::Run+0x16 [c:\b\build\slave\chrome-official\build\src\base\bind_internal.h @ 1254]
003df4e8 014c0962 003df748 003df510 003df748 chrome_1490000!MessageLoop::RunTask+0x21e [c:\b\build\slave\chrome-official\build\src\base\message_loop.cc @ 460]
003df758 01493ffd 0a805c60 00000051 00000004 chrome_1490000!MessageLoop::DoWork+0x2d1 [c:\b\build\slave\chrome-official\build\src\base\message_loop.cc @ 661]
003df860 014a5d87 035f0780 035f0788 035f0788 chrome_1490000!tcmalloc::ThreadCache::Deallocate+0x2c [c:\b\build\slave\chrome-official\build\src\third_party\tcmalloc\chromium\src\thread_cache.h @ 346]
003df930 014a86c6 00000014 0000001f 03613d84 chrome_1490000!std::_Allocate<unsigned short>+0x71 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xmemory @ 44]
003df98c 014b03f0 00000000 00000008 00000000 chrome_1490000!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::compare+0x4b [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring @ 2051]
003df9a8 014b1fe4 003dfa20 003dfab0 00000000 chrome_1490000!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::compare+0x26 [c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring @ 2027]
003df9bc 014a54b4 003dfa78 003dfa20 003dfab0 chrome_1490000!`anonymous namespace'::RunNamedProcessTypeMain+0x42 [c:\b\build\slave\chrome-official\build\src\content\app\content_main.cc @ 264]
003dfa98 014a5244 01360000 003dfb98 003dfab0 chrome_1490000!content::ContentMain+0x224 [c:\b\build\slave\chrome-official\build\src\content\app\content_main.cc @ 457]
003dfacc 01385239 01360000 003dfb98 003dfba0 chrome_1490000!ChromeMain+0x1e [c:\b\build\slave\chrome-official\build\src\chrome\app\chrome_main.cc @ 28]
003dfb44 0138471d 01360000 003dfb98 fffffffe chrome!MainDllLoader::Launch+0xf1 [c:\b\build\slave\chrome-official\build\src\chrome\app\client_util.cc @ 343]
003dfba4 013a33ff 01360000 00000000 005e2fa4 chrome!wWinMain+0x60 [c:\b\build\slave\chrome-official\build\src\chrome\app\chrome_exe_main_win.cc @ 37]
003dfc34 76fb343d 7efde000 003dfc80 777f9832 chrome!__tmainCRTStartup+0x112 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 263]
003dfc40 777f9832 7efde000 77d58cd7 00000000 kernel32!BaseThreadInitThunk+0xe
003dfc80 777f9805 013a346a 7efde000 00000000 ntdll!__RtlUserThreadStart+0x70
003dfc98 00000000 013a346a 7efde000 00000000 ntdll!_RtlUserThreadStart+0x1b


STACK_COMMAND: ~0s; .ecxr ; kb

FAULTING_SOURCE_CODE:
No source found for 'c:\b\build\slave\chrome-official\build\src\skia\ext\platform_canvas_win.cc'


SYMBOL_STACK_INDEX: 0

SYMBOL_NAME: chrome!skia::CrashForBitmapAllocationFailure+70

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: chrome_1490000

IMAGE_NAME: chrome.dll

DEBUG_FLR_IMAGE_TIMESTAMP: 4f331615

FAILURE_BUCKET_ID: NULL_CLASS_PTR_DEREFERENCE_c0000005_chrome.dll!skia::CrashForBitmapAllocationFailure

BUCKET_ID: APPLICATION_FAULT_NULL_CLASS_PTR_DEREFERENCE_INVALID_POINTER_WRITE_chrome!skia::CrashForBitmapAllocationFailure+70

WATSON_STAGEONE_URL: http://watson.microsoft.com/StageOne/chrome_exe/18_0_1025_11/4f331682/chrome_dll/18_0_1025_11/4f331615/c0000005/004c6d67.htm?Retriage=1

Followup: MachineOwner
---------

注意:最新的 Chrome 和 Canary 版本中不会出现此错误。我们在旧版 Chrome(32 位)上遇到此错误。

最佳答案

考虑到它们在开头显示 INFO,您在日志文件中看到的消息可能不相关且不严重。

内存泄漏绝对可能是导致选项卡崩溃的原因。作为快速测试,您可以打开 Chrome 的进程管理器并检查相关选项卡的内存消耗是否随着时间的推移而增加。

一旦您确认存在内存泄漏,DevTools 就是您找出问题所在的最佳 friend 。两种通常有用的方法是:

  1. 拍摄一个堆快照,执行一些操作序列,之后内存消耗应该与开始之前相同(即导航到某处然后返回,等等),拍摄第二个堆快照,然后使用比较工具来比较它们。第二个快照中但第一个快照中没有的任何内容都可能会导致泄漏。

  2. 使用“分配时间线”功能。它指示对象何时被分配,以及哪些对象仍然存在。

如果您认为泄漏是在 Chrome 中而不是您自己的应用程序中,请在 crbug.com/new 提交错误并包含有关如何重现问题的说明。如果您在此处发布错误编号,我可以确保它得到查看。确定原因是否可能是您自己的应用程序或浏览器的快速测试是在另一个浏览器中运行它,看看您是否观察到相同的崩溃(和/或内存消耗增加)。

关于javascript - Google Chrome 崩溃内存泄漏或任何渲染问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48993223/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com