From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17723 invoked by alias); 20 Dec 2001 14:46:05 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17709 invoked by uid 71); 20 Dec 2001 14:46:03 -0000 Date: Thu, 20 Dec 2001 06:46:00 -0000 Message-ID: <20011220144603.17708.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Werner Tuchan" Subject: Re: bootstrap/5149: gcc-20011217 reads beyond EOF on cygwin Reply-To: "Werner Tuchan" X-SW-Source: 2001-12/txt/msg01004.txt.bz2 List-Id: The following reply was made to PR bootstrap/5149; it has been noted by GNATS. From: "Werner Tuchan" To: , , , , , Cc: Subject: Re: bootstrap/5149: gcc-20011217 reads beyond EOF on cygwin Date: Thu, 20 Dec 2001 15:45:32 +0100 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: An: ; ; ; 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 >