bug-ncurses
[Top][All Lists]
Advanced

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

Re: A Valgrind-observant ncurses


From: Bill Gray
Subject: Re: A Valgrind-observant ncurses
Date: Thu, 20 Jun 2024 10:01:17 -0400
User-agent: Mozilla Thunderbird

Hi Steve,

On 6/20/24 08:03, Steve Litt wrote:
:-)

Every two years I observe that programs compiled with ncurses make
Valgrind throw an error,

   Sorry,  could you elaborate there?  What error do you see?

For me, a 'basic' ncurses program wherein I call newterm() instead of initscr(), and then call delscreen() at exit, results in Valgrind warning me that five or six blocks are accessible, but not freed :

https://www.projectpluto.com/temp/ncurses.log

It's five blocks unless printw() is called; apparently, that function maintains a static buffer that isn't freed.

Those unfreed blocks are definitely a minor nuisance if (like me) you want to be able to run your code through Valgrind and verify that everything got freed. However, leaving memory to be freed and files to be closed at exit does not (at least in my mind, or in Valgrind's logs) constitute an "error".

-- Bill

and could somebody please have a command line
option to make ncurses get rid of all its RAM. From the responses the
last several years I assume the answer is probably still no.

So this year I'll ask a different question. My understanding is that
ncurses can be slightly modified and then compiled to not throw that
Valgrind error, the downside being worse performance and possible loss
of some functionality. So what I'd like to do is compile a special,
diagnostic ncurses that doesn't throw the Valgrind error, use it for
testing, and then switch to the version of ncurses that comes with my
Linux distribution (Void Linux in my case). So here are some questions:

1) How do I keep my diagnostic ncurses completely separate from my
distro provided ncurses so that my distro-provided applications don't
go slower or lose functionality?

2) Where can I find instructions on how to compile my diagnostic ncurses
so that my home-brew applications don't throw Valgrind errors (assuming
I have no memory leaks in the code I wrote) when compiled with my
diagnostic ncurses?

Thanks,

SteveT

Steve Litt
http://444domains.com




reply via email to

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