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)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 18 Oct 2019 18:02:03 +0000 (14:02 -0400)
commitb7d2695ae888cafb25084b2feaa4a770b3a540cd
treeebdba28ab8be83b00d39672c94329ebbe4502033
parent2b1f9014fead512c00f519214f44ad86cf39187d
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.0254 seconds and 4 git commands to generate.