[issue44232] Crash in Objects/typeobject.c

2021-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, it's now fixed in 3.10 and main branches. Thanks for the bug report, and 
thanks Ken Jin for your PR ;-)

--
priority: release blocker -> 
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44232] Crash in Objects/typeobject.c

2021-05-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7b3b6982a5683f5146ede58a448d3edb777e501b by Miss Islington (bot) 
in branch '3.10':
bpo-44232: Fix type_new() error reporting (GH-26359) (GH-26365)
https://github.com/python/cpython/commit/7b3b6982a5683f5146ede58a448d3edb777e501b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +24956
pull_request: https://github.com/python/cpython/pull/26365

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bd199e72fb60a8ff001a023f23925092a290be91 by Victor Stinner in 
branch 'main':
bpo-44232: Fix type_new() error reporting (GH-26359)
https://github.com/python/cpython/commit/bd199e72fb60a8ff001a023f23925092a290be91


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:

> We noticed a behavior change in [1].

Hey, well done bisection, you're right, it's a regression of my large 
type_new() refactoring in bpo-43770.

I wrote PR 26359 to fix it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +24951
pull_request: https://github.com/python/cpython/pull/26359

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread Ken Jin


Change by Ken Jin :


--
keywords: +patch
pull_requests: +24950
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26358

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread Ken Jin


Ken Jin  added the comment:

Alright, I got a minimum reproducible example:

class XBase(type):
def __new__(cls, name, bases, attrs, **kwargs):
attrs.pop('__module__')
return super().__new__(cls, name, bases, attrs, **kwargs)

class X(metaclass=XBase): ...

type('A', (X, ), {})


This triggers it, sending patch soon.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread Ken Jin


Ken Jin  added the comment:

Can you please try removing the `assert(type != NULL);` line at 
https://github.com/python/cpython/blob/main/Objects/typeobject.c#L3313 and see 
if it works for you? I suspect that `winner->tp_new()` may sometimes fail and 
*should* return NULL to indicate that in those cases, so the assert may not 
always hold.

--
nosy: +kj

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread Mariusz Felisiak


New submission from Mariusz Felisiak :

We noticed a behavior change in [1]. One of our tests 
`apps.tests.AppsTests.test_model_clash()`[2] crashes with:

python: Objects/typeobject.c:3219: type_new: Assertion `type != NULL' failed.
Fatal Python error: Aborted

Current thread 0x7ffa6951a280 (most recent call first):
  File "django/tests/apps/tests.py", line 301 in test_model_clash
  File "cpython/Lib/unittest/case.py", line 549 in _callTestMethod
  File "cpython/Lib/unittest/case.py", line 592 in run
  File "cpython/Lib/unittest/case.py", line 652 in __call__
  File "django/django/test/testcases.py", line 283 in _setup_and_call
  File "django/django/test/testcases.py", line 247 in __call__
  File "cpython/Lib/unittest/suite.py", line 122 in run
  File "cpython/Lib/unittest/suite.py", line 84 in __call__
  File "cpython/Lib/unittest/runner.py", line 176 in run
  File "django/django/test/runner.py", line 705 in run_suite
  File "django/django/test/runner.py", line 772 in run_tests
  File "django/tests/./runtests.py", line 332 in django_tests
  File "django/tests/./runtests.py", line 596 in 
Aborted (core dumped)

This can be an issue is our test which is quite tricky. I will try to 
investigate it.

[1] 
https://github.com/python/cpython/commit/ecf14e6557c6e4f7af9c0d6460d31fe121c22553
[2] 
https://github.com/django/django/blob/7e51893911237dfca9294e3ca12163ff813fb656/tests/apps/tests.py#L274-L309

--
components: Interpreter Core
messages: 394330
nosy: felixxm, vstinner
priority: normal
severity: normal
status: open
title: Crash in Objects/typeobject.c
type: crash
versions: Python 3.10, Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com