[issue44363] Address sanitizer (gcc version) is generating false positives

Pablo Galindo Salgado report at bugs.python.org
Wed Jun 9 12:53:40 EDT 2021


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

commit e858ea15718709bc8ec3c13bd8451ff7d62cbe80 (HEAD -> specialize-load-attr)
Author: Mark Shannon <mark at hotpy.org>
Date:   Wed Jun 9 09:33:13 2021 +0100

    Assert that address is in bounds (ASAN thinks it might not be).

diff --git a/Python/ceval.c b/Python/ceval.c
index 06a02b40f9..784d0244e8 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3517,6 +3517,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
             DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR);
             PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner)->md_dict;
             DEOPT_IF(dict->ma_keys->dk_version != cache1->dk_version_or_hint, LOAD_ATTR);
+            assert(cache0->index < dict->ma_keys->dk_nentries);
             PyDictKeyEntry *ep = DK_ENTRIES(dict->ma_keys) + cache0->index;
             res = ep->me_value;
             DEOPT_IF(res == NULL, LOAD_ATTR);

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44363>
_______________________________________


More information about the Python-bugs-list mailing list