Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Closed
Description
Crash report
What happened?
The below example stores an integer counter as a class variableC.counter
. Incrementing the counter usingC.counter += 1
between 2^32 - 2^24 and 2^32 times makes the Python 3.12.1 interpreter crash (after about 30 min) .
Tested with Python 3.12.1 on Windows 11.
# Windows 11: Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32# CPython interpreter crashes, last printed value: 4278190080 = 2**32 - 2**24classC:counter=0# Class variablewhileTrue:C.counter+=1# Increment class variableifC.counter&0b111111111111111111111111==0:print(C.counter)
(In the original application, the class was a wrapper class implementing__lt__
to count the number of comparisons performed by various algorithms)
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Output from running 'python -VV' on the command line:
Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)]