Commit 5ca921c
Fix: sink.text.pretty: check that port is connected before creating message iterator
sink.text.pretty does not check if its input port is connected before
trying to create a message iterator on it. This can lead to a
precondition assertion failure. It can be reproduced with this Python
snippet.
import bt2
g = bt2.Graph()
g.add_component(bt2.find_plugin('text').sink_component_classes['pretty'], 'snk')
g.run()
The assertion failure we get is:
04-14 11:35:27.339 1231815 1231815 F LIB/MSG-ITER [email protected]:295 Babeltrace 2 library precondition not satisfied; error is:
04-14 11:35:27.339 1231815 1231815 F LIB/MSG-ITER [email protected]:295 Input port is not connected: port-addr=0x607000001d70, port-type=INPUT, port-name="in"
04-14 11:35:27.339 1231815 1231815 F LIB/MSG-ITER [email protected]:295 Aborting...
./tests/utils/../utils/utils.sh: line 283: 1231815 Aborted (core dumped) env "${env_args[@]}" "$@"
Add a check and return an error if that happens instead. A
corresponding test is also added.
Change-Id: Ibeed94cd6ece543817fe8a765a69cb52bbaaba76
Signed-off-by: Simon Marchi <[email protected]>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3403
Reviewed-by: Philippe Proulx <[email protected]>
Tested-by: jenkins <[email protected]>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/34111 parent 2467456 commit 5ca921c
File tree
4 files changed
+64
-5
lines changed- src/plugins/text/pretty
- tests
- plugins/sink.text.pretty
4 files changed
+64
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
148 | 153 | | |
149 | | - | |
150 | | - | |
| 154 | + | |
151 | 155 | | |
152 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
153 | 168 | | |
154 | | - | |
155 | | - | |
| 169 | + | |
156 | 170 | | |
157 | 171 | | |
158 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| 148 | + | |
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments