Crash on application exit

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.

Crash on application exit

Postby Yubtest » Sun Apr 19, 2020 6:02 am

Hi ,

I have integarted cef with our product , everything works fine. At the end, after cefShutdown, Application crashes. below given is the backtrace. I am running on Ubuntu 18.04.

I am using multiprocess mode, with command line options disable-gpu,disable-gpu-compositing and disable-extensions

Can someone please help me on this?

Thread 23 "ThreadPoolSingl" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffabfff700 (LWP 3570)]
0x00007ffff1efb53f in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
(gdb) bt
#0 0x00007ffff1efb53f in () at /lib/x86_64-linux-gnu/libgcc_s.so.1
#1 0x00007ffff1efd098 in _Unwind_Backtrace () at /lib/x86_64-linux-gnu/libgcc_s.so.1
#2 0x00007ffff1c2c168 in __GI___backtrace (array=<optimized out>, size=<optimized out>) at ../sysdeps/x86_64/backtrace.c:111
#3 0x00007fffc5e89fb9 in CollectStackTrace() () at ../../base/debug/stack_trace_posix.cc:840
#4 0x00007fffc5daa1e3 in StackTrace () at ../../base/debug/stack_trace.cc:206
#5 0x00007fffc5daa1e3 in StackTrace() () at ../../base/debug/stack_trace.cc:203
#6 0x00007fffc5e583cf in make_unique<base::debug::StackTrace> () at ../../buildtools/third_party/libc++/trunk/include/memory:3043
#7 0x00007fffc5e583cf in Set () at ../../base/threading/thread_restrictions.cc:36
#8 0x00007fffc5e583cf in SetSingletonAllowed() () at ../../base/threading/thread_restrictions.cc:228
#9 0x00007fffc5ea10fe in ThreadFunc() () at ../../base/threading/platform_thread_posix.cc:67
#10 0x00007ffff7bbd6db in start_thread (arg=0x7fffabfff700) at pthread_create.c:463
#11 0x00007ffff1c1c88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95


Thanks
Yubtest
Techie
 
Posts: 20
Joined: Mon Jan 13, 2020 5:32 am

Re: Crash on application exit

Postby magreenblatt » Sun Apr 19, 2020 2:52 pm

What CEF version? Does the crash reproduce with the CEF sample apps?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Crash on application exit

Postby Yubtest » Mon Apr 20, 2020 2:58 am

I have tried different versions including the latest version. Issue is reproducible everywhere.

From further analysis, it is found that crash happens in cef_unload_library. we are calling dlopen of libcef.so from the code,will call cef_unload_library once the browser is closed after shutdown
Crash does not happen if I dont call cef_unload_library. Cefclient does not have this issue

I had placed the cef_unload_library in a destructor and that gave me the above mentioned error.

If I directly call cef_unload_library, i get the following. Is it something to do with CefSettings ?

#1 0x000000000055a1a0 in cef_string_utf16_clear(cef_string_utf16_t*) (str=0x7fffffffd008)
at /mnt/largesrc/pulse/GUI/cefBrowser/cef_binary_80.1.14+ga33bdbc+chromium-80.0.3987.149_linux64_minimal/libcef_dll/wrapper/libcef_dll_dylib.cc:1157
#2 0x00000000004b38b7 in CefSettingsTraits::clear(_cef_settings_t*) (s=0x7fffffffcff8)
at ../cefBrowser/cef_binary_80.1.14+ga33bdbc+chromium-80.0.3987.149_linux64_minimal/include/internal/cef_types_wrappers.h:544
#3 0x00000000004b270e in CefStructBase<CefSettingsTraits>::Clear(_cef_settings_t*) (s=0x7fffffffd008)
at ../cefBrowser/cef_binary_80.1.14+ga33bdbc+chromium-80.0.3987.149_linux64_minimal/include/internal/cef_types_wrappers.h:129
#4 0x00000000004b270e in CefStructBase<CefSettingsTraits>::~CefStructBase() (this=<optimized out>)
at ../cefBrowser/cef_binary_80.1.14+ga33bdbc+chromium-80.0.3987.149_linux64_minimal/include/internal/cef_types_wrappers.h:51

Please advise me on this

Thanks
Yubtest
Techie
 
Posts: 20
Joined: Mon Jan 13, 2020 5:32 am

Re: Crash on application exit

Postby magreenblatt » Mon Apr 20, 2020 8:54 am

There is no cef_unload_library on Linux so I assume you’ve made the delay load code changes discussed in viewtopic.php?f=6&t=17471. You should mention these details in your posts.

The call stack that you’re getting suggests that CefSettings contains some strings, and the attempt to deallocate them crashes after you’ve unloaded the library. You should only unload the library after all CEF objects are out of scope.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Crash on application exit

Postby Yubtest » Mon Apr 20, 2020 1:27 pm

Yes, I have done those changes to implement delayed loading in Linux, Sorry to miss those details.

magreenblatt wrote:
The call stack that you’re getting suggests that CefSettings contains some strings, and the attempt to deallocate them crashes after you’ve unloaded the library. You should only unload the library after all CEF objects are out of scope.
.

I am calling cef_unload_library after cefShutdown and getting this error(cefSettings dealloc)

I have also tried calling the unload in destructor , which gets called after the library loader object is out of scope.Getting "ThreadPoolSingl" received signal SIGSEGV,

Is there any thing which i miss here? anything to clear explicitly?
Yubtest
Techie
 
Posts: 20
Joined: Mon Jan 13, 2020 5:32 am


Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 72 guests