[Top][All Lists]

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

Re: When should ralloc.c be used? (WAS: bug#24358)

From: Eli Zaretskii
Subject: Re: When should ralloc.c be used? (WAS: bug#24358)
Date: Tue, 25 Oct 2016 19:05:16 +0300

> From: Richard Stallman <address@hidden>
> CC: address@hidden, address@hidden,
>       address@hidden
> Date: Mon, 24 Oct 2016 22:35:55 -0400
>   > > I think the way to fix those is by systematically looking at the
>   > > source for them, rather than by debugging.
>   > Yes, but finding out whether this is so is not easy, because the
>   > malloc call is sometimes buried very deep.
> There are programs that determine call trees.  We could find these
> problems by analyzing the output.

Yes, but the real problem is to determine whether the code needs any
changes at all.  For that, one must understand the control flow, and
figure out whether pointers to buffer text are used across malloc
calls without any updates.  This is the hardest part, because pointers
are frequently passed down to subroutines and to their subroutines,
which use them or call malloc only under certain conditions.  For
example, it could be that a subroutine only calls malloc if the
passed-in pointer does not originate from a buffer object.

This analysis is what makes the source study hard.

Anyway, I think I just finished hunting and fixing those cases, so the
only remaining issue is with regex.c functions, for which we have a
patch that will most probably do the job.

reply via email to

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