functional2: attach debugging tools #850
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#850
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When I'm debugging some tests, I would like to be able to attach common diagnostic tools (e.g. strace, ltrace, perf, gdb, rr, dump the mount namespace view (
findmnt -T
)) to some of the inner processes.Motivation
just test --gdb
is mostly useless because it's not aware this needs to be attached to some of the inner processes.When debugging the problem with
sandbox = true
forwhy-depends
, I looked into it while comparingstrace
reports on theexecve
syscall, then inspected the mount namespaces views and realized… there was no sandbox for functional.Selecting the right target
A functional2 test can probably run multiple processes which are equally target for debugging, in general, I care about attaching the first failing process.
It might be desireable to attach things like the daemon.
Roadmap
Among top priorities,
rr
,gdb
andstrace
are going to be the most useful IMHO.The way I imagine this should work is that I should be able to run functional2 with some special options and it will prepend
strace
in the argv of some of the tests I care about, how to select the right process requires some UI design.cc @commentatorforall
as you would like to have multiple debugger options, i'd argue that the most simple way would be to put the selection into either an environment variable or into a flag for pytest.
the latter is probably more ideal, as one probably doesn't want to run pytest via meson as that would make it execute in parallel which brings a ton of debugging issues with it (as there are multiple pytest subprocesses already) and would make attach selection likely impossible to pull off
I have some ideas for the UI, but let me double check the UX.
Cases:
Tools are attached to potentially multiple processes and selecting the correct ones should ideally be as implicit as possible.
Tooling:
Both interactive and logging (where?, a file?,
stdout
andstderr
are already getting output from nix and pytest, which probably is undesirable to have fully mixed in with say strace output) tooling should be usable, good handling for at leastrr
,gdb
andstrace
should be provided.Notes:
It may be relatively hard to do the "rerun" of case 1 internally, it however may be more trivial to implement to rerun with an option that enables "debug the first test that failed the previous run" (there is a cache that stores this information.