Re: Fix!?? (__va_copy) [Was: PostgreSQL Exception: invalid input syntax for type timestamp]

Sebastian Reitenbach <[email protected]> Sat, 28 Feb 2009 07:53:27 +0100
Newsgroups gmane.comp.cms.opengroupware.user
Organization L00 bugdead prods.
Message-ID <[email protected]>
Hi,
That  PrintfFormatScanner.m, remembers me on sth. I had a crasher in ogo, on 
64Bit, an I have to maintain a patch for our own rpm's to fix it, problem is 
described here:

http://bugzilla.opengroupware.org/bugzilla/show_bug.cgi?id=1932

hth
sebastian

On Saturday 28 February 2009 05:16:13 Adam Tauno Williams wrote:
> > So, boy does this look like a candidate (in PrintfFormatScanner) -
> >
> > <snip>
> > if (args == NULL) {
> >   /* We got no parameters, so we cannot resolve them anyways. If the
> >    * string contains patterns, we should probably raise an error?
> >    */
> >   return format;
> >  }
> > </snap>
> >
> > - as we are getting exactly out format spec handled back to us.  If I
> > toss an fprintf into there it gets pinged!
> >
> > PrintfFormatScanner for no args, returning format!
> > %b %d %H:%M:%S ogo-webui-1.1 [16973]: Note: folder-view did not find
> > Epoz.
>
> A brute force fix is this:  change "#ifdef __va_copy" in
> PrintfFormatScanner's stringWithFormat to "#ifndef __va_copy" so instead
> of -
>
> if (args == NULL) {
>   return format;
>  }
>  __va_copy(va, args);
>  self->result = [NSMutableString stringWithCapacity:[format
> cStringLength]];
> [self parseFormatString:format context:&va];
>
>  - we get -
>
> va = args;
> self->result = [NSMutableString stringWithCapacity:[format
> cStringLength]];
> [self parseFormatString:format context:&va];
>
> Should __va_copy be defined? (is it getting defined erroneously
> somewhere?).  Or is this symptomatic of a bug elsewhere?
>
> Happily I don't see it used terribly many other places:
>
> awilliam@linux-m3mt:~/Works/OpenGroupware/libFoundation-1.1.7> grep -d
> recurse __va_copy *
> ChangeLog:	  use __va_copy to handle va_list arguments (needed for
> powerpc64 port)
> Foundation/PrintfFormatScanner.m:#ifndef __va_copy
> Foundation/PrintfFormatScanner.m:    __va_copy(va, args);
> Foundation/NSSet.m:#ifdef __va_copy
> Foundation/NSSet.m:    __va_copy(va, argList);
> Foundation/common.h:#  if defined(__va_copy) || defined(__linux__)
> Foundation/common.h:#    define lfCopyVA(__lvar__, __avar__)
> __va_copy(__lvar__, __avar__);
>
>
> sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.m:#ifdef __va_copy
> sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.m:
> __va_copy(va, args);


-- 
OpenGroupware.org Users
[email protected]
http://mail.opengroupware.org/mailman/listinfo/users