AmigaLabs / binutils-gdb

binutils targeted for ppc-amigaos systems (AmigaOS NG like OS4.1).
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git
GNU General Public License v2.0
0 stars 0 forks source link

[GDB] memory leaks when run/exit from GDB and left PIPE/queue-handler in processes #33

Open kas1e opened 1 month ago

kas1e commented 1 month ago

Find out some memory leak which easy to reproduce: it's enough to run gdb -v to have loose 1-2mb of the RAM. I.e. let's say we have 296MB of used ram, that what we have then for 10 gdb -v runs:

1st run:  297 used
2st run : 298 used
3st run : 300 used
4st run : 301 used
5st run: 302 used
6st run: 304 used
7st run: 305 used
8st run: 306 used
9st run: 308 used

Also with Ranger we can find that each run/exit of GDB , keeps in the DOS process an PIPE/queue-hanlder left, which can be cause of those memory leaks (or at least a part of)

migthymax commented 1 month ago

I improved gdb so that on killing an inferior the DOS seglist is even freed. That should at least minder the memory leak for real debugging. The PIP/queue-hanlder DOS process issue, might be an clib4 issue ?

kas1e commented 1 month ago

Checked this commit : nope, sadly to say same memory leak on exit by amount of leaked memory :(

kas1e commented 1 month ago

@migthymax I build newlib version of our clib4 branch, and to surprise there is NO pipe-handler left, as well as there is no memory leak on exit. I can see how for newlib build PIPE-Handlers creates, but then disappear once i exit. That probably point out us on CLIB4 :(

kas1e commented 1 month ago

@migthymax Alfkil (elfpipe) find out that actually CMAKE build for clib4 also left pipe handlers on exit ! So, that definitely clib4 issue in end of all. Maybe not about memory leaks, but about pipe for sure.