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

noreply@sourceforge.net noreply@sourceforge.net
Thu, 20 Sep 2001 06:38:58 -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: Closed
>Resolution: Fixed
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: Guido van Rossum (gvanrossum)
Date: 2001-09-20 06:38

Message:
Logged In: YES 
user_id=6380

Fixed in object.c:2.151.

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

Comment By: Martin v. Löwis (loewis)
Date: 2001-09-20 00:37

Message:
Logged In: YES 
user_id=21627

Works fine, thanks.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-19 20:33

Message:
Logged In: YES 
user_id=6380

Try this.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-19 10:35

Message:
Logged In: YES 
user_id=6380

Ouch, you're right. I'll remove all the silly tests to avoid 
a tiny bit of work under unusual circumstances. Right now 
I'm not at a place where I can prepare a patch for upload, 
sorry.

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

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