]> code.ossystems Code Review - openembedded-core.git/commit
dwarfsrcfiles: Avoid races over debug-link files
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 6 Jul 2021 10:36:16 +0000 (11:36 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 7 Jul 2021 10:38:57 +0000 (11:38 +0100)
commitefef732859e265533acf16f2f4da3b29d50e0df4
tree215fa7c69bcd50377680782c111bd17ab0caf28e
parent5f4f9529b89b7e3357f6b979bb7d97c4c937d44c
dwarfsrcfiles: Avoid races over debug-link files

We use dwarfsrcfiles in package.bbclass to list the source files used by a binary.
This is done before they're stripped and linked to debug symbols in separate files.

It is possible a binary may already have a link to separate debug symbols, e.g.
some of the test binaries in lttng-tools ptest. In those cases, the linked binary
may be changed by package.bbclass code whilst dwarfsrcfiles is reading it. That
would result in a rare SIGBUS race causing the binary to fail.

To avoid this, break the debug file search path so no other binaries are found.

Also fix a segfault if no binary is specified while here.

[YOCTO #14400]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/dwarfsrcfiles/files/dwarfsrcfiles.c