Skip to content

Conversation

@delphix-devops-bot
Copy link
Collaborator

No description provided.

ahrens and others added 30 commits March 27, 2020 12:40
The dbuf command can select dbufs that match certain parameters (e.g.
'-l 1' for level-1 dbufs).  This works when `dbuf` is the first command
in the pipeline, and when it is used as a locator with a dnode_t* as
input.  But it doesn't work in other circumstances, for example
when it's being used only as a pretty-printer (with the list of dbufs
piped in), or when it's used in the middle of a pipeline.

This change adds the filter calls to this use cases, and adds
corresponding test cases
Introduce type_canonicalize_size() to target API
feature: allow alternate paths for history file

= Issue

Having a history file created using sudo first then trying to use SDB
on a crash dump without sudo:
```
$ sdb vmlinux-5.0.0-36-generic dump.201912060006 -s mods
Traceback (most recent call last):
  File "/usr/bin/sdb", line 11, in <module>
    load_entry_point('sdb==0.1.0', 'console_scripts', 'sdb')()
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/internal/cli.py", line 215, in main
    repl.enable_history(os.getenv('SDB_HISTORY_FILE', '~/.sdb_history'))
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/internal/repl.py", line 79, in enable_history
    readline.read_history_file(self.histfile)
PermissionError: [Errno 13] Permission denied
...(sdb exits)...
```

= Testing

With this patch we print a warning and drive on:
```
$ sdb vmlinux-5.0.0-36-generic dump.201912060006 -s mods
Warning: You don't have permissions to read ~/.sdb_history and
         the command history of this session won't be saved.
         Either change this files permission, recreate this file,
         or use an alternate path with the SDB_HISTORY_FILE
         environment variable.
sdb> addr spa_namespace_avl
(avl_tree_t *)spa_namespace_avl+0x0 = 0xffffffffc07d0fe0
```

Again with this patch in the same situation, we can provide an
alternative path:
```
$ SDB_HISTORY_FILE=./test-history sdb vmlinux-5.0.0-36-generic dump.201912060006 -s mods
sdb> addr init_task
(struct task_struct *)init_task+0x0 = 0xffffffff8c817740
sdb> spa
ADDR               NAME
------------------------------------------------------------
0xffffa0894e720000 data
0xffffa089413b8000 meta-domain
0xffffa08955c44000 rpool
sdb>
(^D)

$ cat test-history
addr init_task
spa

$ # running sdb with the same history file we ensure that it works
$ SDB_HISTORY_FILE=./test-history sdb vmlinux-5.0.0-36-generic dump.201912060006 -s mods
sdb> spa
ADDR               NAME
------------------------------------------------------------
0xffffa0894e720000 data
0xffffa089413b8000 meta-domain
0xffffa08955c44000 rpool
```

= Other Notes

This patch also helps with situations where SDB gets stuck because the
filesystem backing its history file has crashed and it cannot append
anything to it. For cases like these with the above patch we should
be able to get unstuck by specifying SDB_HISTORY_FILE=/dev/null, like
this:

```
$ SDB_HISTORY_FILE=/dev/null sdb vmlinux-5.0.0-36-generic dump.201912060006 -s mods
sdb> addr spa_namespace_avl
(avl_tree_t *)spa_namespace_avl+0x0 = 0xffffffffc07d0fe0
```

= Github Issue Tracker Automation

Closes #56
= Issue

Specifying a wrong argument for a crash dump shows the following error:
```
$ sdb vmlinux-5.0.0-36-generic bogus.dump -s mods
Traceback (most recent call last):
  File "/usr/bin/sdb", line 11, in <module>
    load_entry_point('sdb==0.1.0', 'console_scripts', 'sdb')()
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/internal/cli.py", line 209, in main
    prog = setup_target(args)
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/internal/cli.py", line 157, in setup_target
    prog.set_core_dump(args.core)
FileNotFoundError: [Errno 2] No such file or directory: 'bogus.dump'
```

= Patch

With this patch:
```
$ sdb vmlinux-5.0.0-36-generic bogus.dump -s mods
sdb: no such file: 'bogus.dump'
```
github-actions: upgrade to latest stable checkout module (v2)
Merge remote-tracking branch 'origin/master' into sync-with-master/6.0/stage
* pylint upgrade: fix new warnings (#218)

* Migrate "sync-with-master" to use "delphix/actions" (#217)

Co-authored-by: Serapheim Dimitropoulos <[email protected]>
Co-authored-by: Prakash Surya <[email protected]>
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
Reasoning: The copyrights will be included the debian packages and can be scanned on a deployed VM by Delphix's automation.
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
Prakash Surya and others added 9 commits September 16, 2020 13:32
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
Merge branch 'master' into '6.0/stage'
@delphix-devops-bot delphix-devops-bot merged commit 1d3bdba into master Jul 27, 2022
@delphix-devops-bot delphix-devops-bot deleted the projects/merge-upstream/master branch July 27, 2022 12:45
sdimitro pushed a commit to sdimitro/sdb-dlpx that referenced this pull request Aug 1, 2022
…aster

Merge remote-tracking branch '6.0/stage' into 'master' -
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.

7 participants