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

multilist / spl_list doesn't work on libzpool #196

Open
ahrens opened this issue Mar 6, 2020 · 0 comments
Open

multilist / spl_list doesn't work on libzpool #196

ahrens opened this issue Mar 6, 2020 · 0 comments
Labels
design bug Something isn't working due to the current design

Comments

@ahrens
Copy link
Contributor

ahrens commented Mar 6, 2020

when debugging a ztest process:

sdb> addr ARC_mru | member arcs_list[1] | multilist
sdb encountered an internal error due to a bug. Here's the
information you need to file the bug:
----------------------------------------------------------
Target Info:
	ProgramFlags.IS_LIVE
	Platform(<Architecture.X86_64: 1>, <PlatformFlags.IS_LITTLE_ENDIAN|IS_64_BIT: 3>)

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sdb/internal/repl.py", line 85, in eval_cmd
    for obj in invoke(self.target, [], input_):
  File "/usr/lib/python3/dist-packages/sdb/pipeline.py", line 166, in invoke
    yield from execute_pipeline(first_input, pipeline)
  File "/usr/lib/python3/dist-packages/sdb/pipeline.py", line 83, in execute_pipeline
    yield from massage_input_and_call(pipeline[-1], this_input)
  File "/usr/lib/python3/dist-packages/sdb/pipeline.py", line 66, in massage_input_and_call
    yield from cmd.call(objs)
  File "/usr/lib/python3/dist-packages/sdb/command.py", line 291, in call
    result, not issubclass(self.__class__, SingleInputCommand))
  File "/usr/lib/python3/dist-packages/sdb/command.py", line 252, in __invalid_memory_objects_check
    for obj in objs:
  File "/usr/lib/python3/dist-packages/sdb/command.py", line 612, in _call
    yield from self.walk(obj)
  File "/usr/lib/python3/dist-packages/sdb/commands/spl/multilist.py", line 33, in walk
    yield from sdb.execute_pipeline([sublist], [SPLList()])
  File "/usr/lib/python3/dist-packages/sdb/pipeline.py", line 83, in execute_pipeline
    yield from massage_input_and_call(pipeline[-1], this_input)
  File "/usr/lib/python3/dist-packages/sdb/pipeline.py", line 66, in massage_input_and_call
    yield from cmd.call(objs)
  File "/usr/lib/python3/dist-packages/sdb/command.py", line 291, in call
    result, not issubclass(self.__class__, SingleInputCommand))
  File "/usr/lib/python3/dist-packages/sdb/command.py", line 252, in __invalid_memory_objects_check
    for obj in objs:
  File "/usr/lib/python3/dist-packages/sdb/command.py", line 612, in _call
    yield from self.walk(obj)
  File "/usr/lib/python3/dist-packages/sdb/commands/spl/spl_list.py", line 32, in walk
    node = first_node.next
AttributeError: 'struct list_node' has no member 'next'
----------------------------------------------------------
Link: https://github.com/delphix/sdb/issues/new

Indeed, in libspl/libzfs, struct list_node does not have next:
lib/libspl/include/sys/list_impl.h:

struct list_node {
	struct list_node *list_next;
	struct list_node *list_prev;
};

Seems like the root of the problem is the difference between libzpool and zfs.ko. Ideally, sdb would have target-specific functionality (i.e. user vs kernel). In the absence of that, we might want to change libspl's list_node to mirror the linux kernel's

@ahrens ahrens changed the title multilist / spl_list doesn't seem to work multilist / spl_list doesn't work on libzpool Mar 6, 2020
@ahrens ahrens added the design bug Something isn't working due to the current design label Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design bug Something isn't working due to the current design
Development

No branches or pull requests

1 participant