loader: Improve error handling.

* Display list of unavailable dependencies when they cause another
  module to fail loading.
* When a module declines to load find all modules which depend on it so
  they can be declined and listed together.
* Prevent retry of declined modules during startup.
* When a module fails to dlopen try loading it with RTLD_LAZY so we can
  attempt to display the list of missing dependencies.

These changes are meant to reduce logger spam that is caused when a
module has many dependencies and declines to load.  This also fixes some
error paths which failed to recognize required modules.

Module load/start errors are delayed until the end of loader startup.

Change-Id: I046052c71331c556c09d39f47a3b92975f3e1758
This commit is contained in:
Corey Farrell
2018-09-28 11:13:39 -04:00
parent b351b903b9
commit f066dbc353
3 changed files with 258 additions and 32 deletions

View File

@@ -69,6 +69,9 @@ enum ast_logger_results {
void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
__attribute__((format(printf, 5, 6)));
void ast_log_ap(int level, const char *file, int line, const char *function, const char *fmt, va_list ap)
__attribute__((format(printf, 5, 0)));
/*!
* \brief Used for sending a log message with protection against recursion.
*