Ticket #106 (assigned task)

Opened 1 year ago

Last modified 1 week ago

Fix leaks reported by Valgrind

Reported by: odole Assigned to: jchaffraix (accepted)
Priority: major Milestone: Galekid
Component: Bug Fix Version: 1.0
Keywords: Cc:
Number of hours worked: 5 % Complete: 10
Number of hours remaining:

Description

Valgrind reports many leaks which should be fixed
Use:

valgrind --leak-check=yes --show-reachable=yes -v --log-file-exactly=valgrind-owb.txt ./owb url

to detect leaks.
See this site for explanations about valgrind output

Attachments

WindowBal-refptr.2.patch (1.3 kB) - added by jchaffraix on 12/11/07 20:48:53.
Correct the previous 'invalid write'
BCResourceCurl-leak.6.patch (2.2 kB) - added by jchaffraix on 12/11/07 23:36:08.
Correct the memory leak
font.patch (4.7 kB) - added by odole on 01/07/08 14:40:14.
fix a potential leak in font

Change History

09/12/07 11:41:06 changed by odole

revision 108: Fix a leak reported by Valgrind about ~FrameLoaderClientWebUI()
- Use a deref() instead of a delete for RefPtr.
The leak was:

==20324== Invalid write of size 4
==20324==    at 0x806A9A9: WebCore::FrameLoaderClientWebUI::~FrameLoaderClientWebUI() (Shared.h:48)
==20324==    by 0x8061EB9: WebCore::FrameLoaderClientBal::frameLoaderDestroyed() (FrameLoaderClientBal.cpp:156)
==20324==    by 0x42B0E7A: WebCore::FrameLoader::~FrameLoader() (FrameLoader.cpp:238)
==20324==    by 0x4285035: WebCore::FramePrivate::~FramePrivate() (Frame.cpp:1872)
==20324==    by 0x4285C0B: WebCore::Frame::~Frame() (Frame.cpp:253)
==20324==    by 0x80713F7: WebCore::FrameBal::~FrameBal() (FrameBal.cpp:106)
==20324==    by 0x805D734: BAL::WindowBal::~WindowBal() (WindowBal.cpp:100)
==20324==    by 0x805C1B2: BAL::BCWindowManager::closeWindow(BAL::BIWindow*) (BCWindowManager.cpp:98)
==20324==    by 0x805AD56: main (main.cpp:146)
==20324==  Address 0x613FFD4 is 4 bytes inside a block of size 16 free'd
==20324==    at 0x40212AC: free (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==20324==    by 0x582E162: WTF::fastFree(void*) (FastMalloc.cpp:97)
==20324==    by 0x80713FF: WebCore::FrameBal::~FrameBal() (FastMalloc.h:57)
==20324==    by 0x806A9DE: WebCore::FrameLoaderClientWebUI::~FrameLoaderClientWebUI() (FrameLoaderClientWebUI.cpp:67)
==20324==    by 0x8061EB9: WebCore::FrameLoaderClientBal::frameLoaderDestroyed() (FrameLoaderClientBal.cpp:156)
==20324==    by 0x42B0E7A: WebCore::FrameLoader::~FrameLoader() (FrameLoader.cpp:238)
==20324==    by 0x4285035: WebCore::FramePrivate::~FramePrivate() (Frame.cpp:1872)
==20324==    by 0x4285C0B: WebCore::Frame::~Frame() (Frame.cpp:253)
==20324==    by 0x80713F7: WebCore::FrameBal::~FrameBal() (FrameBal.cpp:106)
==20324==    by 0x805D734: BAL::WindowBal::~WindowBal() (WindowBal.cpp:100)
==20324==    by 0x805C1B2: BAL::BCWindowManager::closeWindow(BAL::BIWindow*) (BCWindowManager.cpp:98)
==20324==    by 0x805AD56: main (main.cpp:146)

09/17/07 18:32:54 changed by odole

  • hours_worked set to 4.
  • percent set to 10.

09/20/07 16:16:56 changed by odole

  • hours_worked changed from 4 to 5.

revision 127:
Fix the following leak in TimerTest.cpp:

==20292== 96 bytes in 3 blocks are still reachable in loss record 34 of 124
==20292==    at 0x4021708: malloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==20292==    by 0x422D0DC: WTF::fastMalloc(unsigned) (FastMalloc.cpp:87)
==20292==    by 0x408F0EC: BAL::getBIEventLoop() (FastMalloc.h:56)
==20292==    by 0x805E13D: TimerTest::TestTimer() (TimerTest.cpp:69)
==20292==    by 0x8051209: ExecuteVisitor::Visit(TestRunner&, TestNode*, int*) (TestRunner.cpp:155)
==20292==    by 0x8050F30: TestRunner::RecursWalkInTree(TestNode*, TestVisitor&, int*) (TestRunner.cpp:76)
==20292==    by 0x8050F95: TestRunner::RecursWalkInTree(TestNode*, TestVisitor&, int*) (TestRunner.cpp:88)
==20292==    by 0x8051002: TestRunner::WalkInTree(TestNode*, TestVisitor&, int*) (TestRunner.cpp:66)
==20292==    by 0x8051430: TestRunner::ExecuteTestTree(TestNode*) (TestRunner.cpp:209)
==20292==    by 0x80507D7: main (main.cpp:112)

11/22/07 14:17:02 changed by jcverdie

  • version changed from 2.0 to 1.0.

11/23/07 10:40:05 changed by fmarmond

  • owner changed from sroret to fmarmond.

11/29/07 15:49:29 changed by jchaffraix

  • owner changed from fmarmond to jchaffraix.
  • status changed from new to assigned.

11/29/07 23:24:33 changed by jchaffraix

Valgrind's issues corrected by the patch :

==14139== 51 bytes in 1 blocks are possibly lost in loss record 61 of 173
==14139==    at 0x4022765: malloc (vg_replace_malloc.c:149)
==14139==    by 0x5CE92CF: strdup (in /lib/tls/i686/cmov/libc-2.6.1.so)
==14139==    by 0x49FDFF3: BC::BCResourceHandleCURL::BCResourceHandleCURL(WebCore::ResourceRequest const&, WebCore::ResourceHandleClient*, bool, bool, bool) (BCResourceHandleCURL.cpp:65)
==14139==    by 0x49FE6B9: BAL::BIResourceHandle::create(WebCore::ResourceRequest const&, WebCore::ResourceHandleClient*, WebCore::Frame*, bool, bool, bool) (BCResourceHandleCURL.cpp:518)
==14139==    by 0x44DC8E6: WebCore::ResourceLoader::load(WebCore::ResourceRequest const&) (ResourceLoader.cpp:127)
==14139==    by 0x44DE2DE: WebCore::SubresourceLoader::load(WebCore::ResourceRequest const&) (SubresourceLoader.cpp:82)
==14139==    by 0x44DE1BF: WebCore::SubresourceLoader::create(WebCore::Frame*, WebCore::SubresourceLoaderClient*, WebCore::ResourceRequest const&, bool, bool, bool) (SubresourceLoader.cpp:122)
==14139==    by 0x44D2A9B: WebCore::Loader::servePendingRequests() (loader.cpp:85)
==14139==    by 0x44D34D9: WebCore::Loader::load(WebCore::DocLoader*, WebCore::CachedResource*, bool, bool, bool) (loader.cpp:60)
==14139==    by 0x44A3094: WebCore::CachedImage::CachedImage(WebCore::DocLoader*, WebCore::String const&, bool) (CachedImage.cpp:58)
==14139==    by 0x449F42C: WebCore::createResource(WebCore::CachedResource::Type, WebCore::DocLoader*, WebCore::KURL const&, WebCore::String const*, bool, bool) (Cache.cpp:69)
==14139==    by 0x449F9B8: WebCore::Cache::requestResource(WebCore::DocLoader*, WebCore::CachedResource::Type, WebCore::KURL const&, WebCore::String const*, bool, bool) (Cache.cpp:119)
==14139==

==20207== Invalid write of size 4
==20207==    at 0x806C567: WebCore::Shared<WebCore::Frame>::deref() (Shared.h:48)
==20207==    by 0x806C5ED: WTF::RefPtr<WebCore::FrameBal>::operator=(WebCore::FrameBal*) (RefPtr.h:106)
==20207==    by 0x806B104: BAL::WindowBal::~WindowBal() (WindowBal.cpp:123)
==20207==    by 0x8069D0C: BAL::BCWindowManager::closeWindow(BAL::BIWindow*) (BCWindowManager.cpp:92)
==20207==    by 0x8068CDC: main (main.cpp:198)
==20207==  Address 0x6245BBC is 4 bytes inside a block of size 16 free'd
==20207==    at 0x402237F: free (vg_replace_malloc.c:233)
==20207==    by 0x5A83540: WTF::fastFree(void*) (FastMalloc.cpp:154)
==20207==    by 0x807D047: WebCore::FrameBal::~FrameBal() (FastMalloc.h:66)
==20207==    by 0x806B0E7: BAL::WindowBal::~WindowBal() (WindowBal.cpp:120)
==20207==    by 0x8069D0C: BAL::BCWindowManager::closeWindow(BAL::BIWindow*) (BCWindowManager.cpp:92)
==20207==    by 0x8068CDC: main (main.cpp:198)

12/11/07 20:48:53 changed by jchaffraix

  • attachment WindowBal-refptr.2.patch added.

Correct the previous 'invalid write'

12/11/07 23:36:08 changed by jchaffraix

  • attachment BCResourceCurl-leak.6.patch added.

Correct the memory leak

01/07/08 14:40:14 changed by odole

  • attachment font.patch added.

fix a potential leak in font

03/06/08 10:01:37 changed by jcverdie

  • milestone changed from Blastoise to Doduo.

08/13/08 10:22:41 changed by add

http://www.salewroughtiron.cn installing metal stair rails Interior stair handrail installing metal stair rails Interior stair handrail exterior baluster Glass wood stainless wrought CONTEMPORARY designs stairways aluminum modern log banister DECK outdoor price posts vinyl curved rails http://www.china-made-door.com.cn door gate http://www.beijing-door.cn wrought CONTEMPORARY designs stairways installing metal stair rails Interior stair handrail exterior baluster Glass wood stainless wrought CONTEMPORARY designs stairways aluminum modern log banister DECK outdoor price posts vinyl curved rails http://www.hebei-railings.cn aluminum modern log banister DECK outdoor price installing metal stair rails Interior stair handrail exterior baluster Glass wood stainless wrought CONTEMPORARY designs stairways aluminum modern log banister DECK outdoor price posts vinyl curved rails posts vinyl curved rails