Basic static analysis for memory leaks

NEW
Assigned to

Status

()

Core
Rewriting and Analysis
8 years ago
6 years ago

People

(Reporter: (dormant account), Assigned: seema)

Tracking

(Blocks: 1 bug)

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 obsolete attachments)

(Reporter)

Description

8 years ago
Ensure that following new/malloc a variable either escapes(therefore too much hassle to prove anything) or is free()ed.
(Assignee)

Comment 1

7 years ago
hello.. I'm a student of SJCE,Mysore. I'd like to take up the 
Bug 526309  Basic check for memory leak
Assignee: nobody → seema.ankadavar
(Assignee)

Comment 2

7 years ago
Created attachment 444296 [details] [diff] [review]
Script comparing dynamic allocations and deallcations.
Attachment #444296 - Flags: feedback?
Comment on attachment 444296 [details] [diff] [review]
Script comparing dynamic allocations and deallcations.

- Marking the attachment as patch
- Including taras' name in the feedback request.  
- Making the patch description concise.
Attachment #444296 - Attachment description: This code puts dynamicaaly allocated variables in an araay and deallocated variables in another array. checks for any variable that is not deallocated comparing both arrays → Script comparing dynamic allocations and deallcations.
Attachment #444296 - Attachment is patch: true
Attachment #444296 - Attachment mime type: application/javascript → text/plain
Attachment #444296 - Flags: feedback? → feedback?(tglek)
(Assignee)

Comment 4

7 years ago
Created attachment 444317 [details] [diff] [review]
This code checks for variable pointing to dynamically allocated memory block
Attachment #444296 - Attachment is obsolete: true
Attachment #444317 - Flags: feedback?(tglek)
Attachment #444296 - Flags: feedback?(tglek)
(Reporter)

Comment 5

7 years ago
(In reply to comment #4)
> Created an attachment (id=444317) [details]
> This code checks for variable pointing to dynamically allocated memory block

looks promising, please run this on mozilla and post some results.
(Reporter)

Comment 6

7 years ago
Comment on attachment 444317 [details] [diff] [review]
This code checks for variable pointing to dynamically allocated memory block

waiting on results
Attachment #444317 - Flags: feedback?(tglek)

Updated

6 years ago
Whiteboard: [MemShrink]
Taras, I'm highly skeptical that the attached patch can produce anything useful.  What do you think?  Should we close this bug?  There are other tools like cppcheck that statically detect leaks.
Summary: Basic check for memory leaks → Basic static analysis for memory leaks
(Reporter)

Comment 8

6 years ago
Comment on attachment 444317 [details] [diff] [review]
This code checks for variable pointing to dynamically allocated memory block

This is a valid static analysis bug, this patch is not useful. This should not be part of memshrink.
Attachment #444317 - Attachment is obsolete: true
Whiteboard: [MemShrink]
You need to log in before you can comment on or make changes to this bug.