Skip to content

Unmanaged crash in CefSharp #5068

Description

@demirkaric

Is there an existing issue for this?

  • I have searched both open/closed issues, no issue already exists.

CefSharp Version

133.4.21

Operating System

Windows 10

Architecture

x86

.Net Version

Net 4.8.1

Implementation

WinForms

Reproduction Steps

Description

I have a C# WinForms email client that uses CefSharp as a browser to render emails from a Roundcube Webmail interface.

The application crashes when a user opens a specific email containing a PDF attachment or embedded PDF. The error logged is:
Render process terminated. Status: ProcessCrashed, ErrorCode: -1073741571 ErrorMessage: STATUS_STACK_OVERFLOW

Other emails open fine, including those with different types of attachments. This issue occurs only with emails from one specific sender that include a PDF file.

Observed Debugging Behavior

  • Attached a debugger to CefSharp.BrowserSubprocess.exe.

  • The crash occurs inside SubProcess.h in the Run() method at this line:

    return CefExecuteProcess(cefMainArgs, (CefApp*)_cefApp.get(), nullptr);
    

The issue only affects certain emails with PDF attachments.
Other emails, including those with different attachments, open without issues.

I have attached cefsharp log in actual behavior.

Expected behavior

The email should load normally, without crashing the application.

Actual behavior

The application crashes with a stack overflow when opening a specific email containing a PDF.

[2084:23268:0314/110129.460:VERBOSE1:script_context.cc(149)] Created context:
extension id: (none)
frame: 0x9d36b00
URL:
context_type: WEB_PAGE
effective extension id: (none)
effective context type: WEB_PAGE
[2084:23268:0314/110129.460:VERBOSE1:script_context.cc(149)] Created context:
extension id: (none)
frame: (nil)
URL:
context_type: UNSPECIFIED
effective extension id: (none)
effective context type: UNSPECIFIED
[2084:23268:0314/110129.460:VERBOSE1:dispatcher.cc(541)] Num tracked contexts: 3
[37676:32188:0314/110129.461:VERBOSE1:browser_info_manager.cc(587)] frame 5-0408F23F68B22D0F088A56A158BB8807, pdf_process=0, browser_process_guest=0, print_preview_dialog=0, main=0
[2084:23268:0314/110129.461:VERBOSE1:script_context.cc(149)] Created context:
extension id: (none)
frame: 0x9d36b00
URL:
context_type: UNSPECIFIED
effective extension id: (none)
effective context type: UNSPECIFIED
[2084:23268:0314/110129.461:VERBOSE1:script_context.cc(149)] Created context:
extension id: (none)
frame: (nil)
URL:
context_type: UNSPECIFIED
effective extension id: (none)
effective context type: UNSPECIFIED
[2084:23268:0314/110129.461:VERBOSE1:dispatcher.cc(541)] Num tracked contexts: 4
[2084:23268:0314/110129.465:VERBOSE1:script_context.cc(149)] Created context:
extension id: (none)
frame: 0x9d36b00
URL:
context_type: UNSPECIFIED
effective extension id: (none)
effective context type: UNSPECIFIED
[2084:23268:0314/110129.465:VERBOSE1:script_context.cc(149)] Created context:
extension id: (none)
frame: (nil)
URL:
context_type: UNSPECIFIED
effective extension id: (none)
effective context type: UNSPECIFIED
[2084:23268:0314/110129.465:VERBOSE1:dispatcher.cc(541)] Num tracked contexts: 5
[20400:37172:0314/110129.470:VERBOSE1:network_delegate.cc(37)] NetworkDelegate::NotifyBeforeURLRequest: https://webmail.domain.com/?_task=addressbook&_action=photo&_email=email@domain.com&_error=1&_bgcolor=transparent
[20400:37172:0314/110129.471:VERBOSE1:network_delegate.cc(37)] NetworkDelegate::NotifyBeforeURLRequest: https://webmail.domain.com/?_task=mail&_action=get&_mbox=INBOX.Sent&_uid=114763&_token=P8gdOtevIUp0bzWUmrL2VleFG6VjYD5Z&_part=1.2.2&_embed=1&_mimeclass=image
[20400:37172:0314/110129.472:VERBOSE1:url_loader.cc(2111)] Will sniff content for mime type: https://webmail.domain.com/?_task=addressbook&_action=photo&_email=email@domain.com&_error=1&_bgcolor=transparent
[2084:23268:0314/110129.475:VERBOSE1:script_context.cc(162)] Destroyed context for extension
extension id:
effective extension id:
[2084:23268:0314/110129.475:VERBOSE1:script_context.cc(162)] Destroyed context for extension
extension id:
effective extension id:
[2084:23268:0314/110129.475:VERBOSE1:script_context.cc(162)] Destroyed context for extension
extension id:
effective extension id:
[2084:23268:0314/110129.475:VERBOSE1:script_context.cc(162)] Destroyed context for extension
extension id:
effective extension id:
[37676:32188:0314/110129.475:VERBOSE1:browser_info_manager.cc(587)] frame 5-0408F23F68B22D0F088A56A158BB8807, pdf_process=0, browser_process_guest=0, print_preview_dialog=0, main=0
[37676:32188:0314/110129.476:VERBOSE1:browser_info_manager.cc(587)] frame 5-0408F23F68B22D0F088A56A158BB8807, pdf_process=0, browser_process_guest=0, print_preview_dialog=0, main=0
[37676:32188:0314/110129.476:VERBOSE1:browser_info_manager.cc(587)] frame 5-0408F23F68B22D0F088A56A158BB8807, pdf_process=0, browser_process_guest=0, print_preview_dialog=0, main=0

Regression?

No response

Known Workarounds

No response

Does this problem also occur in the CEF Sample Application

Not Tested

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions