[Bug go/60931] libgo has issues when page size is not 4k

anton at samba dot org gcc-bugzilla@gcc.gnu.org
Fri Apr 25 02:02:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60931

Anton Blanchard <anton at samba dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #32669|0                           |1
        is obsolete|                            |

--- Comment #7 from Anton Blanchard <anton at samba dot org> ---
Created attachment 32679
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32679&action=edit
runtime: Fix garbage collector issue with non 4kB system page size

The go garbage collector tracks memory in terms of 4kB pages. Most of
the code checks getpagesize() at runtime and does the right thing.

On a 64kB ppc64 box I see SEGVs in long running processes which has
been diagnosed as a bug in scavengelist. scavengelist does a
madvise(MADV_DONTNEED) without rounding the arguments to the system
page size. A strace of one of the failures shows the problem:

madvise(0xc211030000, 4096, MADV_DONTNEED) = 0

The kernel rounds the length up to 64kB and we mark 60kB of valid data
as no longer needed.

Round start up to a system page and end down before calling madvise.



More information about the Gcc-bugs mailing list