classification
Title: object.__getattribute__(super, '__bases__') crashes the interpreter.
Type: crash Stage:
Components: Interpreter Core Versions: Python 3.0, Python 2.4, Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: akx, alexer, benjamin.peterson
Priority: normal Keywords:

Created on 2009-04-18 17:45 by alexer, last changed 2009-04-19 02:33 by benjamin.peterson. This issue is now closed.

Messages (7)
msg86126 - (view) Author: Aleksi Torhamo (alexer) * Date: 2009-04-18 17:45
object.__getattribute__(super, '__bases__') crashes the interpreter.

It seems to happen at Objects/typeobject.c in type_get_bases(), when
tp_bases is NULL.

Crashing types in __builtins__ per version would seem to be:
python2.4: slice frozenset super staticmethod float enumerate long
xrange tuple reversed property complex buffer classmethod
python2.5: slice frozenset super staticmethod float enumerate long
xrange reversed property complex buffer classmethod
python2.6: slice super staticmethod float enumerate long xrange reversed
python3.0: memoryview slice super filter range staticmethod float
enumerate reversed map

2.7 and 3.1 not tested since i don't have them installed.
msg86137 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-04-18 20:13
Should be fixed in r71722.
msg86139 - (view) Author: Aarni Koskela (akx) Date: 2009-04-18 20:21
The r71722 patch has several typos (replace initalize with initialize).
msg86140 - (view) Author: Aleksi Torhamo (alexer) * Date: 2009-04-18 20:50
Just verified that r71722 fixes all the builtins, however i just noticed
that some types under module types cause segfaults too.

Under python2.7 those are: CodeType BuiltinMethodType DictProxyType
GeneratorType GetSetDescriptorType EllipsisType FrameType InstanceType
MemberDescriptorType

Not sure, but i'm guessing there might be yet more types somewhere, that
need fixing (as the only places i've looked at are __builtins__ and
types - the first ones to cause problems/come to mind). Would there be
some way to find out all defined types, or to fix this for all types in
a single place?
msg86142 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-04-18 22:15
The rest should be fixed in r71734.
msg86152 - (view) Author: Aleksi Torhamo (alexer) * Date: 2009-04-19 01:32
Stumbled upon a few more.

python2.4/2.5: socket.SSLType re._pattern_type weakref.ProxyType
weakref.CallableProxyType
python2.6/2.7: weakref.ProxyType weakref.CallableProxyType
python3.0: weakref.ProxyType weakref.CallableProxyType _abcoll.dict_proxy

I'll also mention MLab.arraytype and MLab.UfuncType, though they are in
a third-party module..

Btw, should this be kept open until this is backported to 2.4/2.5 as well?
msg86154 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-04-19 02:33
Fixed the ones applicable to 2.7/2.6 in r71738. These fixes won't be
backported to 2.4/2.5.
History
Date User Action Args
2009-04-19 02:33:13benjamin.petersonsetstatus: open -> closed

messages: + msg86154
2009-04-19 01:32:07alexersetstatus: closed -> open

messages: + msg86152
2009-04-18 22:16:21benjamin.petersonsetstatus: open -> closed
2009-04-18 22:15:59benjamin.petersonsetmessages: + msg86142
2009-04-18 20:50:13alexersetstatus: closed -> open

messages: + msg86140
2009-04-18 20:21:27akxsetnosy: + akx
messages: + msg86139
2009-04-18 20:13:19benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg86137

resolution: fixed
2009-04-18 17:45:17alexercreate