This is the mail archive of the gcc-bugs@gcc.gnu.org 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 pch/14400] Cannot compile qt-x11-free-3.3.0


------- 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


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