forked from osandov/drgn
-
Notifications
You must be signed in to change notification settings - Fork 6
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
DLPX-88975 update-package failed with a merge conflict in the drgn branch #58
Merged
manoj-joseph
merged 12 commits into
develop
from
dlpx/pr/manoj-joseph/c88f8ddf-7659-4b0e-aea7-4e496eacfb1a
Dec 1, 2023
Merged
DLPX-88975 update-package failed with a merge conflict in the drgn branch #58
manoj-joseph
merged 12 commits into
develop
from
dlpx/pr/manoj-joseph/c88f8ddf-7659-4b0e-aea7-4e496eacfb1a
Dec 1, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vermin 1.6.0 was recently released, which contains a fix for netromdk/vermin#230. This was a rather odd corner case, in which Vermin would fail when code was compatible with 2.x and 3.x, yet the command line only required compatibility with 3.x. Since pre-commit runs against only files that changed, this was possible, for example with small test files. I'm not sure if I encountered it in drgn (I know I did with drgn-tools), but it's good to have the fix. I used pre-commit autoupdate, so we have the latest version of each hook now. In particular, this commit surpasses mypy 0.971, which is the last version to support Python 3.6 at runtime. Mypy still supports targeting Python 3.6[1]. [1]: https://mypy-lang.blogspot.com/2022/07/mypy-0971-released.html Two new errors were surfaced with the new hooks: 1. Mypy complained about the pattern "os.exit(exception)". I've replaced these so they explicitly use str: "os.exit(str(exception))". drgn/cli.py:283: error: Argument 1 to "exit" has incompatible type "OSError"; expected "str | int | None" [arg-type] 2. Vermin complained that "int.is_integer()" was introduced 3.12. I surmised that it was unable to infer that its usage was guaranteed to be against a float, and the reason was due to the division operation against an integer. I changed the integer literal to a float literal, which resolved the issue. !2, 3.12 drgn/helpers/common/format.py 'int.is_integer' member requires !2, 3.12 Signed-off-by: Stephen Brennan <[email protected]>
Since updating pre-commit hooks, Python 3.6 and 3.7 will no longer pass pre-commit runs. Skip installing and running pre-commit/mypy on the unsupported versions of Python. To do this, we (ab)use Bash's regex to detect supported versions, and set an environment variable when pre-commit should be used. Then, we (ab)use parameter expansion syntax and Github Actions if-conditionals to decide whether to skip/run. Signed-off-by: Stephen Brennan <[email protected]>
Since updating pre-commit and the hooks, development on EOL Python versions is no longer supported, and will fail. Update the contributing guide to explain that Python 3.6 is supported for build, runtime, and tests, but development workflow scripts require a supported Python version. Repeat this warning in the pre-commit section, where it is most relevant. Signed-off-by: Stephen Brennan <[email protected]>
To allow logging in the function, let it take prog as a parameter. OTOH the file descriptor then need not be passed separately. Signed-off-by: Petr Tesarik <[email protected]>
Reduce the error to a warning. Support for the flattened KDUMP format was added in libkdumpfile-0.5.3, so a sufficiently recent libkdumpfile can open flattened files directly. However, the flattened file format requires scanning the whole file first to build a map of flattened file segments, so opening a large file may be too slow. Issue a warning, so users know they have the option to reassemble the vmcore. Signed-off-by: Petr Tesarik <[email protected]>
Return DRGN_ERROR_INVALID_ARGUMENT with a reasonable error message if libkdumpfile cannot open a file. The error output currently looks something like: Traceback (most recent call last): File "/research/bin/drgn", line 33, in <module> sys.exit(load_entry_point('drgn', 'console_scripts', 'drgn')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/research/src/drgn/drgn/cli.py", line 264, in _main prog.set_core_dump(args.core) Exception: kdump_set_number_attr(KDUMP_ATTR_FILE_FD): File #0: Unknown file format Replace it with this: error: file #0: Unknown file format This is similar to the error message when trying to open a file that is neither KDUMP nor ELF: error: not an ELF core file Signed-off-by: Petr Tesarik <[email protected]>
…ernel tasks Sometimes I need to enumerate all tasks in the system and print their command lines, among other information. This fails for kernel tasks (i.e. tasks without mm): Traceback (most recent call last): File "<console>", line 2, in <module> File "[...]/drgn/helpers/linux/mm.py", line 1276, in cmdline arg_start = mm.arg_start.value_() ^^^^^^^^^^^^^^^^^^^^^ _drgn.FaultError: address is not mapped: 0x140 It seems reasonable for this not to cause an exception but rather to return a value that the caller can conveniently recover from (consider also the behavior of `cat /proc/2/cmdline`). Therefore, change cmdline() to return None for kernel tasks. Do the same for environ() for consistency. Signed-off-by: Peter Collingbourne <[email protected]>
Signed-off-by: Omar Sandoval <[email protected]>
It needed the linux_helper_task_iterator update and a fix for /proc/kcore upstream (fe2c34bab6d4 ("iov_iter: fix copy_page_to_iter_nofault()")). Signed-off-by: Omar Sandoval <[email protected]>
Signed-off-by: Omar Sandoval <[email protected]>
Signed-off-by: Omar Sandoval <[email protected]>
manoj-joseph
force-pushed
the
dlpx/pr/manoj-joseph/c88f8ddf-7659-4b0e-aea7-4e496eacfb1a
branch
from
November 30, 2023 17:47
72733fc
to
a7ed5be
Compare
manoj-joseph
force-pushed
the
dlpx/pr/manoj-joseph/c88f8ddf-7659-4b0e-aea7-4e496eacfb1a
branch
2 times, most recently
from
November 30, 2023 18:17
4ecc4fd
to
a758939
Compare
manoj-joseph
changed the title
Merge branch upstreams into develop
DLPX-88975 update-package failed with a merge conflict in the drgn branch
Nov 30, 2023
prakashsurya
approved these changes
Nov 30, 2023
manoj-joseph
force-pushed
the
dlpx/pr/manoj-joseph/c88f8ddf-7659-4b0e-aea7-4e496eacfb1a
branch
from
November 30, 2023 18:23
a758939
to
1cc659e
Compare
sumedhbala-delphix
approved these changes
Dec 1, 2023
manoj-joseph
deleted the
dlpx/pr/manoj-joseph/c88f8ddf-7659-4b0e-aea7-4e496eacfb1a
branch
December 1, 2023 18:11
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Solution
Fixed the conflict by deleting
.pre-commit-config.yaml