Issue 5787: object.getattribute(super, 'bases') crashes the interpreter. (original) (raw)

Created on 2009-04-18 17:45 by alexer, last changed 2022-04-11 14:56 by admin. 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
2022-04-11 14:56:47 admin set github: 50037
2009-04-19 02:33:13 benjamin.peterson set status: open -> closedmessages: +
2009-04-19 01:32:07 alexer set status: closed -> openmessages: +
2009-04-18 22:16:21 benjamin.peterson set status: open -> closed
2009-04-18 22:15:59 benjamin.peterson set messages: +
2009-04-18 20:50:13 alexer set status: closed -> openmessages: +
2009-04-18 20:21:27 akx set nosy: + akxmessages: +
2009-04-18 20:13:19 benjamin.peterson set status: open -> closednosy: + benjamin.petersonmessages: + resolution: fixed
2009-04-18 17:45:17 alexer create