This is the mail archive of the 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]
Other format: [Raw text]

[Bug preprocessor/24202] [3.4/4.0/4.1 Regression] Segfault with #pragma once

------- Comment #13 from wilson at gcc dot gnu dot org  2005-11-01 23:51 -------
I believe the problem originated here:
2003-07-29  Neil Booth  <>

        PR preprocessor/11569
        PR preprocessor/11649
        * (LIBCPP_DEPS): Add HASHTAB_H.
        * cppfiles.c: Completely rewritten.

This added the buffer_valid field, and added code that clears buffer without
also clearing buffer_valid.  This is revision 1.178 in the gcc/cppfiles.c file.

The failure occurs only when we free a valid buffer, and then try to reuse that
buffer because we still think it is valid.  Whether this occurs depends on how
buffers are managed by cpp, and how they are used by cpp, so I don't find it
surprising that this latent bug has been disappearing and reappearing over
time.  The patch identified by Janis just makes the problem more visible
because it adds more uses of buffer_valid.

Now I'm off to test my patch.  The same patch should work for all 3 gcc


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