While i am running cef on a virtualized server i can observed the following crash.
here is the backtrace :
- Code: Select all
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `gst-launch-1.0 cefsrc url=https://soundcloud.com/platform/sama ! queue ! cefdem'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 __GI___pthread_mutex_lock (mutex=0x10) at ../nptl/pthread_mutex_lock.c:65
65 ../nptl/pthread_mutex_lock.c: No such file or directory.
[Current thread is 1 (Thread 0x7fbe8e0fd740 (LWP 23910))]
(gdb) bt
#0 0x00007fbe8d448fa0 in __GI___pthread_mutex_lock (mutex=0x10) at ../nptl/pthread_mutex_lock.c:65
#1 0x00007fbe874aa188 in base::internal::LockImpl::Lock() () at ./libcef.so
#2 0x00007fbe8732413a in CefFrameHostImpl::RefreshAttributes() () at ./libcef.so
#3 0x00007fbe872f98c1 in CefBrowserHostImpl::DidFinishNavigation(content::NavigationHandle*) () at ./libcef.so
#4 0x00007fbe86010dd0 in content::WebContentsImpl::DidFinishNavigation(content::NavigationHandle*) () at ./libcef.so
#5 0x00007fbe85d443d9 in content::NavigationHandleImpl::~NavigationHandleImpl() () at ./libcef.so
#6 0x00007fbe85d446ee in content::NavigationHandleImpl::~NavigationHandleImpl() () at ./libcef.so
#7 0x00007fbe85d47eac in content::NavigationRequest::~NavigationRequest() () at ./libcef.so
#8 0x00007fbe85d4833e in content::NavigationRequest::~NavigationRequest() () at ./libcef.so
#9 0x00007fbe85d1f94d in content::FrameTreeNode::ResetNavigationRequest(bool, bool) () at ./libcef.so
#10 0x00007fbe85d48ac2 in content::NavigationRequest::OnRequestFailedInternal(network::URLLoaderCompletionStatus const&, bool, base::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, bool) () at ./libcef.so
#11 0x00007fbe85d4d136 in content::NavigationRequest::OnRequestFailed(network::URLLoaderCompletionStatus const&) () at ./libcef.so
#12 0x00007fbe85e0fd80 in content::NavigationURLLoaderImpl::OnComplete(network::URLLoaderCompletionStatus const&) () at ./libcef.so
#13 0x00007fbe8744cd8a in base::TaskAnnotator::RunTask(char const*, base::PendingTask*) () at ./libcef.so
#14 0x00007fbe8745bf7e in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow*, bool*) () at ./libcef.so
#15 0x00007fbe8745bbbe in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork() () at ./libcef.so
#16 0x00007fbe8741cd37 in base::(anonymous namespace)::WorkSourceDispatch(_GSource*, int (*)(void*), void*) () at ./libcef.so
#17 0x00007fbe8d6aa417 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007fbe8d6aa650 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007fbe8d6aa6dc in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007fbe87413e5e in base::MessagePumpGlib::Run(base::MessagePump::Delegate*) () at ./libcef.so
#21 0x00007fbe8745c979 in non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) () at ./libcef.so
#22 0x00007fbe8742f7e7 in base::RunLoop::RunWithTimeout(base::TimeDelta) () at ./libcef.so
#23 0x00007fbe87307ec0 in CefDoMessageLoopWork() () at ./libcef.so
#24 0x00007fbe8bf73c82 in cef_do_work_func(_GstCefSrc*) () at /overlay/cef-gstreamer/Release/libgstcef.so
#25 0x00007fbe8d6aad03 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007fbe8d6aa285 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007fbe8d6aa650 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007fbe8d6aa962 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007fbe8dc0e9f3 in gst_bus_poll () at /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#30 0x000055820a0b0bb3 in ()
#31 0x000055820a0afcb7 in ()
#32 0x00007fbe8d06fb97 in __libc_start_main (main=0x55820a0af460, argc=17, argv=0x7fffc028bce8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffc028bcd8)
at ../csu/libc-start.c:310
#33 0x000055820a0b00da in ()
(gdb) btfull
Undefined command: "btfull". Try "help".
(gdb) bt full
#0 0x00007fbe8d448fa0 in __GI___pthread_mutex_lock (mutex=0x10) at ../nptl/pthread_mutex_lock.c:65
type = <optimized out>
__PRETTY_FUNCTION__ = "__pthread_mutex_lock"
id = <optimized out>
#1 0x00007fbe874aa188 in base::internal::LockImpl::Lock() () at ./libcef.so
#2 0x00007fbe8732413a in CefFrameHostImpl::RefreshAttributes() () at ./libcef.so
#3 0x00007fbe872f98c1 in CefBrowserHostImpl::DidFinishNavigation(content::NavigationHandle*) () at ./libcef.so
#4 0x00007fbe86010dd0 in content::WebContentsImpl::DidFinishNavigation(content::NavigationHandle*) () at ./libcef.so
#5 0x00007fbe85d443d9 in content::NavigationHandleImpl::~NavigationHandleImpl() () at ./libcef.so
#6 0x00007fbe85d446ee in content::NavigationHandleImpl::~NavigationHandleImpl() () at ./libcef.so
#7 0x00007fbe85d47eac in content::NavigationRequest::~NavigationRequest() () at ./libcef.so
#8 0x00007fbe85d4833e in content::NavigationRequest::~NavigationRequest() () at ./libcef.so
#9 0x00007fbe85d1f94d in content::FrameTreeNode::ResetNavigationRequest(bool, bool) () at ./libcef.so
#10 0x00007fbe85d48ac2 in content::NavigationRequest::OnRequestFailedInternal(network::URLLoaderCompletionStatus const&, bool, base::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, bool) () at ./libcef.so
#11 0x00007fbe85d4d136 in content::NavigationRequest::OnRequestFailed(network::URLLoaderCompletionStatus const&) () at ./libcef.so
#12 0x00007fbe85e0fd80 in content::NavigationURLLoaderImpl::OnComplete(network::URLLoaderCompletionStatus const&) () at ./libcef.so
#13 0x00007fbe8744cd8a in base::TaskAnnotator::RunTask(char const*, base::PendingTask*) () at ./libcef.so
#14 0x00007fbe8745bf7e in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow*, bool*) () at ./libcef.so
#15 0x00007fbe8745bbbe in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork() () at ./libcef.so
#16 0x00007fbe8741cd37 in base::(anonymous namespace)::WorkSourceDispatch(_GSource*, int (*)(void*), void*) () at ./libcef.so
#17 0x00007fbe8d6aa417 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007fbe8d6aa650 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007fbe8d6aa6dc in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007fbe87413e5e in base::MessagePumpGlib::Run(base::MessagePump::Delegate*) () at ./libcef.so
#21 0x00007fbe8745c979 in non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) () at ./libcef.so
#22 0x00007fbe8742f7e7 in base::RunLoop::RunWithTimeout(base::TimeDelta) () at ./libcef.so
#23 0x00007fbe87307ec0 in CefDoMessageLoopWork() () at ./libcef.so
#24 0x00007fbe8bf73c82 in cef_do_work_func(_GstCefSrc*) () at /overlay/cef-gstreamer/Release/libgstcef.so
#25 0x00007fbe8d6aad03 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007fbe8d6aa285 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007fbe8d6aa650 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007fbe8d6aa962 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007fbe8dc0e9f3 in gst_bus_poll () at /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#30 0x000055820a0b0bb3 in ()
#31 0x000055820a0afcb7 in ()
#32 0x00007fbe8d06fb97 in __libc_start_main (main=0x55820a0af460, argc=17, argv=0x7fffc028bce8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffc028bcd8)
at ../csu/libc-start.c:310
result = <optimized out>
unwind_buf =
{cancel_jmp_buf = {{jmp_buf = {0, 3068117579287665527, 94017002602672, 140736417283296, 0, 0, 9110695088326089591, 9146013375173270391}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x7fbe8df14733 <_dl_init+259>, 0x7fbe8defaa58}, data = {prev = 0x0, cleanup = 0x0, canceltype = -1913567437}}}
not_first_call = <optimized out>
#33 0x000055820a0b00da in ()
The OS is a ubuntu 18.04 LTS.
The core dump sho a problem while locking the mutex :
cef_lock_impl.c :
- Code: Select all
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "include/base/internal/cef_lock_impl.h"
#include "include/base/cef_logging.h"
#if defined(OS_WIN)
namespace base {
namespace cef_internal {
LockImpl::LockImpl() {
// The second parameter is the spin count, for short-held locks it avoid the
// contending thread from going to sleep which helps performance greatly.
::InitializeCriticalSectionAndSpinCount(&native_handle_, 2000);
}
LockImpl::~LockImpl() {
::DeleteCriticalSection(&native_handle_);
}
bool LockImpl::Try() {
if (::TryEnterCriticalSection(&native_handle_) != FALSE) {
return true;
}
return false;
}
void LockImpl::Lock() {
::EnterCriticalSection(&native_handle_);
}
void LockImpl::Unlock() {
::LeaveCriticalSection(&native_handle_);
}
} // namespace cef_internal
} // namespace base
#elif defined(OS_POSIX)
#include <errno.h>
#include <string.h>
#include "include/base/cef_logging.h"
namespace base {
namespace cef_internal {
LockImpl::LockImpl() {
#if DCHECK_IS_ON()
// In debug, setup attributes for lock error checking.
pthread_mutexattr_t mta;
int rv = pthread_mutexattr_init(&mta);
DCHECK_EQ(rv, 0) << ". " << strerror(rv);
rv = pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_ERRORCHECK);
DCHECK_EQ(rv, 0) << ". " << strerror(rv);
rv = pthread_mutex_init(&native_handle_, &mta);
DCHECK_EQ(rv, 0) << ". " << strerror(rv);
rv = pthread_mutexattr_destroy(&mta);
DCHECK_EQ(rv, 0) << ". " << strerror(rv);
#else
// In release, go with the default lock attributes.
pthread_mutex_init(&native_handle_, NULL);
//native_handle_ = PTHREAD_MUTEX_INITIALIZER;
//pthread_mutexattr_init(&mutex_attribute);
//pthread_mutexattr_settype(&mutex_attribute, PTHREAD_MUTEX_RECURSIVE_NP);
//pthread_mutexattr_setpshared(&mutex_attribute, PTHREAD_PROCESS_SHARED);
//pthread_mutex_init(&native_handle_, &mutex_attribute);
//sem_init(&native_handle_, 0, 1);
#endif
}
LockImpl::~LockImpl() {
int rv = pthread_mutex_destroy(&native_handle_);
//int rv = sem_destroy(&native_handle_);
DCHECK_EQ(rv, 0) << ". " << strerror(rv);
}
bool LockImpl::Try() {
int rv = pthread_mutex_trylock(&native_handle_);
/*int value = 0;
int rv;
sem_getvalue(&native_handle_, &value);
if (value >= 0) {
rv = 0;
} else {
rv = 1;
}*/
DCHECK(rv == 0 || rv == EBUSY) << ". " << strerror(rv);
return rv == 0;
}
void LockImpl::Lock() {
int rv = pthread_mutex_lock(&native_handle_);
//int rv = sem_wait(&native_handle_);
DCHECK_EQ(rv, 0) << ". " << strerror(rv);
}
void LockImpl::Unlock() {
int rv = pthread_mutex_unlock(&native_handle_);
//int rv = sem_post(&native_handle_);
DCHECK_EQ(rv, 0) << ". " << strerror(rv);
}
} // namespace cef_internal
} // namespace base
#endif // defined(OS_POSIX)
cef_lock_impl.h :
- Code: Select all
// Copyright (c) 2011 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Do not include this header file directly. Use base/cef_lock.h instead.
#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_
#define CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_
#include "include/base/cef_build.h"
#if defined(OS_WIN)
#include <windows.h>
#elif defined(OS_POSIX)
#include <pthread.h>
#include <semaphore.h>
#include <unistd.h>
#endif
#include "include/base/cef_macros.h"
namespace base {
namespace cef_internal {
// This class implements the underlying platform-specific spin-lock mechanism
// used for the Lock class. Most users should not use LockImpl directly, but
// should instead use Lock.
class LockImpl {
public:
#if defined(OS_WIN)
typedef CRITICAL_SECTION NativeHandle;
#elif defined(OS_POSIX)
typedef pthread_mutex_t NativeHandle;
//typedef sem_t NativeHandle;
#endif
LockImpl();
~LockImpl();
// If the lock is not held, take it and return true. If the lock is already
// held by something else, immediately return false.
bool Try();
// Take the lock, blocking until it is available if necessary.
void Lock();
// Release the lock. This must only be called by the lock's holder: after
// a successful call to Try, or a call to Lock.
void Unlock();
// Return the native underlying lock.
// TODO(awalker): refactor lock and condition variables so that this is
// unnecessary.
NativeHandle* native_handle() { return &native_handle_; }
private:
NativeHandle native_handle_;
//pthread_mutexattr_t mutex_attribute;
DISALLOW_COPY_AND_ASSIGN(LockImpl);
};
} // namespace cef_internal
} // namespace base
#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_
The bug looks like a bug : https://bugs.launchpad.net/ubuntu/+sour ... ug/1281302