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 515701 - [smoke] Several valgrind warnings exposed by unit test
[smoke] Several valgrind warnings exposed by unit test
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal blocker
: 0.10.7
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-11 07:43 UTC by Sebastian Dröge (slomo)
Modified: 2008-02-12 05:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
smoke.diff (4.43 KB, patch)
2008-02-11 07:44 UTC, Sebastian Dröge (slomo)
none Details | Review
smoke.diff (4.53 KB, patch)
2008-02-11 14:06 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2008-02-11 07:43:09 UTC
Hi,
when running the pipelines/simple-launch-lines unit test under valgrind the smokedec and smokeenc elements are producing some warnings. All but one are generated inside of libjpeg, the other one seems to be a false warning by valgrind.

Patches for suppressions and to prevent the false warning attached.
Comment 1 Sebastian Dröge (slomo) 2008-02-11 07:44:11 UTC
Created attachment 104895 [details] [review]
smoke.diff
Comment 2 Jan Schmidt 2008-02-11 13:50:29 UTC
if by 'false warning in valgrind' you mean it warns that encsize is used uninitialised, valgrind usually knows best there :)

It looks like this line:

smokecodec_encode (smokeenc->info, data, flags, outdata, &encsize);

is passing encsize uninitialised, where I think it should be initialised to outsize just before - it looks like you pass in the allocated size of the output buffer, and it passes back the amount that was used.

That's a wasteful way to do it, of course - a pattern like that lead to massive memory use in the ffmpeg decoder because it massively over-supplied the allocated output buffer for each encode call.
Comment 3 Sebastian Dröge (slomo) 2008-02-11 14:06:04 UTC
Created attachment 104941 [details] [review]
smoke.diff

Implemented Jan's idea
Comment 4 Jan Schmidt 2008-02-11 22:44:44 UTC
Ta, seems to work here.
Comment 5 Sebastian Dröge (slomo) 2008-02-12 05:14:07 UTC
2008-02-12  Sebastian Dröge  <slomo@circular-chaos.org>

        * ext/jpeg/gstsmokeenc.c: (gst_smokeenc_chain):
        * tests/check/Makefile.am:
        * tests/check/gst-plugins-good.supp:
        Add a few libjpeg suppressions and initialize a variable to
        make smokeenc valgrind clean. Fixes bug #515701.