C++ logging library. It is powerful, supports asynchronous low latency, extendable, light-weight, fast performing, thread and type safe and consists of many built-in features. It provides ability to write logs in your own customized format. It also provide support for logging your classes, third-party libraries, STL and third-party containers etc.
MIT License
3.78k
stars
924
forks
source link
Build with -DELPP_EXPERIMENTAL_ASYNC causes segment fault as ELPP macro return nullptr #829
When build easylogging++ with -DELPP_EXPERIMENTAL_ASYNC to enable async logging, Storage constructor will call m_asyncDispatchWorker->start() which creates a worker thread and join() it. Now the Storage constructor will not return until the worker thread finished and the global variable (el::base::type::StoragePointer elStorage(val)) defined by INITIALIZE_EASYLOGGINGPP macro is an unfinished-constructedstd::shared_ptr. And the worker thread will call AsyncDispatchWorker::emptyQueue() which access ELPP macro causes segment fault as the global variable (el::base::type::StoragePointer elStorage(val)) is nullptr!
When build easylogging++ with
-DELPP_EXPERIMENTAL_ASYNC
to enable async logging,Storage
constructor will callm_asyncDispatchWorker->start()
which creates a worker thread andjoin()
it. Now theStorage
constructor will not return until the worker thread finished and the global variable (el::base::type::StoragePointer elStorage(val)
) defined byINITIALIZE_EASYLOGGINGPP
macro is an unfinished-constructedstd::shared_ptr
. And the worker thread will callAsyncDispatchWorker::emptyQueue()
which accessELPP
macro causes segment fault as the global variable (el::base::type::StoragePointer elStorage(val)
) isnullptr
!