[Python-bugs-list] [ python-Bugs-462848 ] test_descr causes unaligned access

noreply@sourceforge.net noreply@sourceforge.net
Wed, 19 Sep 2001 06:40:55 -0700


Bugs item #462848, was opened at 2001-09-19 05:16
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470

Category: Type/class unification
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Guido van Rossum (gvanrossum)
Summary: test_descr causes unaligned access

Initial Comment:
On SPARC Solaris 2.8, test_descr causes a crash with an
unaligned access. The specific line of the crash is in
subtype_dealloc

PyObject *dict = *dictptr;

Here, the type is "L", tp_basicsize is 18, and
tp_dictoffset is -4. In turn, tries to fetch a pointer
at offset 14 relative to self, which is an unaligned
access.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2001-09-19 06:40

Message:
Logged In: YES 
user_id=21627

That doesn't help. The value of n, in

int n = ((PyVarObject *)obj)->ob_size;

is zero, so the code doing the alignment is skipped.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-19 06:25

Message:
Logged In: YES 
user_id=6380

Ouch. There was code to align the dictptr but it didn't
count on the basicsize being unaligned. Try this patch.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=462848&group_id=5470