Re: NULL pointer or objptr should not pass the validity check.

吴佳森 <[email protected]> Wed, 5 Jun 2013 22:34:41 +0800
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <CAKCzkErWgrqG0_6sZFGiuKC=XuVqCRh7JMsSxX_V6bFk1M5Brg@mail.gmail.com>
Hi Matthew
I come back on this strange problem and find a few clues but still cannot
catch the key point. I use @MLton gc-messages -- runtime option and see a
few things.
1. at #21 GC round, createHeapSecondary (called in majorGC) fails with not
enough memory, and mark compact GC succeed (which means there's not
sufficient space for a major Cheney-copy)
2. at #22 GC round, stack grows and succeed.
3. at #23 GC round, stack grows and succeed.
Then there is a null object on stack.

Could you tell me something about stack in MLton?  Especially, How objects
are put onto the stack? Thank you very much.


2013/5/17 Matthew Fluet <[email protected]>

> On Mon, May 13, 2013 at 2:29 AM, 吴佳森 <[email protected]> wrote:
> > You are right, Matthew. the NULL point should not have been in the heap.
> >
> > I noticed after my temporary fix, the executable at last raise a
> exception
> > says not enough memory to create a heap. Therefore I then made the
> runtime
> > print each GC_mmapAnon and GC_release.
>
> The runtime will print a lot of GC related messages by running an
> executable with "@MLton gc-messages --".
>
> > The requested heap size goes from 18M
> > to 500M at last. Note that I implement GC_mmapAnon() with malloc(). I
> > realized that it is a special feature of my currently using platform. The
> > freed piece of memory are directly put back to the system nor they can be
> > used to satisfied by next request. The C runtime keep all those pieces of
> > heaps and finally run out of memory.
>
> That could make sense; if the runtime never frees any allocated
> memory, then you will likely run out of available memory.
>
> > After I telling the C runtime to always to put back those freed storage,
> the
> > running out of memory error goes aways. And removing my temporary fix,
> the
> > executable can still successfully run, showing that the NULL point does
> not
> > exist on the heap when there are sufficient memory.
>
> The confusing thing about this is that whether or not the runtime
> frees previously allocated heaps, that shouldn't change the contents
> of the "current" heap.
>
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> MLton-devel mailing list
> [email protected]; [email protected]
> https://lists.sourceforge.net/lists/listinfo/mlton-devel
>

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j

_______________________________________________
MLton-devel mailing list
[email protected]; [email protected]
https://lists.sourceforge.net/lists/listinfo/mlton-devel