This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: ../../gcc/fixproto[275]: 25412 Memory fault(coredump)


John David Anglin wrote:-

> Following up, the segfault occurs in a call to memcpy in cppfiles.c:
> 
>   /* Search directory path for the file.  */
>   name = (char *) alloca (strlen (fname) + pfile->max_include_len
> 			    + 2 + INCLUDE_LEN_FUDGE);
>   for (path = search_start; path; path = path->next)
>     {
>       memcpy (name, path->name, path->len);
> 
> It appears that this is fallout from Zack's alloca patch (ie.,

No, I think it was my patch.  This is all related to basename ()
not returning a pointer to within the string it was passed on
your platform (and hence pointer subtraction returning a large
random number).  Clearly, some input other than "", which I now
catch as a special case, returns a special string too.

It'll take me a day or two to get to this, please be patient.  I
think I'll write my own basename () and when a global one is
agreed on I'll use that instead.

Neil.


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