Fix: lib: handle BT_FUNC_STATUS_NOT_FOUND in bt_plugin_so_create_all_from_sections
When an SO plugin's init function returns an error and
fail_on_load_error is false, we hit an assert:
(╯°□°)╯︵ ┻━┻ /home/smarchi/src/babeltrace/src/lib/plugin/plugin-so.c:1351: bt_plugin_so_create_all_from_sections(): Assertion `!plugin` failed.
When an error happens in the plugin's init function, bt_plugin_so_init returns BT_FUNC_STATUS_NOT_FOUND. We leave the `plugin` variable set, which triggers the assert.
Fix this by putting/resetting `plugin` in that case. Since there was an
error initializing the plugin, we won't return it to the user, so I
think that release it is the right thing to do here.
Add a test with a plugin whose init function fail. Test both the
fail_on_load_error true and false cases.
Change-Id: I8e219f728a4b58d0e32307f907243892a02fdccf
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reported-by: Brice Videau <bvideau@anl.gov>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11679
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-by: Brice Videau <bvideau@anl.gov>
Tested-by: jenkins <jenkins@lttng.org>
This page took 0.025046 seconds and 4 git commands to generate.