[issue35810] Object Initialization Bug with Heap-allocated Types

2019-02-12 Thread Eddie Elizondo
Eddie Elizondo added the comment: Now, with that in mind - can you guys point me to the right thing to do now - how can we move this forward? :) * Should I write something up in python-dev/Discourse? * Do I need to update the PY_VERSION_HEX? * Do I need to write an entry in the Porting

[issue35810] Object Initialization Bug with Heap-allocated Types

2019-02-12 Thread Eddie Elizondo
Eddie Elizondo added the comment: Thanks for the thorough feedback Stefan! I would like to just add an extra thing to everything you already mentioned: This change will NEVER cause a crash. The change that we are introducing is an incref to a type object (no decrefs). Thus, there are

[issue35810] Object Initialization Bug with Heap-allocated Types

2019-02-12 Thread STINNER Victor
STINNER Victor added the comment: > I would suggest clear, open communication of this. It's solving a bug. It > makes CPython safer. It's not difficult to adapt your code, once you know > it's affected. The usual PY_VERSION_HEX guard will do it for you. I think we > should risk it. It

[issue35810] Object Initialization Bug with Heap-allocated Types

2019-02-12 Thread Stefan Behnel
Stefan Behnel added the comment: Victor asked me for a review, so, well, what should I say? The intention seems right, and the patch also looks good to me. >From the top of my head, I wouldn't know any problems this would produce with >Cython specifically, although it's worth testing. If we

[issue35810] Object Initialization Bug with Heap-allocated Types

2019-02-04 Thread Petr Viktorin
Petr Viktorin added the comment: I'll allocate time this week for the review. -- ___ Python tracker ___ ___ Python-bugs-list

[issue35810] Object Initialization Bug with Heap-allocated Types

2019-01-30 Thread Eddie Elizondo
Eddie Elizondo added the comment: Hi Petr, Please take a look at the Github PR. What do you think that's missing to move this forward? I'd be more than happy to add more documentation/testing to it. Let me know what you think -- ___ Python

[issue35810] Object Initialization Bug with Heap-allocated Types

2019-01-29 Thread Petr Viktorin
Petr Viktorin added the comment: I would very much like to see this fixed. Yes, it can make some extension types immortal, but I believe those types were relying on buggy behavior, and need to be fixed to prevent memory leaks. I think this is a big enough change to be mentioned in What’s

[issue35810] Object Initialization Bug with Heap-allocated Types

2019-01-25 Thread Stefan Behnel
Stefan Behnel added the comment: It seems right that a heap allocate object owns a reference to its (non-static) type. But the mere fact that you had to adapt stdlib code makes it obvious that this will also break existing user code out there. And such breakage is very likely to remain

[issue35810] Object Initialization Bug with Heap-allocated Types

2019-01-23 Thread Eddie Elizondo
Change by Eddie Elizondo : -- keywords: +patch, patch, patch pull_requests: +11461, 11462, 11463 stage: -> patch review ___ Python tracker ___

[issue35810] Object Initialization Bug with Heap-allocated Types

2019-01-23 Thread Eddie Elizondo
Change by Eddie Elizondo : -- keywords: +patch, patch pull_requests: +11461, 11462 stage: -> patch review ___ Python tracker ___

[issue35810] Object Initialization Bug with Heap-allocated Types

2019-01-23 Thread Eddie Elizondo
Change by Eddie Elizondo : -- keywords: +patch pull_requests: +11461 stage: -> patch review ___ Python tracker ___ ___

[issue35810] Object Initialization Bug with Heap-allocated Types

2019-01-23 Thread Eddie Elizondo
New submission from Eddie Elizondo : Heap-allocated Types initializing instances through `PyObject_{,GC}_New{Var}` will *NOT* not have their refcnt increased. This was totally fine under the assumption that static types are immortal. However, heap-allocated types MUST participate in