Cef.Initialize - sqlite3_dbdata_init - 0xc0000409

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

Cef.Initialize - sqlite3_dbdata_init - 0xc0000409

Postby aaronegger » Thu Feb 13, 2025 10:22 pm

Hey guys,

i have a very strange issue.
I think this is not a bug with the cef lib itself, as i can not reproduce this in a minimal project.

I got a project to fix that uses currently the cef version 120 with proprietary codec support. This version and maybe some more have an issue with ntlm authentication.
https://github.com/chromiumembedded/cef/issues/3110
Because of this i should try to update the cef version to the latest one.

The project already included a build process guide that is based on this guide from here: https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart but with the change to build it with h264 support.

The update.bat is changed to this:
set CEF_USE_GN=1
set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome
set GN_ARGUMENTS=--ide=vs2022 --sln=cef --filters=//cef/*
python3 ..\automate\automate-git.py --download-dir=c:\code\chromium_git --depot-tools-dir=c:\code\depot_tools --branch=6834 --no-distrib --no-build

And the create.bat is changed to this:
set CEF_USE_GN=1
set GN_DEFINES=is_win_fastlink=true proprietary_codecs=true ffmpeg_branding=Chrome
set GN_ARGUMENTS=--ide=vs2022 --sln=cef --filters=//cef/*
call cef_create_projects.bat

I only changed the branch to match the one that cefsharp expects.

The project uses .Net Framework 4.7.

The build process for the release versions worked fine. Only the debug version of cef were not buildable.
But since i only need the release versions, i didn't dig to much trying to fix this.
I tested the release version (x86 and x64) by launching the cefclient.exe.
Furthermore i created a .Net Framework 4.7 project to test if it also works with cefsharp.
And it worked just fine.

But when running this whole thing in the project i got to fix, the application crashes after Cef.Initialize is called.
Sometimes this takes a few seconds, which allows the application to continue and even show the browser control with the example page fully loaded and with running animations (no freeze).

But it then always crashes without any warning.

I used a crashcatch registry entry to create a dump and opened that with windbg.

Windbg gave me this stacktrace:

libcef!sqlite3_dbdata_init+0x8f6be55
libcef!sqlite3_dbdata_init+0x8f884b0
libcef!sqlite3_dbdata_init+0x8f4dc8a
ntdll!RtlpExecuteHandlerForException+0xf
ntdll!RtlDispatchException+0x286
ntdll!KiUserExceptionDispatch+0x2e
libcef!GetHandleVerifier+0x66f1a
libcef!CrashForExceptionInNonABICompliantCodeRange+0x45b524a
libcef!CrashForExceptionInNonABICompliantCodeRange+0x43e0e8e
libcef!CrashForExceptionInNonABICompliantCodeRange+0x45af6a1
libcef!sqlite3_dbdata_init+0x8f88517
libcef!sqlite3_dbdata_init+0x8f884a1
libcef!sqlite3_dbdata_init+0x8f4dc8a
ntdll!RtlpExecuteHandlerForException+0xf
ntdll!RtlDispatchException+0x286
ntdll!KiUserExceptionDispatch+0x2e
libcef!GetHandleVerifier+0x66f1a
libcef!CrashForExceptionInNonABICompliantCodeRange+0x45af967
libcef!CrashForExceptionInNonABICompliantCodeRange+0x43e0dc9
libcef!CrashForExceptionInNonABICompliantCodeRange+0x45af5cb
libcef!CrashForExceptionInNonABICompliantCodeRange+0x4610938
libcef!CrashForExceptionInNonABICompliantCodeRange+0x4646c9d
libcef!CrashForExceptionInNonABICompliantCodeRange+0x4646800
libcef!CrashForExceptionInNonABICompliantCodeRange+0x460e9a9
libcef!CrashForExceptionInNonABICompliantCodeRange+0x447d6b7
libcef!CrashForExceptionInNonABICompliantCodeRange+0x4512ddb
libcef!sqlite3_dbdata_init+0x8f49a42
libcef!CrashForExceptionInNonABICompliantCodeRange+0x45afb22
libcef!CrashForExceptionInNonABICompliantCodeRange+0x43e0dc9
libcef!CrashForExceptionInNonABICompliantCodeRange+0x45af5cb
libcef!sqlite3_dbdata_init+0x8f4978f
libcef!GetHandleVerifier+0x5268a
libcef!GetHandleVerifier+0x51dca
libcef!GetHandleVerifier+0x233da
libcef!GetHandleVerifier+0x20579
libcef!GetHandleVerifier+0x204a7
libcef!GetHandleVerifier+0x21023
libcef!CrashForExceptionInNonABICompliantCodeRange+0x44ce65b
libcef!CrashForExceptionInNonABICompliantCodeRange+0x446c82b
ntdll!RtlpTpWaitCallback+0xa5
ntdll!TppExecuteWaitCallback+0xae
ntdll!TppWorkerThread+0x72c
kernel32!BaseThreadInitThunk+0x1d
ntdll!RtlUserThreadStart+0x28

The event viewer shows me this error:
Faulting module name: libcef.dll, version: 132.3.2.0, time stamp: 0x677a11d0
Exception code: 0xc0000409

It is strange, because this only happens when it loads the 64bit version. Running it with 32bit works just fine.
Using the official runtime, it also works.
It only fails with the 64bit version from my custom build.
The custom build version is also about 150Mb larger than the offical version.
But the custom build works fine in every other scenario, only in this particular project it causes this error.

I tried rebuild cef, using another cache directory, also disabling the cache (forcing in memory cache), verified that cef.initialize is called within the main (ui) thread.
Currently i am complete out of ideas. While i am writing this, i try to build an older branch and try that one.

Has anyone an idea what could cause this type of error or how i can dig deeper to find the cause?
aaronegger
Newbie
 
Posts: 3
Joined: Thu Feb 13, 2025 9:49 pm

Re: Cef.Initialize - sqlite3_dbdata_init - 0xc0000409

Postby ndesktop » Sat Feb 15, 2025 1:31 am

Does running with --enable-logging shows some CHECK message?
Exception code 0xc0000409 is STATUS_STACK_BUFFER_OVERRUN.
I'm looking on https://issues.chromium.org/issues?q=sq ... bdata_init and there is a number of issues, but I cannot find something with STATUS_STACK_BUFFER_OVERRUN. Try also to see if the executable somehow ended up in Compatibility mode (Windows 7, 8 etc.), and, if so, uncheck the "Run this program in compatibility mode for ..." setting.
ndesktop
Master
 
Posts: 882
Joined: Thu Dec 03, 2015 10:10 am

Re: Cef.Initialize - sqlite3_dbdata_init - 0xc0000409

Postby amaitland » Sat Feb 15, 2025 4:01 pm

MasterBuildQuickStart is for building development builds, not release builds.

Official builds use the configuration listed at https://bitbucket.org/chromiumembedded/ ... figuration
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1329
Joined: Wed Jan 14, 2015 2:35 am

Re: Cef.Initialize - sqlite3_dbdata_init - 0xc0000409

Postby aaronegger » Mon Feb 17, 2025 7:07 am

Thank you both for answering.
I attached the log file, but i don't think that there is something helpful in it.

But i will try again with the guide for official builds. Maybe this fixes the issue.
Attachments
0_cef_debug.log
(366.67 KiB) Downloaded 91 times
aaronegger
Newbie
 
Posts: 3
Joined: Thu Feb 13, 2025 9:49 pm

Re: Cef.Initialize - sqlite3_dbdata_init - 0xc0000409

Postby aaronegger » Mon Mar 03, 2025 9:06 am

amaitland wrote:MasterBuildQuickStart is for building development builds, not release builds.

Official builds use the configuration listed at https://bitbucket.org/chromiumembedded/ ... figuration


This did the trick! The build from this guide works fine :)
aaronegger
Newbie
 
Posts: 3
Joined: Thu Feb 13, 2025 9:49 pm


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 4 guests