Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
Crash report
The following code will causes a segmentation fault:
>>>importdecimal>>>tp=type(decimal.Context().flags)# SignalDict type>>>tp()# Segmentation fault
This code instantiates an object ofSignalDict type (inherited from the base classSignalDictMixin) and tries to print the contents of the object (userepr).
The problem is caused by the following C code, where thesignaldict_repr functionaccesses a null pointer.
staticintsignaldict_init(PyObject*self,PyObject*argsUNUSED,PyObject*kwdsUNUSED){SdFlagAddr(self)=NULL;return0;}...staticPyObject*signaldict_repr(PyObject*self){ ...for (cm=signal_map,i=0;cm->name!=NULL;cm++,i++) {n[i]=cm->fqname;// Access NULL pointer hereb[i]=SdFlags(self)&cm->flag ?"True" :"False"; } ...}
Your environment
- CPython versions tested on: 3.13.0.0a0, 3.10.2
- Operating system and architecture: Ubuntu 22.04.1 LTS, Windows 11