public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GGC_QUIRE_SIZE change
@ 2000-08-29  7:04 Richard Kenner
  2000-08-29  9:03 ` Zack Weinberg
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Kenner @ 2000-08-29  7:04 UTC (permalink / raw)
  To: gcc

It's causing problems for me on DEC Unix 4.0C.  When I have a program that
uses sufficient memory (in this case it's in Ada), the mmap fails with
ENOSPACE.  I've spent a lot of time in the debugger and everything looks
OK, but it does fail.  Setting GGC_QUIRE_SIZE to 1 "fixes" it.

Does anybody have any idea what's going on?

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: GGC_QUIRE_SIZE change
@ 2000-08-29 10:11 Richard Kenner
  2000-08-29 10:32 ` Zack Weinberg
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Kenner @ 2000-08-29 10:11 UTC (permalink / raw)
  To: zack; +Cc: gcc

    How much memory has been allocated already when it fails?  

About 13 MB, with it saying that about 6 MB is mapped.

    Do you think it would work to fall back to 1-page allocations if a
    16-page mmap() returns ENOSPACE?

I don't think so.  I think there is something fundamentally wrong here:
allocating 128KB shouldn't be an issue.  Interestingly enough, when the
mmap fails, GDB is no longer able to call any functions, claiming it
couldn't read the address that corresponds to _start.  But I can read it
with x/i just fine.  So something is messing up badly, though I have no
idea what.

If I change the macro from 16 to 1, things work fine.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: GGC_QUIRE_SIZE change
@ 2000-08-29 11:38 Richard Kenner
  2000-08-29 11:41 ` Zack Weinberg
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Kenner @ 2000-08-29 11:38 UTC (permalink / raw)
  To: zack; +Cc: gcc

    This is beginning to sound like an OS bug.  Could you try compiling
    this test program with and without -DGGC_QUIRE_SIZE=1 and see what it
    prints when run?  

When I get this, it runs until swap space fills, so this is definitely
very different from the behavior seen with GCC.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: GGC_QUIRE_SIZE change
@ 2000-08-29 11:52 Richard Kenner
  2000-08-29 12:05 ` Zack Weinberg
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Kenner @ 2000-08-29 11:52 UTC (permalink / raw)
  To: zack; +Cc: gcc

    Try adding a

      *page = 1;

    after the check to see if mmap failed.

Same thing.  Of course that only touches 1/16th of the pages, but I don't
think the issue is amount of allocated memory, but instead has something
to do with address space ranges, though I have no idea of in what way
exactly, of course.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: GGC_QUIRE_SIZE change
@ 2000-08-29 12:07 Richard Kenner
  2000-08-29 12:19 ` Zack Weinberg
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Kenner @ 2000-08-29 12:07 UTC (permalink / raw)
  To: zack; +Cc: gcc

    Do you have strace or equivalent on that system?  I'd be interested to
    see if this is the brk region colliding with the mmap region.

Yes, I do.  I've never used it, so tell me what to do.

It will take an hour or so for me to get back to where things were
when it was failing.

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

end of thread, other threads:[~2000-08-29 12:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-29  7:04 GGC_QUIRE_SIZE change Richard Kenner
2000-08-29  9:03 ` Zack Weinberg
2000-08-29 10:11 Richard Kenner
2000-08-29 10:32 ` Zack Weinberg
2000-08-29 11:38 Richard Kenner
2000-08-29 11:41 ` Zack Weinberg
2000-08-29 11:52 Richard Kenner
2000-08-29 12:05 ` Zack Weinberg
2000-08-29 12:07 Richard Kenner
2000-08-29 12:19 ` Zack Weinberg

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