lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Out of memory not properly detected on scm_* functions


From: Han-Wen Nienhuys
Subject: Re: Out of memory not properly detected on scm_* functions
Date: Fri, 27 Feb 2009 12:51:33 -0300

I am pretty sure that all realloc calls in GUILE check for NULL.  Can
you send me a stacktrace of where this happens? I think it is
overcommitting memory (ie.: you get a non-NULL pointer, which raises
segfault if you dereference it)

On Wed, Feb 25, 2009 at 4:48 PM, Matthias Kilian <address@hidden> wrote:
> Hi,
>
> when running
>
> $ gmake web
>
> on OpenBSD/amd64, lilypond tends to bail out in a very misleading
> and confusing way -- it segfaults. This is probably reproducible
> on Linux when you limit the data size using ulimit -Sd 524288 (it's
> really not necessary that someone actually tries to reproduce it,
> but if you're bored...).
>
> The problem is that when memory is tight, several of the scm_*
> functions like the scm_call_? family just return NULL. Indeed, some
> debugging and tracing showed that guiles garbage collectro tries
> to realloc(2), which fails, and then you just get get the NULL.
>
> Unfortunately, lilypond doesn't check the return values of the scm_*
> functions, so all you see is the mentioned segfault *somewhere*,
> probably after the realloc(2) failed several times.
>
> I'm not a libguile guru, but is there any way to force libguile to
> abort(2) immediately if the gc can't gc anything and also can't
> request more space from the system? Checking all the SCM's returned
> by scm_* function seems to be too cumbersome IMHO.
>
> Ciao,
>        Kili
>
> ps: of course this all may be caused by a memory leak in lilypond,
> but before checking that, I'd prefer to see lilypond aborting when
> the realloc failure happens.
>
>
> --
> If your program isn't worth documenting,
> it probably isn't worth running.
>                -- Nagler
>
>
> _______________________________________________
> lilypond-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/lilypond-devel
>



-- 
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]