bootstrap/5149: gcc-20011217 reads beyond EOF on cygwin

Werner Tuchan tuwn@gmx.net
Thu Dec 20 08:37:00 GMT 2001


Thats the piece of code that loaded the file, this time its libgcc2.c.

cppfiles.c
  388       /* Use mmap if the file is big enough to be worth it (controlled
  389   by MMAP_THRESHOLD) and if we can safely count on there being
  390   at least one readable NUL byte after the end of the file's
  391   contents.  This is true for all tested operating systems when
  392   the file size is not an exact multiple of the page size.  */
- 393       if (size / pagesize >= MMAP_THRESHOLD
  394    && (size % pagesize) != 0)
  395  {
- 396    buf = (U_CHAR *) mmap (0, size, PROT_READ, MAP_PRIVATE, inc->fd,
0);
- 397    if (buf == (U_CHAR *)-1)
  398      goto perror_fail;
- 399    inc->mapped = 1;
- 400  }
  401       else
  402 #endif


(gdb) x inc.name
0x10a3af8:  "../../gcc-20011217/gcc/libgcc2.c"

(gdb) x /s buf + 46170
0x83a5445a:  "ED_ATEXIT */\n\n#endif /* L_exit */\nÀÀÀ"

(gdb) x /100xb buf + 46170
0x83a5445a: 0x45 0x44 0x5f 0x41 0x54 0x45 0x58 0x49
0x83a54462: 0x54 0x20 0x2a 0x2f 0x0a 0x0a 0x23 0x65
0x83a5446a: 0x6e 0x64 0x69 0x66 0x20 0x2f 0x2a 0x20
0x83a54472: 0x4c 0x5f 0x65 0x78 0x69 0x74 0x20 0x2a
0x83a5447a: 0x2f 0x0a 0xc0 0xc0 0xc0 0x00 0xc0 0xc0
0x83a54482: 0xc0 0x00 0xc0 0xc0 0xc0 0x00 0xc0 0xc0
0x83a5448a: 0xc0 0x00 0xc0 0xc0 0xc0 0x00 0xc0 0xc0
0x83a54492: 0xc0 0x00 0xc0 0xc0 0xc0 0x00 0xc0 0xc0
0x83a5449a: 0xc0 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x83a544a2: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x83a544aa: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x83a544b2: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x83a544ba: 0x00 0x00 0x00 0x00


-----Ursprüngliche Nachricht-----
Von: <neil@gcc.gnu.org>
An: <gcc-bugs@gcc.gnu.org>; <gcc-prs@gcc.gnu.org>; <nobody@gcc.gnu.org>;
<tuwn@gmx.net>
Gesendet: Donnerstag, 20. Dezember 2001 01:20
Betreff: Re: bootstrap/5149: gcc-20011217 reads beyond EOF on cygwin


> Synopsis: gcc-20011217 reads beyond EOF on cygwin
>
> State-Changed-From-To: open->feedback
> State-Changed-By: neil
> State-Changed-When: Wed Dec 19 16:20:04 2001
> State-Changed-Why:
>     Is there any chance you could try and debug this?
>     I need to know which code path is being taken inside
>     read_include_file() in cppfiles.c, when it is reading in
>     the file(s) that cause the problem (e.g. longlong.h).
>     In particular, we need to be sure that the in-memory
>     file buffer is properly NUL-terminated.
>
>     If you use -v, you will see the command line used to invoke cc1; that
is what you should try and debug.
>
>     Thanks.
>
>
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
r=5149
>



More information about the Gcc-bugs mailing list