[New-bugs-announce] [issue37138] PEP 590 method_vectorcall calls memcpy with NULL src

Gregory P. Smith report at bugs.python.org
Mon Jun 3 00:16:10 EDT 2019


New submission from Gregory P. Smith <greg at krypto.org>:

The undefined behavior sanitizer buildbot is flagging a bunch of issues in master (3.8) of late:

AssertionError: 'Objects/classobject.c:74:29: runtime erro[139 chars]re\n' != ''
- Objects/classobject.c:74:29: runtime error: null pointer passed as argument 2, which is declared to never be null
- /usr/include/string.h:43:28: note: nonnull attribute specified here

 (see https://buildbot.python.org/all/#/builders/135/builds/1937/steps/5/logs/stdio)

This appears to be coming from a relatively new classobject.c:method_vectorcall() function

method_vectorcall(PyObject *method, PyObject *const *args,
                  size_t nargsf, PyObject *kwnames)

Which looks like it is probably being called with NULL args value and thus winds up calling memcpy() with src=NULL.

This was introduced in https://github.com/python/cpython/commit/aacc77fbd77640a8f03638216fa09372cc21673d for the PEP 590 implementation.

----------
assignee: Mark.Shannon
components: Interpreter Core
messages: 344378
nosy: Mark.Shannon, gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: PEP 590 method_vectorcall calls memcpy with NULL src
type: behavior
versions: Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list