Fix: src.ctf.fs: use BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE when applicable
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 16 Oct 2019 21:58:13 +0000 (17:58 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 30 Oct 2019 19:14:52 +0000 (15:14 -0400)
commit6699263d2b55901a86e258a03c74705c8c49f6e6
tree0fb905eb6eb70a06ad9c2567fdf249412b2a29e1
parent9a6cc676da74dd78c3852a36822f75611664b869
Fix: src.ctf.fs: use BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE when applicable

Some functions in src.ctf.fs use BT_COMP_LOGE_APPEND_CAUSE when they
encounter an error.  However, they can be called in component class
context (as part of query handling).  A NULL self_comp can therefore be
passed to BT_COMP_LOGE_APPEND_CAUSE, which results in assertions like:

    LIB/CUR-THREAD bt_current_thread_error_append_cause_from_component@current-thread.c:132 Babeltrace 2 library precondition not satisfied; error is:
    LIB/CUR-THREAD bt_current_thread_error_append_cause_from_component@current-thread.c:132 Component is NULL:
    LIB/CUR-THREAD bt_current_thread_error_append_cause_from_component@current-thread.c:132 Aborting...

These functions should use BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE and
receive both a self_comp and a self_comp_class.  This requires adding a
self_comp_class field to ctf_fs_create, which is mutually exclusive with
the self_comp field (since we are only in one of these contexts, not
both).

Change-Id: I9fc3ed1ac03a6f3bdb5b7c25b38264015d073116
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2213
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/ctf/fs-src/fs.c
src/plugins/ctf/fs-src/fs.h
This page took 0.024656 seconds and 4 git commands to generate.