sdb icon indicating copy to clipboard operation
sdb copied to clipboard

lxlist and friends would benefit from having a declared input_type

Open sdimitro opened this issue 5 years ago • 1 comments

sdb> spl_kmem_caches | filter obj.skc_name == "zio_data_buf_131072" | member skc_complete_list skc_partial_list | lxlist spl_kmem_slab_t sks_list | cnt
sdb encountered an internal error due to a bug. Here's the
information you need to file the bug:
----------------------------------------------------------
Target Info:
        ProgramFlags.IS_LINUX_KERNEL
        Platform(<Architecture.X86_64: 1>, <PlatformFlags.IS_LITTLE_ENDIAN|IS_64_BIT: 3>)

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/internal/repl.py", line 85, in eval_cmd
    for obj in invoke(self.target, [], input_):
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/pipeline.py", line 165, in invoke
    yield from execute_pipeline(first_input, pipeline)
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/pipeline.py", line 83, in execute_pipeline
    yield from massage_input_and_call(pipeline[-1], this_input)
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/pipeline.py", line 43, in massage_input_and_call
    yield from cmd.call(objs)
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/command.py", line 290, in call
    result, not issubclass(self.__class__, SingleInputCommand))
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/command.py", line 251, in __invalid_memory_objects_check
    for obj in objs:
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/commands/count.py", line 56, in _call
    yield sdb.create_object('unsigned long long', sum(1 for _ in objs))
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/commands/count.py", line 56, in <genexpr>
    yield sdb.create_object('unsigned long long', sum(1 for _ in objs))
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/pipeline.py", line 83, in execute_pipeline
    yield from massage_input_and_call(pipeline[-1], this_input)
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/pipeline.py", line 43, in massage_input_and_call
    yield from cmd.call(objs)
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/command.py", line 290, in call
    result, not issubclass(self.__class__, SingleInputCommand))
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/command.py", line 251, in __invalid_memory_objects_check
    for obj in objs:
  File "/usr/local/lib/python3.6/dist-packages/sdb-0.1.0-py3.6.egg/sdb/commands/linux/linked_lists.py", line 81, in _call
    yield from list_for_each_entry(sname, obj, self.args.member)
  File "/usr/local/lib/python3.6/dist-packages/drgn-0.0.2+19.g6e0a106-py3.6-linux-x86_64.egg/drgn/helpers/linux/list.py", line 152, in list_for_each_entry
    for pos in list_for_each(head):
  File "/usr/local/lib/python3.6/dist-packages/drgn-0.0.2+19.g6e0a106-py3.6-linux-x86_64.egg/drgn/helpers/linux/list.py", line 123, in list_for_each
    while pos != head:
TypeError: invalid operands to comparison ('struct list_head *' and 'struct list_head')
----------------------------------------------------------

sdimitro avatar Feb 25 '20 17:02 sdimitro

The problem is that I keep forgetting to correct the query.

Currently wrong: .... | member <blah> | lxlist ... Currently correct way: ... | member <blah> | addr | lxlist ...

sdimitro avatar Feb 25 '20 17:02 sdimitro