[issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c

Łukasz Langa report at bugs.python.org
Fri Jul 23 10:43:45 EDT 2021


Łukasz Langa <lukasz at langa.pl> added the comment:

I'm still unable to reproduce this locally. Objects/listobject.c:527:24 is this line in `list_concat`:

    dest = np->ob_item + Py_SIZE(a);

(permalink: https://github.com/python/cpython/blob/8f42106b5c362495f72c6ca2fa3884538e4023db/Objects/listobject.c#L527)

This can only be problematic if `ob_item` of the new list is NULL *AND* list `a` is non-empty. In practice that's impossible because if `a` is non-empty, it would already populate `np` with its elements using the for-loop right above the line in question.

So this sounds like the compiler complaining about NULL + 0 which seems unnecessary?

By the way, instead of messing with CC, it's preferred to use the --with-undefined-behavior-sanitizer option to ./configure.

We could accept Serhiy's change but I'm afraid that without a reliable way to reproduce, this will regress at some point.

----------

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


More information about the Python-bugs-list mailing list