CefSharp.Cef.Shutdown is crashing PowerPoint 2013

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

CefSharp.Cef.Shutdown is crashing PowerPoint 2013

Postby jozefizso » Mon Jan 25, 2021 3:11 pm

We are using CefSharp in our add-in for Microsoft PowerPoint. When the PowerPoint is shutdown, it will call the DTExtensibility2.OnDisconnection() method. In our implementation of this method we call the Cef.Shutdown(). This call happens on the main UI thread. It may crash the PowerPoint process.

We discovered this issue on this system:
Windows 7 Service Pack 1 32-bit
MS PowerPoint 2013 32-bit (15.0.5301.1000)
CefSharp v86.0.241

Gist with details and a full MHT analysis from DebugDiag is here: https://gist.github.com/jozefizso/01b85 ... 0753317432

This is the .NET callstack:

Code: Select all
CefSharp.Cef.Shutdown()+1a8
[[InlinedCallFrame] (.CefShutdown)] .CefShutdown()
Slido.PowerPoint.Addin.ConnectClass_OnDisconnection(NetOffice.Tools.ext_DisconnectMode, System.Array ByRef)+23
NetOffice.PowerPointApi.Tools.COMAddin.RaiseOnDisconnection(NetOffice.Tools.ext_DisconnectMode, System.Array ByRef)+2c
NetOffice.PowerPointApi.Tools.COMAddin.NetOffice.Tools.Native.IDTExtensibility2.OnDisconnection(NetOffice.Tools.ext_DisconnectMode, System.Array ByRef)+27
DomainBoundILStubClass.IL_STUB_COMtoCLR(Int32, IntPtr)+6e
[[ComMethodFrame]]


Full callstack on Thread 0 (main UI thread):

Code: Select all
MSO!Ordinal8254+25bd
kernel32!WaitForSingleObjectExImplementation+75
kernel32!WaitForSingleObject+12
libcef!cef_string_utf16_to_upper+8aa38
libcef!IsSandboxedProcess+397fdb
libcef!IsSandboxedProcess+3974e3
libcef!IsSandboxedProcess+3973c0
libcef!cef_string_multimap_size+1d00e71
libcef!cef_string_multimap_size+1d00db2
CefSharp.Cef.Shutdown()+1a8
Slido.PowerPoint.Addin.ConnectClass_OnDisconnection(NetOffice.Tools.ext_DisconnectMode, System.Array ByRef)+23
...


DebugDiag reports the thread 23 has an unhandled exception:

Code: Select all
Entry point: libcef!cef_string_utf16_to_upper+8ab50

KERNELBASE!RaiseException+58
MSO!MsoCrashMainThread+197
PPCORE!Osf::OSFCreateOsfOartGallery+243ae3
MSO!Ordinal8254+2763
kernel32!UnhandledExceptionFilter+127
ntdll!__RtlUserThreadStart+62
ntdll!_EH4_CallFilterFunc+12
ntdll!_except_handler4+8e
ntdll!ExecuteHandler2+26
ntdll!ExecuteHandler+24
ntdll!RtlDispatchException+127
ntdll!KiUserExceptionDispatcher+f
libcef!cef_string_multimap_size+1cfa053
libcef!VR_GetStringForHmdError+2d89b4
user32!InternalCallWinProc+23
user32!UserCallWinProcCheckWow+e0
user32!DispatchClientMessage+cf
user32!__fnNCDESTROY+26
ntdll!KiUserCallbackDispatcher+2e
user32!NtUserPeekMessage+c
user32!_PeekMessage+73
user32!PeekMessageW+fb
libcef!cef_string_utf16_to_upper+85401
libcef!cef_string_utf16_to_upper+85214
libcef!cef_string_utf16_to_upper+849a3
libcef!cef_time_delta+36a11
libcef!cef_string_utf16_to_upper+4a0f6
libcef!IsSandboxedProcess+3975ce
libcef!IsSandboxedProcess+398276
libcef!cef_string_utf16_to_upper+8abfd
kernel32!BaseThreadInitThunk+e
ntdll!__RtlUserThreadStart+70
ntdll!_RtlUserThreadStart+1b


Can we avoid this type of exception in libcef.dll?
Is this a bug which needs to be reported to Chromium Embedded Framework project?

Thanks a lot for your advise and insights.
jozefizso
Newbie
 
Posts: 4
Joined: Mon Jan 25, 2021 2:49 pm

Re: CefSharp.Cef.Shutdown is crashing PowerPoint 2013

Postby amaitland » Tue Jan 26, 2021 10:50 pm

Have you checked the log file? See https://github.com/cefsharp/CefSharp/wi ... g#log-file
(You probably need to specify a log path to somewhere user writable in your scenario)

Are you seeing the problem on other versions of Windows or specifically Windows 7 32bit?

The dump doesn't really have anything meaningful, did you download libcef.dll.pdb and place it next to libcef.dll? You need a release version of the pdb.

You can download the matching version from https://cef-builds.spotifycdn.com/cef_b ... ls.tar.bz2 if you haven't already.
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 956
Joined: Wed Jan 14, 2015 2:35 am

Re: CefSharp.Cef.Shutdown is crashing PowerPoint 2013

Postby jozefizso » Wed Feb 03, 2021 12:39 pm

I tried to delete the cache folder but the crash is still occurring.

I used the DebugDiag to capture PowerPoint crash and when I ran the analysis it says libcef.dll has caused an access violation exception (0xC0000005) when trying to write to memory location 0x00000134.
Should this be reported to Chromium project?

Code: Select all
LIBCEF!CEF_STRING_MULTIMAP_SIZE+1CFA053 WARNING - DebugDiag was not able to locate debug symbols for \libcef.dll, so the information below may be incomplete.

In POWERPNT__PID__3524__Date__02_03_2021__Time_05_58_41PM__682__Second_Chance_Exception_C0000005.dmp the assembly instruction at libcef!cef_string_multimap_size+1cfa053 in C:\Users\jozef\AppData\Local\Slido\Slido for Windows\x86\libcef.dll has caused an access violation exception (0xC0000005) when trying to write to memory location 0x00000134 on thread 22


Module information

Code: Select all
Image Name: C:\Users\jozef\AppData\Local\Slido\Slido for Windows\x86\libcef.dll
Symbol Type:  Export
Time Stamp:  Wed Nov 11 02:08:56 2020 
Comments:   
Company Name:   
File Description:  Chromium Embedded Framework (CEF) Dynamic Link Library
File Version:  86.0.24+g85e79d4+chromium-86.0.4240.198
Internal Name:  libcef
Legal Copyright:  Copyright (C) 2020 The Chromium Embedded Framework Authors
Legal Trademarks:   
Original filename:  libcef.dll
Private Build:   
Product Name:  Chromium Embedded Framework (CEF) Dynamic Link Library
Product Version:  86.0.24+g85e79d4+chromium-86.0.4240.198
Special Build:  &
Base address: 0x00785a4d
Checksum: 0x00000000
COM DLL: False
ISAPIExtension: False
ISAPIFilter: False
Managed DLL: False
VB DLL: False
Loaded Image Name:  libcef.dll
Mapped Image Name:
Module name:  libcef
Single Threaded:  False
Module Size:  113,51 MBytes
Symbol File Name:  libcef.dll


Image
jozefizso
Newbie
 
Posts: 4
Joined: Mon Jan 25, 2021 2:49 pm

Re: CefSharp.Cef.Shutdown is crashing PowerPoint 2013

Postby jozefizso » Wed Feb 03, 2021 12:57 pm

Are you seeing the problem on other versions of Windows or specifically Windows 7 32bit?

No, so far this issue is happing on this one machine only.

The dump doesn't really have anything meaningful, did you download libcef.dll.pdb and place it next to libcef.dll? You need a release version of the pdb.

I used the libcdef.dll.pdb from the cef_binary_86.0.24+g85e79d4+chromium-86.0.4240.198_windows32_release_symbols.tar.bz2 archive.
jozefizso
Newbie
 
Posts: 4
Joined: Mon Jan 25, 2021 2:49 pm

Re: CefSharp.Cef.Shutdown is crashing PowerPoint 2013

Postby jozefizso » Wed Feb 03, 2021 1:45 pm

I upgraded the CefSharp package to v87 and the crash does not happen anymore.
jozefizso
Newbie
 
Posts: 4
Joined: Mon Jan 25, 2021 2:49 pm


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron