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/11178] New: preprocessor calls abort on -CC -traditional-cpp


           Summary: preprocessor calls abort on -CC -traditional-cpp
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: preprocessor
 GCC build triplet: i386-unknown-netbsdelf1.6
  GCC host triplet: i386-unknown-netbsdelf1.6
GCC target triplet: i386-unknown-netbsdelf1.6

The changes to gcc.dg/cpp/trad/maccom4.c and gcc.dg/cpp/trad/maccom6.c on June 2
uncovered a latent bug in the preprocessor that makes these tests fail on
NetBSD/FreeBSD/OpenBSD (but curiously, other systems seems not to be affected as
seen from gcc-testresults...)

What happens (at least on i386-unknown-netbsdelf1.6) is that abort() is called
in _cpp_process_line_notes().  That in turn seems to be due to note->pos <
buffer->cur so that the loop is not broken out of. 

Hypothesis: There is a big difference between those pointers, so it looks to me
like they have been allocated from different calls to malloc() (or on pointer
has been realloc:ed, and the other one not adjusted). Difference between
implementations of malloc with friends may explain why they fail for *BSD

(I do not have time to learn the code right now, but I'm happy to do some
investigations/tests if my bug report rings a bell for someone...)

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