~lttng/lttng-ust/lttng-ust

  • Committer: Mathieu Desnoyers
  • Author(s): Jérémie Galarneau
  • Date: 2023-03-30 19:30:28 UTC
  • Revision ID: git-v1:7d54bba42d167e5d74dfdff858153742b199b4f6
Fix: segmentation fault on filter interpretation in "switch" mode

When building the interpreter with `INTERPRETER_USE_SWITCH`, I get the
following crash when interpreting a bytecode:

  Program terminated with signal SIGSEGV, Segmentation fault.
  (gdb) bt
  #0  0x00007f5789aee443 in lttng_bytecode_interpret (ust_bytecode=0x555dfe90a650, interpreter_stack_data=0x7ffd12615500 "", probe_ctx=0x7ffd12615620,
      caller_ctx=0x7ffd126154bc) at lttng-bytecode-interpreter.c:885
  #1  0x00007f5789af4da2 in lttng_ust_interpret_event_filter (event=0x555dfe90a580, interpreter_stack_data=0x7ffd12615500 "", probe_ctx=0x7ffd12615620,
      event_filter_ctx=0x0) at lttng-bytecode-interpreter.c:2548
  #2  0x0000555dfe02d2d4 in lttng_ust__event_probe__tp___the_string (__tp_data=0x555dfe90a580, i=0, arg_i=2, str=0x7ffd12617cfa "hypothec") at ././tp.h:16
  #3  0x0000555dfe02cac0 in lttng_ust_tracepoint_cb_tp___the_string (str=0x7ffd12617cfa "hypothec", arg_i=2, i=0)
      at /tmp/lttng-master/src/lttng-tools/tests/utils/testapp/gen-ust-nevents-str/tp.h:16
  #4  main (argc=39, argv=0x7ffd12615818) at gen-ust-nevents-str.cpp:38

This appears to be caused by `bytecode->data` being used to determine
the `start_pc` address. In my case, `data` is NULL. A quick look around
the code seems to show that this member is not used except during the
transmission of the bytecode.

I am basing the fix on the implementation of START_OP in the default
case which uses `code` in lieu of `data` and can confirm that it fixes
the crash on my end.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I0773df385b8e90728b60503016dec4b46d902234
Filename Latest Rev Last Changed Committer Comment Size
..
doc 1169 12 years ago Mathieu Desnoyers Install easy-ust and gen-tp examples in doc/ Sign Diff
extras 2931 2 years ago Mathieu Desnoyers Add serialized ABI definition files This commit c Diff
include 243 14 years ago Pierre-Marc Fournier Merge branch 'for-pierre-marc' of git://git.infrad Diff
LICENSES 2538 3 years ago Mathieu Desnoyers Move to kernel style SPDX license identifiers The Diff
m4 2215 7 years ago Mathieu Desnoyers Move m4 scripts to m4 dir Harmonize build system Diff
src 2755 3 years ago Mathieu Desnoyers Move all sources to 'src/' This will align the so Diff
tests 117 14 years ago Pierre-Marc Fournier reorganize test programs into tests/ directory Diff
tools 1168 12 years ago Mathieu Desnoyers Create the lttng-gen-tp tools as an helper to gene Diff
.classpath 2960 2 years ago Mathieu Desnoyers Add basic Eclipse setup for log4j Change-Id: I2f4 2.3 KB Diff Download File
.gitignore 2991 1 year ago Mathieu Desnoyers Add more unit tests for possible_cpus_array_len C 7.3 KB Diff Download File
.gitreview 2351 4 years ago Mathieu Desnoyers Add git-review config Add .gitreview for contribu 123 bytes Diff Download File
.project 2960 2 years ago Mathieu Desnoyers Add basic Eclipse setup for log4j Change-Id: I2f4 368 bytes Diff Download File
File bootstrap 2538 3 years ago Mathieu Desnoyers Move to kernel style SPDX license identifiers The 133 bytes Diff Download File
ChangeLog 2903 3 years ago Mathieu Desnoyers Version 2.13.0-rc1 Signed-off-by: Mathieu Desnoye 85 KB Diff Download File
CodingStyle 2298 5 years ago Mathieu Desnoyers doc: remove repeated word in coding style Signed- 304 bytes Diff Download File
configure.ac 2986 1 year ago Mathieu Desnoyers Add unit tests for num possible cpus Change-Id: I 24.5 KB Diff Download File
CONTRIBUTING.md 2310 5 years ago Mathieu Desnoyers Fix: Update coding style link The documentation a 4.9 KB Diff Download File
LICENSE 2769 3 years ago Mathieu Desnoyers Move liblttng-ust-ctl to 'src/lib/' Move all publ 1.8 KB Diff Download File
Makefile.am 2931 2 years ago Mathieu Desnoyers Add serialized ABI definition files This commit c 445 bytes Diff Download File
README.md 2963 2 years ago Mathieu Desnoyers Add a Log4j 2.x Java agent This adds a new agent 8.9 KB Diff Download File