Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
crash.types.page: catch TypeError for missing CONFIG_NODES_SHIFT
On system without CONFIG_NODES_SHIFT in config referncing config["NODE_SHIFT"]
returns a NoneType instead of a KeyError, this results in a TypeError execption
when NoneType is converted to integer.

Catch TypeError exception to fall back to hard coded value

Signed-off-by: Alexander Kamensky <alexander.kamensky42@gmail.com>
  • Loading branch information
Alexander Kamensky
Alexander Kamensky committed Nov 13, 2020
commit 19d63722de7a5abd9a26910659149cf11f834939
2 changes: 1 addition & 1 deletion crash/types/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def setup_nodes_width(cls, symbol: Union[gdb.Symbol, gdb.MinSymbol]) -> None:
# TODO: handle kernels with no space for nodes in page flags
try:
cls.NODES_WIDTH = int(config['NODES_SHIFT'])
except (KeyError, DelayedAttributeError):
except (KeyError, TypeError, DelayedAttributeError):
# XXX
print("Unable to determine NODES_SHIFT from config, trying 8")
cls.NODES_WIDTH = 8
Expand Down