CefInitialize fail UnrealEngine 4 on MacOS

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CefInitialize fail UnrealEngine 4 on MacOS

Postby parksungjun » Wed Oct 04, 2023 10:25 pm

Hello ~

I have some problem with embedding cef to unreal engine 4 on macosx. The development environment is as follows.

- Unreal Engine Version : 4.26.2
- Operating System : Monterey 12.6.4
- Xcode : 14.2
- CEF Version : cef_binary_91.1.23+g04c8d56+chromium-91.0.4472.164_macosx64
- Execution type of CEF : Subprocess

the point that always occurred crash is cefinitialize function. callStack ends with a function named cef_time_delta when crash occurred.

I have 2 questions. first one is how to use dSYM file for debugging to unreal engine 4 on macosx? it is required to get more information to solve this crash issue through the process of debugging using dSYM.

and last one is why crash occurred at the function named cef_time_delta. I referenced initializing sequence of sample project(cefsimple), the sequence look like CefScopedLibraryLoader::LoadInMain should be called before CefInitialize function call. so I just follow that.

below code block show that the sequence of initialzing cef subprocess I used.

if anyone has solution to solve this crash issue, let me know how to deal with it, please ~

thanks to read this post :D

Code: Select all
#if WITH_WEBUI_CEF3
// The FWebBrowserSingleton must be initialized on the game thread
check(IsInGameThread());
   
#if PLATFORM_MAC
    CefScopedLibraryLoader library_loader;
    if (!library_loader.LoadInMain()) {
        UE_LOG( LogTemp, Error, TEXT("Can't Initialize CEF Library!!!") );
    }
#endif

   // Provide CEF with command-line arguments.
#if PLATFORM_WINDOWS
   CefMainArgs MainArgs(hInstance);
#else
   CefMainArgs MainArgs;
#endif

   // Specify CEF global settings here.
   CefSettings Settings;
   Settings.no_sandbox = true;

#if !PLATFORM_LINUX
   Settings.external_message_pump = true;
#endif

   //@todo change to threaded version instead of using external_message_pump & OnScheduleMessagePumpWork
   Settings.multi_threaded_message_loop = false;
   Settings.windowless_rendering_enabled = true;

       // Something to do......


   // Specify path to sub process exe
   FString SubProcessPath(FPaths::Combine(*FPaths::ProjectDir(), TEXT("Binaries"), CEF3_SUBPROCESS_EXE));
   SubProcessPath = FPaths::ConvertRelativePathToFull(SubProcessPath);

   if (!IPlatformFile::GetPlatformPhysical().FileExists(*SubProcessPath))
   {
      UE_LOG(LogWebInterfaceBrowser, Error, TEXT("CEFSubProcess not found, check that this program has been built and is placed in: %s."), *SubProcessPath);
   }
   
   CefString(&Settings.browser_subprocess_path) = TCHAR_TO_WCHAR(*SubProcessPath);   
 
    // Initialize CEF.
    bool bSuccess = CefInitialize(MainArgs, Settings, CEFBrowserApp.get(), nullptr);
    check(bSuccess);
parksungjun
Newbie
 
Posts: 2
Joined: Tue Oct 03, 2023 2:58 am

Re: CefInitialize fail UnrealEngine 4 on MacOS

Postby magreenblatt » Thu Oct 05, 2023 8:53 am

Running CEF outside of a proper app bundle structure on MacOS is complicated and generally untested/unsupported. See here for some relevant (possibly outdated) information about structure, command-line flags and linking.

how to use dSYM file for debugging

See viewtopic.php?f=6&t=19569&p=54147#p54147

why crash occurred at the function named cef_time_delta

This is what it shows when you don't have symbol information.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CefInitialize fail UnrealEngine 4 on MacOS

Postby parksungjun » Thu Oct 05, 2023 10:30 pm

first of all, I would like to say that it is so appreciate to your answer.

I'm gonna take a good look at the dSYM debugging method you sent.

in addition, I have one question about the crash of cef_time_delta function.

you mentioned, "This is what it shows when you don't have symbol information."

but I have never used the CEF debugging bundle. just used CEF Release bundle.

I confirmed any debug option to solve this situation on Makefile. but there is no any debug option.

if it is always required to debug symbol, how to deal with it?

I might be missing something but I don't know what it is. OTL.....
parksungjun
Newbie
 
Posts: 2
Joined: Tue Oct 03, 2023 2:58 am

Re: CefInitialize fail UnrealEngine 4 on MacOS

Postby magreenblatt » Fri Oct 06, 2023 9:39 am

Symbol information comes from the dSYM file.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 199 guests