Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when CEF window is Invoked in Net8 WPF C# #5029

Open
1 task done
mojiwa opened this issue Jan 10, 2025 · 3 comments
Open
1 task done

Crash when CEF window is Invoked in Net8 WPF C# #5029

mojiwa opened this issue Jan 10, 2025 · 3 comments
Labels
more-details-needed-from-op unable-to-reproduce The problem could not be reproduced by developers

Comments

@mojiwa
Copy link

mojiwa commented Jan 10, 2025

Is there an existing issue for this?

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

CefSharp Version

131.3.10

Operating System

Windows 11

Architecture

x64

.Net Version

Net 8.0

Implementation

WPF

Reproduction Steps

Implemented a CEF window in a C# NET8 WPF application.
When the CEF window is invoked the application crashes.
This didn't happen in the prior version (131.2.70) but happens from 131.3.10 onwards (I've also tried in 131.3.50).
I've looked through the release notes but cannot see anything that might explain this - but I might have missed something.

I don't get much of a stack trace either, but using WinDBG I get this:

Faulting module name: libcef.dll, version: 131.3.1.0, time stamp: 0x674e351a
Exception code: 0x80000003
Fault offset: 0x00000000017409e3
Faulting process id: 0x0x95A4
Faulting application start time: 0x0x1DB603934398776
Faulting application path: <HIDDEN>
Faulting module path: <HIDDEN>\libcef.dll
Report Id: b17e2027-2d5d-44a7-91f3-fe0b8eab0081

Further investigation with breakpoints pointed to CEF crashing here:

[return: MarshalAs(UnmanagedType.U1)]
internal unsafe static bool _003FRelease_0040CefSharpApp_0040Internals_0040CefSharp_0040_0040_0024_0024F_00244PPPPPPPM_0040A_0040EBA_NXZ(CefSharpApp* P_0)
{
	//IL_000a: Expected I, but got I8
	CefSharpApp* num = P_0;
	P_0 = (CefSharpApp*)((ulong)(nint)num - (ulong)(*(int*)((byte*)num + -4)));
	return CefSharp_002EInternals_002ECefSharpApp_002ERelease(P_0); // here crashes to be exact
}

I really hope it's just something simple we've not implemented that's causing this. But right now we cannot update beyond 131.2.70.

Expected behavior

The window opens as expected

Actual behavior

The entire application crashes

Regression?

Yes, this worked fine in 131.2.70

Known Workarounds

None

Does this problem also occur in the CEF Sample Application

Not Tested

Other information

No response

@mojiwa mojiwa changed the title CEFSharp crashes when CEF window is Invoked CEFSharp crashes when CEF window is Invoked in Net8 WPF C# Jan 10, 2025
@amaitland
Copy link
Member

Did you test with the MinimalExample?

Browser loads just fine for me. I've not seen any other reports.

Implemented a CEF window in a C# NET8 WPF application.
When the CEF window is invoked the application crashes.

Works just fine in the MinimalExample. I've tested with .Net 8.0, no issues.

Try performing a clean checkout after upgrading.

@amaitland amaitland added more-details-needed-from-op unable-to-reproduce The problem could not be reproduced by developers labels Jan 14, 2025
@amaitland amaitland changed the title CEFSharp crashes when CEF window is Invoked in Net8 WPF C# Crash when CEF window is Invoked in Net8 WPF C# Jan 14, 2025
@dschuesae
Copy link

dschuesae commented Jan 19, 2025

Same problem here with .NET 9.0 and WPF. Only crashes when I start the application with an argument from a desktop link.

@amaitland
Copy link
Member

Same problem here with .NET 9.0 and WPF. Only crashes when I start the application with an argument from a desktop link.

What is the WorkingDirectory when you launch your application via the desktop link compared to direct execution?

TBH it's unlikely your issue has the same cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-details-needed-from-op unable-to-reproduce The problem could not be reproduced by developers
Projects
None yet
Development

No branches or pull requests

3 participants