https://bugs.winehq.org/show_bug.cgi?id=36296
Bug ID: 36296 Summary: valgrind shows a potential leak in msvcp90/tests/ios.c Product: Wine Version: 1.7.18 Hardware: x86 OS: Linux Status: NEW Keywords: download, source, testcase Severity: normal Priority: P2 Component: msvcp Assignee: wine-bugs@winehq.org Reporter: austinenglish@gmail.com
==4993== 12 bytes in 1 blocks are possibly lost in loss record 78 of 270 ==4993== at 0x7BC4C735: notify_alloc (heap.c:255) ==4993== by 0x7BC50F79: RtlAllocateHeap (heap.c:1716) ==4993== by 0x5238262: MSVCRT_operator_new (heap.c:63) ==4993== by 0x5576CF7: locale_facet_register (locale.c:257) ==4993== by 0x557AE2C: ctype_char_use_facet (locale.c:1763) ==4993== by 0x5565633: basic_istream_char(intXX_t, long long) (ios.c:7728) ==4993== by 0x556570E: basic_istream_char_ipfx (ios.c:7757) ==4993== by 0x55657E9: basic_istream_char_sentry_create (ios.c:7775) ==4993== by 0x5567D9C: basic_istream_char_read_uint64 (ios.c:8606) ==4993== by 0x49571BB: test_num_get_get_uint64 (ios.c:1054) ==4993== by 0x495C89F: func_ios (ios.c:1959) ==4993== by 0x4965F3E: run_test (test.h:584) ==4993== by 0x496633B: main (test.h:654) ==4993==
==5033== 12 bytes in 1 blocks are possibly lost in loss record 89 of 270 ==5033== at 0x7BC4C735: notify_alloc (heap.c:255) ==5033== by 0x7BC50F79: RtlAllocateHeap (heap.c:1716) ==5033== by 0x5238262: MSVCRT_operator_new (heap.c:63) ==5033== by 0x5576CF7: locale_facet_register (locale.c:257) ==5033== by 0x5582135: numpunct_short_use_facet (locale.c:4418) ==5033== by 0x558C55C: num_put_short__Iput (locale.c:8151) ==5033== by 0x558CAA9: num_put_short_do_put_ulong (locale.c:8260) ==5033== by 0x558CB7C: num_put_wchar_put_ulong (locale.c:8277) ==5033== by 0x55634B7: basic_ostream_print_ushort (ios.c:6974) ==5033== by 0x55635A0: basic_ostream_short_print_ushort (ios.c:6996) ==5033== by 0x495C795: test_ostream_print_ushort (ios.c:1943) ==5033== by 0x495C8D1: func_ios (ios.c:1969) ==5033== by 0x4965F3E: run_test (test.h:584) ==5033== by 0x496633B: main (test.h:654) ==5033==
==5054== 12 bytes in 1 blocks are possibly lost in loss record 88 of 270 ==5054== at 0x7BC4C735: notify_alloc (heap.c:255) ==5054== by 0x7BC50F79: RtlAllocateHeap (heap.c:1716) ==5054== by 0x5248262: MSVCRT_operator_new (heap.c:63) ==5054== by 0x5586CF7: locale_facet_register (locale.c:257) ==5054== by 0x559B659: num_put_short_use_facet (locale.c:7850) ==5054== by 0x5573589: basic_ostream_short_print_ushort (ios.c:6996) ==5054== by 0x495C795: test_ostream_print_ushort (ios.c:1943) ==5054== by 0x495C8D1: func_ios (ios.c:1969) ==5054== by 0x4965F3E: run_test (test.h:584) ==5054== by 0x496633B: main (test.h:654) ==5054==
etc.
http://bugs.winehq.org/show_bug.cgi?id=36296
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban@gmail.com
--- Comment #1 from Piotr Caban piotr.caban@gmail.com --- This is caused by optimization that skips memory freeing when dll is unloaded on process exit. You need to disable it before using valgrind. Maybe we should think about a way of running the tests with cleanup code executed.
The leaks are gone when you comment: if (lpvReserved) break; line in DllMain.
https://bugs.winehq.org/show_bug.cgi?id=36296
--- Comment #2 from Austin English austinenglish@gmail.com --- *** Bug 36295 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=36296
--- Comment #3 from Austin English austinenglish@gmail.com --- (In reply to Piotr Caban from comment #1)
This is caused by optimization that skips memory freeing when dll is unloaded on process exit. You need to disable it before using valgrind. Maybe we should think about a way of running the tests with cleanup code executed.
That would be very useful, for Coverity and maybe Clang or other tools as well.
https://bugs.winehq.org/show_bug.cgi?id=36296
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |73a996de013264379c1b68e9512 | |aa127b0b21bfb Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #4 from Piotr Caban piotr.caban@gmail.com --- In this case it was quite easy to force dll unload before process exit because msvcp90.dll is loaded dynamically.
https://bugs.winehq.org/show_bug.cgi?id=36296
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.19.