<arigato>
afaict, the new immortal objects refcount hack in 3.12 will crash if you try to make and free a list of 2**32 copies of the same, non-immortal object (nowadays it takes only 32GB of RAM, so it's quite doable)
<arigato>
OK, so far it's not a crash but just an accidentally immortalized object. You can get a crash though if you combine it with a stable ABI extension, like this: give a reference to the extension, then build the list, then have the extension release its reference, then delete the list. This will crash hard
<krono>
😬
<arigato>
e.g. if you made the singleton object with "a = A()" at the start, then a will effectively be freed and any "print(a)" will explode
<arigato>
ah, 2**31 copies might be enough (16GB of RAM)
<arigato>
no, what? the limit is at 2**32 in Py_INCREF and 2**31 in Py_DECREF. might be intentional, too: it makes the crash a lot harder
<arigato>
you'd need to give the old stable ABI extension the same object 2**31 times, and then take other references somewhere else until you reach 2**32, then delete the 2**31 references in the extension; then you're in trouble
<arigato>
(a similar problem occurs with stable ABI extensions compiled with 3.12 but executed with older Python versions)
<arigato>
oh well, I guess nobody does that. Oops, numpy arrays can contain objects? I guess you can initialize an array with a constant object, which would create a large number of references out of the box? Oops
<hexology>
arigato: numpy arrays containing objects is less unusual than you might think. pandas historically used numpy arrays of native python strings to represent text data. they're transitioning to a different model, but there's a huge amount of code out there that uses the old numpy-object setup.
<hexology>
and numpy-object arrays are actually still the default for strings in pandas
<LarstiQ>
I didn't read arigato's "I guess nobody does that" followed by oopses as being surprised by that
<hexology>
oh, i see
xcm_ has joined #pypy
xcm has quit [Read error: Connection reset by peer]
slav0nic has joined #pypy
sugarbeet has quit [Ping timeout: 240 seconds]
sugarbeet has joined #pypy
<lazka>
uh, indeed, 3.12 is 20% slower here for my fastapi app :(