~lttng/lttng-ust/lttng-ust

  • Committer: Mathieu Desnoyers
  • Author(s): Jérémie Galarneau
  • Date: 2023-09-29 15:58:02 UTC
  • Revision ID: git-v1:d1a0fad8df4d6777fabb4eddee71aa0dea3bbddd
Fix: misaligned urcu reader accesses

Running the LTTng-tools tests (test_valid_filter, for example) under
address sanitizer results in the following warning:

  /usr/include/lttng/urcu/static/urcu-ust.h:155:6: runtime error: member access within misaligned address 0x7fc45db3a020 for type 'struct lttng_ust_urcu_reader', which requires 128 byte alignment
  0x7fc45db3a020: note: pointer points here
   c4 7f 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
                ^

While the node member of lttng_ust_urcu_reader has an "aligned"
attribute of CAA_CACHE_LINE_SIZE, the compiler can't ensure the
alignment of members for dynamically allocated instances.

The `data` pointer is changed from char* to struct
lttng_ust_urcu_reader*, allowing the compiler to enforce the expected
alignment constraints.

Since `data` was addressed in bytes, the code using this field is
adapted to use element counts. As the chunks are only used to allocate
reader instances (and not other types), it makes the code a bit easier
to read.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ic826cf94444681bea3a192d3a9f4262a0961e948
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 3019 11 months ago Mathieu Desnoyers fix: python agent: use stdlib distutils when setup 25 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