This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: ../../gcc/fixproto[275]: 25412 Memory fault(coredump)
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Subject: Re: ../../gcc/fixproto[275]: 25412 Memory fault(coredump)
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Wed, 7 Mar 2001 08:30:31 +0000
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <no.id> <200103070036.TAA00162@hiauly1.hia.nrc.ca>
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.