Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with -DELPP_EXPERIMENTAL_ASYNC causes segment fault as ELPP macro return nullptr #829

Open
sfzhang opened this issue Jan 16, 2023 · 0 comments

Comments

@sfzhang
Copy link

sfzhang commented Jan 16, 2023

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-constructed std::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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant