Skip to content

Commit

Permalink
Clear dlerror if magic export symbol is not found.
Browse files Browse the repository at this point in the history
Previously, running panda-system-i386 -panda osi_linux:help=y
would output that osi failed to load because PANDA_EXPORT_SYMBOLS_osi_linux
was not defined.  The error message output had nothing to do with
why osi_linux failed to load.  In this case, osi_linux doesn't
panda_require('osi') (which may be a bug) - so when it calls init_osi_api
things go sideways.  The error message was being obtained in init_osi_api
from calling dlerror() - which was reporting the missing symbol, which
isn't an error at all as the symbol is optional and not expected to be
found when loading most plugins.
  • Loading branch information
MarkMankins committed Oct 11, 2023
1 parent 6489369 commit 4e6dc6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions panda/src/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ static void do_check_export_symbols(panda_plugin *panda_plugin, const char *file
LOG_DEBUG(PANDA_MSG_FMT "Exporting symbols for plugin %s\n", PANDA_CORE_NAME, panda_plugin->name);
assert(panda_plugin->plugin == dlopen(filename, RTLD_NOW | RTLD_GLOBAL));
panda_plugin->exported_symbols = true;
} else {
// Error condition is not unexpected, clear dlerror(),
// otherwise someone might call it later and be confused
dlerror();
}

g_free(export_symbol);
Expand Down

0 comments on commit 4e6dc6c

Please sign in to comment.