Skip to content

Commit e778d09

Browse files
committed
rds: fix crash on NULL task
It seems that sometimes the task could be NULL, and in this case we should allow the module to continue executing. Orabug: 38225232 Signed-off-by: Stephen Brennan <[email protected]>
1 parent e1d269f commit e778d09

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drgn_tools/rds.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import drgn
2222
from drgn import cast
2323
from drgn import container_of
24+
from drgn import FaultError
2425
from drgn import Object
2526
from drgn import PlatformFlags
2627
from drgn import Program
@@ -1090,12 +1091,12 @@ def rds_sock_info(
10901091
pid: Any = int(sock.rs_pid.value_())
10911092
task = find_task(prog, pid)
10921093
comm: Any = "".join(re.findall('"([^"]*)"', str(task.comm)))
1093-
except AttributeError:
1094+
except (AttributeError, FaultError):
10941095
pid = "N/A"
10951096
comm = "N/A"
10961097
try:
10971098
cong: Any = int(sock.rs_congested)
1098-
except AttributeError:
1099+
except (AttributeError, FaultError):
10991100
cong = "N/A"
11001101
send_buf = rds_sk_sndbuf(sock)
11011102
recv_buf = rds_sk_rcvbuf(sock)

0 commit comments

Comments
 (0)