🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: gmane.comp.gcc.bugs
8 messages
8 total messages Started by "jakub at gcc do Mon, 24 Jan 2011 08:17
[Bug pch/47430] New: [4.6 Regression] Random PCH related bootstrap failures on powerpc64-linux
#307577
Author: "jakub at gcc do
Date: Mon, 24 Jan 2011 08:17
43 lines
2087 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG430

           Summary: [4.6 Regression] Random PCH related bootstrap failures
                    on powerpc64-linux
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: pch
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: bkoz@gcc.gnu.org, paolo@gcc.gnu.org


I saw during the weekend two bootstrap failures in libstdc++.
The problem seems to be that powerpc64 uses very large pages (64KB), address
space randomization and the fact that for building stdtr1c++.h.gch and
extc++.h.gch uses stdc++.h.gch.

When building e.g. stdtr1c++.h.gch, stdc++.h.gch already likely exists and thus
it first mmaps stdc++.h.gch at the desired address, which is likely
TRY_EMPTY_VM_SPACE (OT, for __powerpc__ && __LP64__, shouldn't it use some
larger value, say 0x6000000000ULL ?), thus when attempting to determine best VM
slot for stdtr1c++.h.gch, that slot is already taken by stdc++.h.gch and thus
can't be used.  While there is some code to attempt to handle address space
randomization, perhaps 32MB works well for 4KB pages, but is too small for
larger pages or something, but it certainly fails from time to time on ppc64
and some shared library is mmapped at that point.

Potential ways how to fix this, one or more of:
1) in host-linux.c define more than one TRY_EMPTY_VM_SPACE value for each OS,
and if mmap at TRY_EMPTY_VM_SPACE fails, try TRY_EMPTY_VM_SPACE2 which is say
0x70000000 for most 32-bit hosts and some GB appart from TRY_EMPTY_VM_SPACE for
64-bit hosts.
2) make sure other PCH is not read during compilation that is writing PCH
3) change the logic for address space randomization in host-linux.c, use larger
buffer if page size is > 4KB
4) change libstdc++ makefiles to make sure stdc++.h.gch does not exist when
building the other *.gch files, use explicit ordering in the Makefile that it
is first rm -f'ed, then the other gch files built, then stdc++.h.gch built

Preferences?
[Bug pch/47430] [4.6 Regression] Random PCH related bootstrap failures on powerpc64-linux
#307578
Author: "jakub at gcc do
Date: Mon, 24 Jan 2011 08:25
7 lines
289 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG430

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0
[Bug pch/47430] [4.6 Regression] Random PCH related bootstrap failures on powerpc64-linux
#307579
Author: "jakub at gcc do
Date: Mon, 24 Jan 2011 08:52
10 lines
582 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG430

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-24 08:51:53 UTC ---
3) might be too hard, at least on RHEL6/ppc64 the randomization of mmap has
difference between smallest and largest address for one mmap is almost 1GB in a
few attempts I've done (0xfff79110000 to 0xfffb5010000).

BTW, the fatal_error ("had to relocate PCH"); doesn't print, but instead
segfaults, as line_map seems to be in some weird state prepared for the PCH
read already at that point, thus it is pointing into the new PCH slot already.
[Bug pch/47430] [4.6 Regression] Random PCH related bootstrap failures on powerpc64-linux
#307666
Author: "bkoz at gcc dot
Date: Mon, 24 Jan 2011 18:53
13 lines
547 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG430

--- Comment #2 from Benjamin Kosnik <bkoz at gcc dot gnu.org> 2011-01-24 18:53:14 UTC ---

4) is not possible, as stdc++.h is included in precompiled/stdtr1c++.h and the
extension PCH. (ie, chained pches.) We don't want to re-order this, and build
stdtr1c++.h without stdc++.h, as then PCH file sizes for
stdtr1c++.h.gch/extc++.h.gch will balloon massively.

You can work around this with --disable-libstdcxx-pch at configure time for
PPC.

Long term solution IMHO is to make .gch files smaller.
[Bug pch/47430] [4.6 Regression] Random PCH related bootstrap failures on powerpc64-linux
#307668
Author: "jakub at gcc do
Date: Mon, 24 Jan 2011 19:19
14 lines
691 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG430

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-24 19:19:44 UTC ---
Created attachment 23105
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id#105
gcc46-pr47430-workaround.patch

This patch shows a sample implementation of 4) which seems to work just fine.
It should have no effect on what is actually provided by the headers, just make
sure stdc++.gch/* isn't used during stdtr1c++.gch etc. compilation.

BTW, it surprises me that for -std=c++0x extc++.h doesn't include
bits/stdc++.h, I can understand why it doesn't include tr1 stuff in that case,
but I'd expect the standard stuff to be included nevertheless.
[Bug pch/47430] [4.6 Regression] Random PCH related bootstrap failures on powerpc64-linux
#307762
Author: "rguenth at gcc
Date: Tue, 25 Jan 2011 11:07
6 lines
245 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG430

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-25 11:07:04 UTC ---
2) make sure other PCH is not read during compilation that is writing PCH

makes sense to me anyway
[Bug pch/47430] [4.6 Regression] Random PCH related bootstrap failures on powerpc64-linux
#307850
Author: "jakub at gcc do
Date: Tue, 25 Jan 2011 17:17
18 lines
765 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG430

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.01.25 17:17:12
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-25 17:17:12 UTC ---
Created attachment 23122
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id#122
gcc46-pr47430.patch

Untested patch that implements 2).
[Bug pch/47430] [4.6 Regression] Random PCH related bootstrap failures on powerpc64-linux
#307935
Author: "jakub at gcc do
Date: Wed, 26 Jan 2011 06:56
26 lines
867 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG430

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-26 06:48:10 UTC ---
Author: jakub
Date: Wed Jan 26 06:48:04 2011
New Revision: 169276

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev9276
Log:
    PR pch/47430
    * c-opts.c (c_common_post_options): Call c_common_no_more_pch
    after init_c_lex if pch_file is set.

Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-opts.c

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-26 06:55:49 UTC ---
Fixed.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads