After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747554 - suppressions: silence possible valgrind false positive
suppressions: silence possible valgrind false positive
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-09 12:20 UTC by Vincent Penquerc'h
Modified: 2015-04-17 14:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
suppression for the report (890 bytes, patch)
2015-04-09 12:21 UTC, Vincent Penquerc'h
none Details | Review
suppression for the report (758 bytes, patch)
2015-04-10 13:29 UTC, Vincent Penquerc'h
committed Details | Review

Description Vincent Penquerc'h 2015-04-09 12:20:30 UTC
Running: make -C tests/check elements/deinterlace.valgrind

I see a few of those:

==4552== Invalid read of size 8
==4552==    at 0x5E010EF: __GI___strncasecmp_l (strcmp.S:1897)
==4552==    by 0x5DB23EF: ____strtod_l_internal (strtod_l.c:574)
==4552==    by 0x536B0A0: gst_value_deserialize_double (gstvalue.c:2737)
==4552==    by 0x534E5DF: gst_structure_parse_value (gststructure.c:2312)
==4552==    by 0x535178B: priv_gst_structure_parse_fields (gststructure.c:2229)
==4552==    by 0x5303414: gst_caps_from_string (gstcaps.c:2306)
==4552==    by 0x40252F: deinterlace_check_passthrough (deinterlace.c:237)
==4552==    by 0x402B5D: test_mode_disabled_passthrough (deinterlace.c:414)
==4552==    by 0x50B8A79: srunner_run (check_run.c:450)
==4552==    by 0x50B14BC: gst_check_run_suite (gstcheck.c:824)
==4552==    by 0x40185D: main (deinterlace.c:463)

After a while debugging, I came to the conclusion that either libc is buggy, or valgrind is, because I can repro the issue with:

#include <stdlib.h>
#include <string.h>
int main(void) {
  char *e=NULL;
  char *p=strdup("interleaved");
  double x=strtod(p,&e);
  free(p);
  return 0;
}

And then I found this:
http://stackoverflow.com/questions/10572715/valgrind-invalid-read-with-c-str-and-strtod

The sample code above seems bugfree.

A nice side effect is that I found in the strtod man page:

       An infinity is either "INF" or "INFINITY", disregarding case.

       A NAN is "NAN" (disregarding case) optionally followed by '(', a
       sequence of characters, followed by ')'.  The character string speci‐
       fies in an implementation-dependent way the type of NAN.

Anyway, I'm proposing this patch which sweeps it under the carpet, but I'll wait for comments about it, in case I've missed a stupid thing, since blaming valgrind or libc seems like the easy way out.
Comment 1 Vincent Penquerc'h 2015-04-09 12:21:23 UTC
Created attachment 301203 [details] [review]
suppression for the report
Comment 2 Vincent Penquerc'h 2015-04-10 13:29:47 UTC
Created attachment 301287 [details] [review]
suppression for the report

Moved to common/gst.supp, where it makes more sense since it's from a core function.
Comment 3 Sebastian Dröge (slomo) 2015-04-16 12:18:12 UTC
(In reply to Vincent Penquerc'h from comment #2)
> Created attachment 301287 [details] [review] [review]
> suppression for the report
> 
> Moved to common/gst.supp, where it makes more sense since it's from a core
> function.

Did someone report that to glibc?
Comment 4 Vincent Penquerc'h 2015-04-16 12:21:36 UTC
I did not, though the reference I found seemed to point to valgrind as the probable culprit. I guess I might look at running it with libefence, which ought to catch that one easily if it's libc and not valgrind.
Comment 5 Vincent Penquerc'h 2015-04-16 13:05:41 UTC
The strtod code that looks for infinity looks ok, and libefence doesn't trigger, so it looks like valgrind. Of which I have an old version, so I'll update, you never know.
Comment 6 Vincent Penquerc'h 2015-04-16 13:38:40 UTC
And it's gone with valgrind 3.10.1 :)
So the suppression is the right thing to do. I was using 3.7.0, not sure when exactly the fix came. 3.7.0 shows a copyright till 2011.
Comment 7 Vincent Penquerc'h 2015-04-17 14:20:48 UTC
Pushed, since it's indeed a false positive.