lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev Leaking file-handles


From: Thomas Dickey
Subject: Re: lynx-dev Leaking file-handles
Date: Tue, 25 Mar 2003 13:19:03 -0500
User-agent: Mutt/1.2.5i

On Tue, Mar 25, 2003 at 06:46:14PM +0100, Gisle Vanem wrote:
> I've noticed that Lynx 2-8-5 dev.14 is leaking file-handles under
> Win-XP and 4NT shell (but *not* under CMD).
> 
> Compiled with MingW + PDcurses 2.6
> 
> While Lynx is running: "handle | grep lynx":
>      d4: File          G:\MingW32\src\inet\lynx2-8-5
>   lynx.exe pid: 2368 PCGV\Gisle Vanem
> 
> And after Lynx has terminated:
>    d4: File          G:\MingW32\src\inet\lynx2-8-5
> 
> handle is a nice tool from 
> http://www.sysinternals.com/ntw2k/freeware/handle.shtml
> 
> Running Lynx several times, leaves more file-handles open.
> Any explanation for this? Or how to debug this behaviour?
> This happens no matter what URL I use (local or net). Even
> "lynx -h" leaks one handle. I have to exit the 4NT shell to free
> the handles.

If it's files not being closed, I think you could trace that by calling
a function like

void test_open(char *file, int line)
{
        static int highest;
        FILE *fp = fopen("foo", "w");
        if (fp != 0) {
                int fd = fileno(fp);
                if (fd > highest) {
                        CTRACE((tfp, "file %s @%d: %d\n", file, line, fd));
                        highest = fd;
                }
                fclose(fp);
        }
}

and sprinking calls
        test_open(__FILE__, __LINE__);
around the suspect area.

A quick check on Linux of "lynx -h" doesn't show a file-descriptor leak.
But of course there are differences on win32.

> I've tried compiling with LY_FIND_LEAKS, but didn't notice
> any significant leaks (files or memory). Only one in HTDOS.c
> at line 19.
> 
> Gisle V.
> 
> 
> 
> 
> ; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

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

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

reply via email to

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