abumq / easyloggingpp

C++ logging library. It is extremely powerful, 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.75k stars 918 forks source link

Solution for a lot of crashes caused by the lack of pointer validation. #820

Open holonowp opened 1 year ago

holonowp commented 1 year ago

Hello everyone, With using ELPP I have experienced crashes caused by the lack of pointer validation. They occur always when you try to use the logger at:

  1. The constructor of a static object (as the trial to log occurs before initializing the storage),
  2. The destructor of a static object (logging after the storage has been destroyed). and sometimes in other circumstances as well (multiple threads, etc). The reason is unfortunately a wide use of the expressions like ELPP->registered_loggers()-> and similar ones, without checking the pointers first. I have fixed this problem in my local copy, how can I fix the repository, so everyone could benefit ?