Issue 1765: Make all libcef.so fuctions except of cef_* local

#61 Declined
Repository
bozaro
Branch
hide-std-export
Repository
chromiumembedded
Branch
master
Author
  1. Artem Navrotskiy
Reviewers
Description

On Linux some std::* function always exported (even with: -fvisibility=hidden)1. In this case libcef.so can try use std::* fuctions from application executable2. If application use custom allocator we will crash.

In my case I try to use libcef.so from Unreal Engine. Both libcef.so and Unreal Engine written on C++ and use std::*. But on libcef.so initialization it crash on calling destructor (see frame 8-9 backtrace entry):

#0  0x00007f46d8ca1f27 in arena_run_tree_insert (rbtree=0x7f45f4006a60, node=0x7f45f4000048) at src/arena.c:69
#1  0x00007f46d8caad35 in arena_bin_runs_insert (run=<optimized out>, bin=0x7f45f4006a30) at src/arena.c:1330
#2  arena_bin_lower_run (bin=0x7f45f4006a30, run=<optimized out>, chunk=<optimized out>, arena=<optimized out>) at src/arena.c:1868
#3  je_arena_dalloc_bin_locked (arena=0x7f45f4000020, chunk=0x7f45f4000000, ptr=<optimized out>, mapelm=<optimized out>) at src/arena.c:1898
#4  0x00007f46d8caae4a in je_arena_dalloc_bin (mapelm=<optimized out>, pageind=<optimized out>, ptr=0x7f45f4007d50, chunk=0x7f45f4000000, arena=0x7f45f4000020) at src/arena.c:1917
#5  je_arena_dalloc_small (arena=0x7f45f4000020, chunk=<optimized out>, ptr=0x7f45f4007d50, pageind=<optimized out>) at src/arena.c:1933
#6  0x00007f46d894592a in FMemory::Free (Original=0x7f45f4007d50) at /home/bozaro/github/unreal/Engine/Source/Runtime/Core/Private/HAL/UnrealMemory.cpp:114
#7  0x00007f46ceed19b6 in operator delete (Ptr=0x7f45f4006a60) at /home/bozaro/github/unreal/Engine/Source/Editor/UnrealEd/Private/UnrealEd.cpp:192
#8  0x00007f46cf7f15d0 in std::_Rb_tree<std::string, std::string, std::_Identity<std::string>, std::less<std::string>, std::allocator<std::string> >::_M_erase(std::_Rb_tree_node<std::string>*) ()
   from /home/bozaro/github/unreal/Engine/Binaries/Linux/libUE4Editor-UnrealEd.so
#9  0x00007f46afb51cb2 in CefURLRequestContextGetterImpl::SetCookieSupportedSchemes(std::vector<std::string, std::allocator<std::string> > const&) ()
   from /home/bozaro/github/unreal/Engine/Binaries/Linux/libcef.so
#10 0x00007f46afb519dc in CefURLRequestContextGetterImpl::SetCookieStoragePath(base::FilePath const&, bool) () from /home/bozaro/github/unreal/Engine/Binaries/Linux/libcef.so
#11 0x00007f46afb509f8 in CefURLRequestContextGetterImpl::GetURLRequestContext() () from /home/bozaro/github/unreal/Engine/Binaries/Linux/libcef.so
#12 0x00007f46b1cc273e in content::ChromeAppCacheService::InitializeOnIOThread(base::FilePath const&, content::ResourceContext*, net::URLRequestContextGetter*, scoped_refptr<storage::SpecialStoragePolicy>) () from /home/bozaro/github/unreal/Engine/Binaries/Linux/libcef.so

  1. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50348 - -fvisibility=hidden doesn't hide stl implementation details 

  2. https://holtstrom.com/michael/blog/post/437/Shared-Library-Symbol-Conflicts.html - Shared library symbol conflicts description 

Comments (2)