[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: XView bug/PPC machines available for developers?



> > BTW, I never heard any complaints about XView's varargs usage on ppc back
> > in the glibc 2.0 days (but then, I don't know wheter somebody actually
> > compiled it for ppc at that time). However, for glibc 2.1, somebody
> > submitted a patch that changed the following in lib/libxview/attr/attr.c:94
> > and a few other places:
> > 
> > #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
> >    __va_copy(valist, valist1);
> >    __va_copy(avlist, avlist1);
> > #else
> >    valist = valist1;
> >    avlist = avlist1;
> > #endif     
> 
> Looks reasonable. 

I have to correct myself here: the __va_copy(avlist, avlist1) is
utter BS. It expands to  *avlist1 = *avlist and avlist1 is not
initialized -> null pointer dereferenced. 

Apply the following patch

--- lib/libxview/attr/attr.c.org	Sun Sep 24 22:22:04 2000
+++ lib/libxview/attr/attr.c	Sun Sep 24 22:21:34 2000
@@ -93,7 +93,11 @@
    */
 #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
    __va_copy(valist, valist1);
+#if defined(__powerpc__)
+   avlist = avlist1;
+#else
    __va_copy(avlist, avlist1);
+#endif
 #else
    valist = valist1;
    avlist = avlist1;

and it just works (for me, YMMV, yadda). 

Sample packages in ftp.biophys.uni-duesseldorf.de:/pub/linux/powerpc/

	Michael




Reply to: