]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Skip memory read errors in read_process_memory()
authorJouni Malinen <j@w1.fi>
Sun, 10 Dec 2023 19:38:46 +0000 (21:38 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 10 Dec 2023 19:38:46 +0000 (21:38 +0200)
It looks like the lifetime_in_memory test cases can hit a read failure
(Errno 5 - Input/output error) every now and then, so skip memory areas
that report that, but go through all readable process memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_psk.py

index 34086cd55d91535932f45d04254d209a8257d4d6..a8daa28612f500eb107adb654aadaed50dbc9341 100644 (file)
@@ -2621,8 +2621,12 @@ def read_process_memory(pid, key=None):
             for name in ["[heap]", "[stack]"]:
                 if name in l:
                     logger.info("%s 0x%x-0x%x is at %d-%d" % (name, start, end, len(buf), len(buf) + (end - start)))
-            mem.seek(start)
-            data = mem.read(end - start)
+            try:
+                mem.seek(start)
+                data = mem.read(end - start)
+            except OSError as e:
+                logger.info("Could not read mem: start=%d end=%d: %s" % (start, end, str(e)))
+                continue
             buf += data
             if key and key in data:
                 logger.info("Key found in " + l)