Skip to content

UBSAN may produce unusable traces #108

@lzaoral

Description

@lzaoral

Even though csutils/csdiff#130 improves the situation, UBSAN does not guarantee that the path in the first entry of the backtrace will be absolute. E.g. the following report from coreutils will be silenced:

Error: UBSAN_WARNING:
  2 ../src/join.c:1375:45: runtime error: load of address 0x558317b96301 with insufficient space for an object of type 'char'
  3 0x558317b96301: note: pointer points here
  4 # 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  41 00 00 00 00
  5 #              ^-
  6 ../src/join.c:1375: note: single_binary_main_join() at 0x5583160e3481
  7 ../src/coreutils.c:128: note: launch_program() at 0x55831602d9ee
  8 ../src/coreutils.c:178: note: main() at 0x55831602a906
  9 /lib64/libc.so.6: note: __libc_start_call_main() at 0x7f5197649b49
 10 /lib64/libc.so.6: note: __libc_start_main_alias_2() at 0x7f5197649c0a
 11 coreutils-9.3/single/src/coreutils: note: _start() at 0x55831602ad34

We can use csexec to track the working directory and UBSAN logs from the given process and fix them afterwards. The log files end with the PID of the sanitized process, so it should be quite easy to track it because each child will have its own csexec execution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions