Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

analyzer reports leaks when data is added to hash table or linked list #8186

Open Quuxplusone opened 14 years ago

Quuxplusone commented 14 years ago
Bugzilla Link PR7772
Status NEW
Importance P normal
Reported by Mike (mike@zentific.com)
Reported on 2010-07-31 21:18:22 -0700
Last modified on 2010-08-12 15:11:13 -0700
Version unspecified
Hardware PC Linux
CC kremenek@apple.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
There should probably be a suppression setting file or way to alias functions
to free, ie list_append() = free() for the scope of a function or something
similar.

You can see more explicitly what I'm talking about here, as a leak is reported
any time allocated data is added to a list or hash table:
http://people.profusion.mobi/~lfelipe/static_analysis/efl/
Quuxplusone commented 14 years ago

Mike,

Are you using the experimental malloc/free checker? This bug report doesn't contain much context that summarizes the problem. Before people look at source code, it's often worth just showing the snippet of code that analyzer is flagging and saying in simple terms what you think the problem is. That's really what constitutes the description of the bug.

Quuxplusone commented 14 years ago

Mike: Please provide a self-contained description of the problem. The supporting source code is great, but insufficient.

Quuxplusone commented 14 years ago
Sorry, I was somewhat rushed when I reported the bug initially.  Here are some
example reports which are erroneous:

http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-50742/edje/2010-08-02-1/report-TrvMuq.html#EndPath
http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-50742/edje/2010-08-02-1/report-IgGm2O.html#EndPath
http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-50742/edje/2010-08-02-1/report-eMPfeX.html#EndPath

What is the experimental malloc/free checker?  These were found using scan-build
Quuxplusone commented 14 years ago
(In reply to comment #3)
> Sorry, I was somewhat rushed when I reported the bug initially.  Here are some
> example reports which are erroneous:
>
> http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-50742/edje/2010-
08-02-1/report-TrvMuq.html#EndPath
> http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-50742/edje/2010-
08-02-1/report-IgGm2O.html#EndPath
> http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-50742/edje/2010-
08-02-1/report-eMPfeX.html#EndPath
>

Thanks Mike.  These are a little more helpful, but they still lack some
diagnosis for why these aren't leaks (which I am assuming they aren't).  I'm
not looking for a War and Peace essay, just something brief like "this isn't
leaked because it is passed to function XXX and later frees it", etc.  You
alluded to this in your first comment, but I'm looking for a little more
detail.  Thanks!

> What is the experimental malloc/free checker?  These were found using
> scan-build

Did you pass --experimental-checks to scan-build?
Quuxplusone commented 14 years ago
(In reply to comment #4)
> (In reply to comment #3)
> > Sorry, I was somewhat rushed when I reported the bug initially.  Here are
some
> > example reports which are erroneous:
> >
> > http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-
50742/edje/2010-08-02-1/report-TrvMuq.html#EndPath
> > http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-
50742/edje/2010-08-02-1/report-IgGm2O.html#EndPath
> > http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-
50742/edje/2010-08-02-1/report-eMPfeX.html#EndPath
> >
>
> Thanks Mike.  These are a little more helpful, but they still lack some
> diagnosis for why these aren't leaks (which I am assuming they aren't).  I'm
> not looking for a War and Peace essay, just something brief like "this isn't
> leaked because it is passed to function XXX and later frees i
Quuxplusone commented 14 years ago
Err...it seems I got cut off while posting.  Let's try again...

(In reply to comment #4)
> (In reply to comment #3)
> > Sorry, I was somewhat rushed when I reported the bug initially.  Here are
some
> > example reports which are erroneous:
> >
> > http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-
50742/edje/2010-08-02-1/report-TrvMuq.html#EndPath
> > http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-
50742/edje/2010-08-02-1/report-IgGm2O.html#EndPath
> > http://people.profusion.mobi/~lfelipe/static_analysis/efl/efl-
50742/edje/2010-08-02-1/report-eMPfeX.html#EndPath
> >
>
> Thanks Mike.  These are a little more helpful, but they still lack some
> diagnosis for why these aren't leaks (which I am assuming they aren't).  I'm
> not looking for a War and Peace essay, just something brief like "this i
Quuxplusone commented 14 years ago
(from Mike via email, since Bugzilla was being unresponsive)

On Aug 2, 2010, at 2:50 PM, Michael Blumenkrantz wrote:

Hi,

For some reason I can't reply on bugzilla so I'll just mail you
directly.

In case 1 from above, the allocated data is set with
evas_object_smart_data_set to part of obj's struct since it's an opaque
struct.  The data will later be freed manual
Quuxplusone commented 14 years ago

Testing adding to comments.

Quuxplusone commented 14 years ago
(from Mike via email, since Bugzilla was being unresponsive)

On Aug 2, 2010, at 2:50 PM, Michael Blumenkrantz wrote:

Hi,

For some reason I can't reply on bugzilla so I'll just mail you
directly.

In case 1 from above, the allocated data is set with
evas_object_smart_data_set to part of obj's struct since it's an opaque
struct.  The data will later be freed manual
Quuxplusone commented 14 years ago
(posting from Mike's email, since Bugzilla wasn't cooperating)

On Aug 2, 2010, at 2:50 PM, Michael Blumenkrantz wrote:

Hi,

For some reason I can't reply on bugzilla so I'll just mail you
directly.

In case 1 from above, the allocated data is set with
evas_object_smart_data_set to part of obj's struct since it's an opaque
struct.  The data will later be freed
Quuxplusone commented 14 years ago
On Aug 2, 2010, at 2:50 PM, Michael Blumenkrantz wrote:

Hi,

For some reason I can't reply on bugzilla so I'll just mail you
directly.

In case 1 from above, the allocated data is set with
evas_object_smart_data_set to part of obj's struct since it's an opaque
struct.  The data will later be freed manually with
evas_object_smart_data_get to retrieve it.

In case 2%