This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[thockin@cobaltnet.com] libc/1206: thread stack is misaligned on mips



Hi,

Tim Hockin send the appended bug report about a problem on MIPS with
glibc 2.0.7.  Since we're currently at glibc 2.1.x/2.2 and the MIPS
support is not working here, what shall we do?  Looking at the report
we still have this problem with the current sources.

Should we change linuxthreads/internals.h?  Or do we have to make this
a architecture specific solutions?

Andreas



Topics:
   libc/1206: thread stack is misaligned on mips


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

Date: Wed, 14 Jul 1999 10:55:01 -0700 (PDT)
From: thockin@cobaltnet.com
To: bugs@gnu.org
Subject: libc/1206: thread stack is misaligned on mips
Message-Id: <199907141755.KAA06786@brainy.cobaltnet.com>


>Number:         1206
>Category:       libc
>Synopsis:       stacks for threads are on 4 byte boundaries - bad on mips
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    libc-gnats
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Wed Jul 14 14:00:01 EDT 1999
>Last-Modified:
>Originator:     Tim Hockin
>Organization:
 Cobalt Networks		
>Release:        libc-2.0.7
>Environment:
	Cobalt (mips), linux glibc-2.0.7
Host type: mipsel-unknown-linux-gnu
System: Linux brainy.cobaltnet.com 2.0.34C48_SK #3 Tue Jul 13 21:32:39 PDT 1999 mips unknown
Architecture: mips

Addons: crypt linuxthreads localedata
Build CFLAGS: -O2 -g -DNDEBUG=1
Build CC: gcc
Build shared: yes
Build profile: yes
Build omitfp: no
Stdio: libio

>Description:
	The stack allocated for threads is offset by 
	sizeof(_pthread_descr_struct), which is aligned on 4 byte, but not 8
	byte bondary.  MIPS needs 8 byte alignment.  If not, no 8 byte types 
	can be read in va_arg - as they are expected to be absolutely aligned.
>How-To-Repeat:
	Run mysql on a Qube/Raq, connect client, select 1.0 (yields 0.0).
	Write any program that creates a thread, make the thread do something 
	with a double and print - the printed value is wrong, because printf 
	requires va_arg().
>Fix:
	add ' __attribute__ ((aligned(__alignof__(double)))) ' to declaration 
	of _pthread_descr_struct in linuxthreads/internals.h.  This should be 
	architecture safe, and "correct"

>Audit-Trail:
>Unformatted:


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

End of forwardqNBLPt Digest
***************************



-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]