Re: Help with getting started on Mac OS X

Carl Lindberg <[email protected]>
Newsgroups gmane.comp.bug-tracking.gnats.general
Message-ID <[email protected]>
> I'm trying to setup gnats 3.999.2 on a Mac OS X Server but I'm having a
> few problems, and I'm wondering if anyone else has managed to get gnats
> up and running on X Server 10.2.5.
>
> When I build gnats, I get a LOT of errors like these
>
> ...
> regex.h:434:3: style of line directive is a GCC extension

	This is because of the -ansi and -pedantic flags that are present in 
the Makefiles.  While these are useful during development, they should 
probably be turned off for releases -- many times the system headers 
themselves will cause piles of warnings.  It should build fine though.


> In the end, gnatsd did compile, but when inetd tries to start it, I it
> crashes and I get a backtrace like this:
>
> Thread 0 Crashed:
>   #0   0x9007472c in memmove
>   #1   0x0000fdf8 in xstrndup (misc.c:398)
>   #2   0x0001a92c in getOneAddress (mail.c:236)
>   #3   0x0001a998 in get_responsible_addr (mail.c:251)
>   #4   0x00003c64 in gnatsdChdb (cmds.c:662)
>   #5   0x00002d20 in main (gnatsd.c:1044)
>   #6   0x0000186c in _start (crt.c:267)
>   #7   0x000016ec in start
>
	This is a bug in mail.c; here's a patch:

*** mail.c      25 Nov 2002 13:58:33 -0000      1.20
--- mail.c      3 May 2003 22:42:52 -0000
***************
*** 226,232 ****
     addrEnd = addr;

     /* ignore any ending white space */
!   while (addr >= addrStart && isspace((int)(unsigned 
char)*(addr-sizeof(*addr))))
       {
         addr--;
       }
--- 226,232 ----
     addrEnd = addr;

     /* ignore any ending white space */
!   while (addr > addrStart && isspace((int)(unsigned 
char)*(addr-sizeof(*addr))))
       {
         addr--;
       }



The existing code allows a comparison of the character before the 
'addrStart' address, which is bad.  On MacOS X, that character just so 
happens to be a space, and addr is decremented one too many times.  The 
result is a -1 being passed to xstrndup.


-Carl Lindberg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.