From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22939 invoked by alias); 27 Mar 2004 07:03:45 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22931 invoked by uid 48); 27 Mar 2004 07:03:42 -0000 Date: Sat, 27 Mar 2004 07:03:00 -0000 Message-ID: <20040327070342.22930.qmail@sources.redhat.com> From: "ian at wasabisystems dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040303083528.14400.schmid@snake.iap.physik.tu-darmstadt.de> References: <20040303083528.14400.schmid@snake.iap.physik.tu-darmstadt.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug pch/14400] Cannot compile qt-x11-free-3.3.0 X-Bugzilla-Reason: CC X-SW-Source: 2004-03/txt/msg03166.txt.bz2 List-Id: ------- Additional Comments From ian at wasabisystems dot com 2004-03-27 07:03 ------- I was able to recreate this problem with the 3.4 branch compiler. The problem is that the PCH is loaded at an address which is not the address at which it was saved. On the 3.4 branch this leads to a segmentation violation, because of some code which uses mincore to check whether an address is available. mincore on Linux does not work as expected, so that code loads the PCH on top of memory space which is already being used. The result is a crash. This particular problem does not occur on mainline, because the code which calls mincore has been moved to host-solaris.c, and thus is not called on Linux. If I change line 610 of ggc-common.c to #if HAVE_MINCORE && ! defined (__linux__) then I get a sorry() message. Now, why does the mmap return a different value? It is because the input file is large--142253 bytes. The input file is loaded into memory in c_common_post_options. The -include command line option is processed by finish_options(), called just before c_parse_file(). Since the input file is so large, the memory map is changed before gcc tries to load the PCH. The effect is that the PCH winds up at the wrong address. I suspect that this is a general problem with PCH, and that the problem will also occur with mainline. However, I haven't tried it yet. I don't see any good fix for this at the moment. I suspect that PCH is going to generally break when used with large input files, except on Darwin which does not use the mmap scheme. But I haven't verified it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14400