lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev valgrind-reverse.log.gz


From: Leonid Pauzner
Subject: Re: lynx-dev valgrind-reverse.log.gz
Date: Fri, 20 Dec 2002 12:16:46 +0300 (MSK)

>> Tom, please try this patch with valgrind whether it is OK.
>> It uses fixed last line buffer (no line/pool logic).
>> Applied against clean dev.12

> it doesn't work (gets an assertion failure).

Which assertion? Could you debug this code? (I can not install valgrind
since it doesn't build on my RH7.1 Linux - require system upgrade etc.)

Fixed last line buffer used in color styles without problem,
HText_EndAppend() removes last two lines and eliminate fixed buffer
from HText lines list. Perhaps we should correct the condition
    /*
     *  Remove the blank lines at the end of document.
     */
    while (text->last_line->data[0] == '\0' && text->Lines > 2) {
in function below ( > 2)???

Invalid read of memory freed in previous HText by HTuncache_current_document
seems to be an indirect error of memory overrun from some other code.

Any ideas?

> --
> Thomas E. Dickey <address@hidden>
> http://invisible-island.net
> ftp://invisible-island.net

> --ATTACHMENT-- x-gunzip file <valgrind.log.gz>

==2284== Invalid read of size 2
==2284==    at 0x8059307: display_line (./GridText.c:1235)
==2284==    by 0x805A032: display_page (./GridText.c:1993)
==2284==    by 0x805FA3F: HText_pageDisplay (./GridText.c:6814)
==2284==    by 0x8077DC0: mainloop (./LYMainLoop.c:6270)
==2284==    by 0x806D97A: main (./LYMain.c:2048)
==2284==    by 0x402A6577: (within /lib/libc-2.1.3.so)
==2284==    Address 0x432164B8 is 8 bytes inside a block of size 16 free'd
==2284==    at 0x40042630: free (vg_clientfuncs.c:171)
==2284==    by 0x80ACEA8: LYLeakFree (./LYLeaks.c:574)
==2284==    by 0x8058E88: HText_free (./GridText.c:1068)
==2284==    by 0x8061239: HTuncache_current_document (./GridText.c:8104)
==2284==    by 0x80708B3: handle_LYK_ACTIVATE (./LYMainLoop.c:1441)
==2284==    by 0x80790DA: mainloop (./LYMainLoop.c:7139)
==2284==
...

/*
**  This function trims blank lines from the end of the document, and
**  then gets the hightext from the text by finding the char position,
**  and brings the anchors in line with the text by adding the text
**  offset to each of the anchors.
*/
PUBLIC void HText_endAppend ARGS1(
        HText *,        text)
{
    HTLine *line_ptr;

    if (!text)
        return;

    CTRACE((tfp,"Gridtext: Entering HText_endAppend\n"));

    /*
     *  Create a  blank line at the bottom.
     */
    new_line(text);

[...]
    /*
     *  Get the first line.
     */
    line_ptr = FirstHTLine(text);

    /*
     *  Remove the blank lines at the end of document.
     */
    while (text->last_line->data[0] == '\0' && text->Lines > 2) {
        HTLine *next_to_the_last_line = text->last_line->prev;

        CTRACE((tfp, "GridText: Removing bottom blank line: `%s'\n",
                            text->last_line->data));
        /*
         *  line_ptr points to the first line.
         */
        next_to_the_last_line->next = line_ptr;
        line_ptr->prev = next_to_the_last_line;
        freeHTLine(text->last_line);
        text->last_line = next_to_the_last_line;
        text->Lines--;
        CTRACE((tfp, "GridText: New bottom line: `%s'\n",
                            text->last_line->data));
    }

    /*
     *  Fix up the anchor structure values and
     *  create the hightext strings. -FM
     */
    HText_trimHightext(text, TRUE, -1);
}



; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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