public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67075] New: Infinite GC loop with ggc-min-expand=0
@ 2015-07-31 10:47 luke-jr+gccbugs at utopios dot org
  2015-07-31 10:48 ` [Bug c++/67075] " luke-jr+gccbugs at utopios dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: luke-jr+gccbugs at utopios dot org @ 2015-07-31 10:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67075

            Bug ID: 67075
           Summary: Infinite GC loop with ggc-min-expand=0
           Product: gcc
           Version: 4.8.4
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luke-jr+gccbugs at utopios dot org
  Target Milestone: ---

Created attachment 36100
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36100&action=edit
Preprocessed source code to reproduce loop, compressed

On a low-memory system, I "need" ggc-min-expand=0 to avoid swapping. However,
it appears there are cases where this can lead to an infinite loop of the
garbage collector, I presume because more than gcc-min-heapsize memory is
actually in use. I did not encounter this in GCC 4.4 or 4.5, but it may have
been coincidence, so I am uncertain whether this is a regression or not.

I am able to reproduce this consistently with the attached preprocessed source,
and either one of these build commands:

armv7a-hardfloat-linux-gnueabi-g++ -c -O2 -pipe -mcpu=cortex-a8 -mfpu=vfpv3
-mfloat-abi=hard -mthumb -mthumb-interwork --param ggc-min-expand=0 --param
ggc-min-heapsize=32768 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W
-fPIC x.cpp

/usr/libexec/gcc/armv7a-hardfloat-linux-gnueabi/4.8.4/cc1plus -D_GNU_SOURCE
x.cpp -dumpbase x.cpp -da -mcpu=cortex-a8 -mfpu=vfpv3 -mfloat-abi=hard -mthumb
-mthumb-interwork -mtls-dialect=gnu -auxbase x -O2 -Wall -Wextra
-fvisibility=hidden -fvisibility-inlines-hidden -fPIC --param ggc-min-expand=0
--param ggc-min-heapsize=32768 -fstack-protector -o x.out

The latter of these verbosely prints:
 <*free_lang_data> <visibility> <early_local_cleanups> {GC 32770k -> 32172k}
{GC 32770k -> 32480k} ............ (~forever)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/67075] Infinite GC loop with ggc-min-expand=0
  2015-07-31 10:47 [Bug c++/67075] New: Infinite GC loop with ggc-min-expand=0 luke-jr+gccbugs at utopios dot org
@ 2015-07-31 10:48 ` luke-jr+gccbugs at utopios dot org
  2015-07-31 11:12 ` pinskia at gcc dot gnu.org
  2015-07-31 12:57 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: luke-jr+gccbugs at utopios dot org @ 2015-07-31 10:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67075

--- Comment #1 from Luke Dashjr <luke-jr+gccbugs at utopios dot org> ---
Also note: ggc-min-expand=1 seems to successfully workaround this issue (but is
non-ideal for low-memory systems).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/67075] Infinite GC loop with ggc-min-expand=0
  2015-07-31 10:47 [Bug c++/67075] New: Infinite GC loop with ggc-min-expand=0 luke-jr+gccbugs at utopios dot org
  2015-07-31 10:48 ` [Bug c++/67075] " luke-jr+gccbugs at utopios dot org
@ 2015-07-31 11:12 ` pinskia at gcc dot gnu.org
  2015-07-31 12:57 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-07-31 11:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67075

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Sounds more like ggc_collect is now always doing the gc and there are a lot of
ggc_collect calls. 

So what is happening we are close to your 32M limit you set, so any garbage
that is produced in a pass will cause the next call to ggc_collect to always
collect. This means there a lot of calls to ggc_collect but in the normal case
(non 0 case), it does not matter. 

You might want to try 5.2 as 4.8.x is no longer supported and there have been
some memory reductions happened since 4.8.x.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/67075] Infinite GC loop with ggc-min-expand=0
  2015-07-31 10:47 [Bug c++/67075] New: Infinite GC loop with ggc-min-expand=0 luke-jr+gccbugs at utopios dot org
  2015-07-31 10:48 ` [Bug c++/67075] " luke-jr+gccbugs at utopios dot org
  2015-07-31 11:12 ` pinskia at gcc dot gnu.org
@ 2015-07-31 12:57 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-07-31 12:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67075

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think nowadays we just have a lot more ggc_collect calls.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-31 12:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-31 10:47 [Bug c++/67075] New: Infinite GC loop with ggc-min-expand=0 luke-jr+gccbugs at utopios dot org
2015-07-31 10:48 ` [Bug c++/67075] " luke-jr+gccbugs at utopios dot org
2015-07-31 11:12 ` pinskia at gcc dot gnu.org
2015-07-31 12:57 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).