Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch 'master' into '6.0/stage' #24

Merged
merged 19 commits into from
Apr 6, 2021
Merged

Merge branch 'master' into '6.0/stage' #24

merged 19 commits into from
Apr 6, 2021

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Apr 3, 2021

No description provided.

osandov and others added 19 commits April 2, 2021 10:30
It's undefined behavior to pass NULL to memcpy() even if the length is
zero. See also commit a17215e ("libdrgn: dwarf_index: fix memcpy()
undefined behavior").

Signed-off-by: Omar Sandoval <[email protected]>
drgn_object_reinit() and drgn_object_copy() can both load from an
uninitialized little_endian field, causing UBSan errors like:

  libdrgn/object.h:105:27: runtime error: load of value 68, which is not a valid value for type '_Bool'

This only happens when little_endian isn't valid for the type and won't
be used anyways, but it's easy enough to work around.

Signed-off-by: Omar Sandoval <[email protected]>
There are a couple of places where we compute `NULL + 0`, which is
undefined behavior. Add a helper to do this safely.

Signed-off-by: Omar Sandoval <[email protected]>
See commit 0cb77b3 ("libdrgn: work around Clang __muloti4 again")
and commit 2dd14ad ("libdrgn: work around "undefined reference to
'__muloti4'" when using Clang"). These keep sneaking in because I don't
have an old enough version of Clang lying around.

Signed-off-by: Omar Sandoval <[email protected]>
Clang enables -Wgnu-variable-sized-type-not-at-end by default, which
warns for DRGN_CFI_ROW():

  arch_x86_64.c:735:27: warning: field 'row' with variable sized type 'struct drgn_cfi_row' not at the end of a struct or class is a GNU extension
        [-Wgnu-variable-sized-type-not-at-end]
          .default_dwarf_cfi_row = DRGN_CFI_ROW(

DRGN_CFI_ROW() is gnarly anyways, so instead of having it expand to a
pointer expression relying on this GCC extension, make it expand to an
initializer. Then, we can initialize default_dwarf_cfi_row as a separate
variable rather than directly in the initializer for struct
drgn_architecture_info.

This still relies on a GCC extension for static initialization of
flexible array members, but apparently Clang is okay with that one by
default (-Wgnu-flexible-array-initializer must be enabled explictly or
by -Wgnu or -Wpedantic).

Signed-off-by: Omar Sandoval <[email protected]>
The folly implementation calls this elsewhere, but we only need it in
table##_chunk_mark_eof(), so it was folded in there.

Signed-off-by: Omar Sandoval <[email protected]>
GCC doesn't warn about table##_delete_iterator() being unused because it
is inline, but Clang does, so add the unused attribute.

Signed-off-by: Omar Sandoval <[email protected]>
Everytime I try to build drgn with Clang, there are a few things that
need fixing. Let's test it so that it stays in good shape.

Signed-off-by: Omar Sandoval <[email protected]>
This is the documented way that drgn should be built for development, so
let's enforce it.

Signed-off-by: Omar Sandoval <[email protected]>
Apparently the latter is deprecated and the former is preferred.

Signed-off-by: Omar Sandoval <[email protected]>
We don't actually want make clean to remove the generated files that are
included in a distribution tarball, because then the user will need to
regenerate them, and they might not have the dependencies installed.

Signed-off-by: Omar Sandoval <[email protected]>
Signed-off-by: Omar Sandoval <[email protected]>
With the added Clang tests, apparently vmtest is generating excessive
traffic on Dropbox. Disable it on GitHub Actions until I can work out a
new solution.

Signed-off-by: Omar Sandoval <[email protected]>
@prakashsurya prakashsurya merged commit 23f4407 into 6.0/stage Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants