-
-
Notifications
You must be signed in to change notification settings - Fork 933
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
Segmentation fault with performance logger on multi-threaded environment #580
Comments
I met the same problem after I updated the easyloggingpp to the latest version. GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./uart_server...done.
[New LWP 5698]
[New LWP 5702]
[New LWP 5699]
[New LWP 5700]
[New LWP 5701]
[New LWP 5706]
[New LWP 5694]
[New LWP 5704]
[New LWP 5705]
[New LWP 5696]
[New LWP 5697]
[New LWP 5703]
[New LWP 5695]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Core was generated by `./uart_server'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 el::base::DefaultLogDispatchCallback::dispatch(std::string&&) (this=0xfb40f0,
logLine=...) at ../uart_server/lib/easyloggingpp/src/easylogging++.cc:2132
2132 ../uart_server/lib/easyloggingpp/src/easylogging++.cc: No such file or directory.
[Current thread is 1 (Thread 0x750ff450 (LWP 5698))] |
Same problem on same line. I also noticed, that sometimes default logger add its log to log file reserved only for performance log. That DEBUG log shouldn't be there: I'm using these defines: "ELPP_THREAD_SAFE" "ELPP_FORCE_USE_STD_THREAD" "ELPP_FEATURE_PERFORMANCE_TRACKING" "ELPP_NO_DEFAULT_LOG_FILE" |
same stacktrace, it's getting annoying. Any tips ? |
I've found a similar issue using Windows when logging a massive amount of information from multiple threads using a non-"default" logger. It shows up in a couple different places. I can't make a pretty stack trace, but in one example it's: I've tracked down the issue to the change made in #571 regarding the global lock. When I revert those specific changes, the issue goes away. I don't know exactly what's going on, but it seems that DefaultLogDispatchCallback::m_data is being corrupted. |
Good job, yea I also tested revert of commit 699c12e and it also helped. No more fails and no more mixed output! So from my point of view it seems that something in dispatch() make mess if it's not synchronized. But, I have no clue what is it. Maybye author of that change @abumusamq could help us? |
This issue is fixed in v9.96.4 For those affected by this change you can define |
Hello,
I have a multi-threaded program that uses easylogging to do both normal and performance logging. My program is compiled with the define
ELPP_THREAD_SAFE
. Sometime it crashes randomly and the GDB backtrace always shows me an access violation inside theel::base::DefaultLogDispatchCallback::dispatch
function.Here is the backtrace:
This backtrace has been generated by the following program:
This program creates a thread-pool and push 10 000 tasks in it. It then start n thread (depending on your platform) that output logs as fast as possible.
FYI: it works perfectly if I remove the
TIMED_FUNC(blk)
line.Also this program is compiled using the following flags:
-std=c++11 -pthread -O0 -g -Wall -W -fPIC -DELPP_THREAD_SAFE -DELPP_DISABLE_LOGGING_FLAGS_FROM_ARG -DELPP_DISABLE_LOG_FILE_FROM_ARG -DELPP_CUSTOM_COUT=std::cerr -DELPP_STL_LOGGING -DELPP_LOG_STD_ARRAY -DELPP_LOG_UNORDERED_MAP -DELPP_LOG_UNORDERED_SET -DELPP_DISABLE_VERBOSE_LOGS -DELPP_PERFORMANCE_MICROSECONDS -DELPP_NO_DEFAULT_LOG_FILE -DELPP_FEATURE_PERFORMANCE_TRACKING -DAUTO_INITIALIZE_EASYLOGGINGPP
The text was updated successfully, but these errors were encountered: