Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Init memleak fixes #3399

Closed
wzdev-ci opened this issue Apr 10, 2012 · 9 comments
Closed

Init memleak fixes #3399

wzdev-ci opened this issue Apr 10, 2012 · 9 comments

Comments

@wzdev-ci
Copy link
Contributor

keyword_init keyword_memleak keyword_startup keyword_valgrind resolution_duplicate type_patch (an actual patch, not a request for one) | by T_X


Copy and Pasta from: Warzone2100/warzone2100#30


These should fix some non critical memory leaks which were caused by memory allocated during startup but Not being properly freed during shutdown. They are shown when starting warzone2100 with "valgrind --leak-check=full" and hitting "Quit Game" right afterwards.

Refs #3395 (http://developer.wz2100.net/ticket/3395).

After those four patches, the following two valgrind errors are still left during this minimal startup phase for me:

==12304## 40 bytes in 1 blocks are still reachable in loss record 209 of 64212304## at 0x402894D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)12304## by 0x781916: __glcGetThreadArea (in /mnt/dev/warzone2100/src/warzone2100)12304## by 0x77EDF0: __glcLock (in /mnt/dev/warzone2100/src/warzone2100)12304## by 0x78487A: __glcContextCreate (in /mnt/dev/warzone2100/src/warzone2100)12304## by 0x77F3FE: glcGenContext (in /mnt/dev/warzone2100/src/warzone2100)12304## by 0x756AFC: iV_initializeGLC() (textdraw.cpp:123)12304## by 0x756DFC: iV_TextInit() (textdraw.cpp:205)12304## by 0x5A89FF: systemInitialise() (init.cpp:521)12304## by 0x5D115B: realmain(int, char**) (main.cpp:1278)12304## by 0x792183: main (main_sdl.cpp:24)12304## ==12304== 84 bytes in 2 blocks are still reachable in loss record 381 of 64212304## at 0x402894D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)12304## by 0x400AA85: _dl_new_object (dl-object.c:161)12304## by 0x4005FB5: _dl_map_object_from_fd (dl-load.c:957)12304## by 0x40076B7: _dl_map_object (dl-load.c:2468)12304## by 0x400CF61: openaux (dl-deps.c:65)12304## by 0x400D925: _dl_catch_error (dl-error.c:178)12304## by 0x400C02B: _dl_map_object_deps (dl-deps.c:247)12304## by 0x4011EB7: dl_open_worker (dl-open.c:263)12304## by 0x400D925: _dl_catch_error (dl-error.c:178)12304## by 0x4011899: _dl_open (dl-open.c:633)12304## by 0x8E1DF65: dlopen_doit (dlopen.c:67)12304## by 0x400D925: _dl_catch_error (dl-error.c:178)12304==

But I can't tell yet, whether they are warzone2100's fault or external issues. For the former, looking at the QuesoGLC 0.7.2 documentation and source code as well as some printf'ing in the Warzone2100 code it looked more like a bug in the external glcDeleteContext() function which as far as I can tell is properly called from the warzone2100 side. For the latter - no idea where that comes from.


Issue migrated from trac:3399 at 2022-04-16 09:44:00 -0700

@wzdev-ci
Copy link
Contributor Author

T_X uploaded file 0001-Fix-non-critical-memleak-in-NETinit-NetPlay.MOTD.patch (1.2 KiB)

@wzdev-ci
Copy link
Contributor Author

T_X uploaded file 0002-Fix-non-critical-memleak-in-initEffectsSystem-chunkL.patch (2.3 KiB)

@wzdev-ci
Copy link
Contributor Author

T_X uploaded file 0003-Fix-non-critical-memleak-in-NETinitQueue-netQueues-a.patch (3.4 KiB)

@wzdev-ci
Copy link
Contributor Author

T_X uploaded file 0004-Fix-non-critical-memleak-in-createHeader-dbgHeader.patch (2.5 KiB)

@wzdev-ci
Copy link
Contributor Author

vexed changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

vexed changed resolution from `` to duplicate

@wzdev-ci
Copy link
Contributor Author

vexed commented


Please keep these in one ticket, we have 3 tickets open for this now.

Duplicate of #3395, #3218

@wzdev-ci
Copy link
Contributor Author

T_X uploaded file 0005-Fix-non-critical-memleak-in-NETinitQueue-netGameQueu.patch (3.1 KiB)

Though kind of redundant - vexed had fixed that one already too #3395

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Apr 11, 2012

T_X commented


Replying to Warzone2100/old-trac-import#3399 (comment:1):

Please keep these in one ticket, we have 3 tickets open for this now.

Duplicate of #3395, #3218

Oh, and I'm sorry, I thought I was supposed to open a new patch ticket (according to Warzone2100/warzone2100#30). But oki doki, I will stop posting to this ticket then now, no problem :). You're right, it is getting, ehm, slightly confusing with four places to post comments :D.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant