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 752989 - allocator: Use of uninitialised value of size 4 while using valgrind
allocator: Use of uninitialised value of size 4 while using valgrind
Status: RESOLVED DUPLICATE of bug 747110
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-29 01:03 UTC by Vineeth
Modified: 2015-07-29 12:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
initialize the slice before using it (1.18 KB, patch)
2015-07-29 01:05 UTC, Vineeth
rejected Details | Review

Description Vineeth 2015-07-29 01:03:29 UTC
When checking a mp4 file with gstvalidate using valgrind, got the below error

==18868== Thread 5 multiqueue0:src_:
==18868== Use of uninitialised value of size 4
==18868==    at 0x9D98176: decode_ics.constprop.26 (aacdec.c:1568)
==18868==    by 0x9D99356: decode_cpe (aacdec.c:1993)
==18868==    by 0x9D9B216: aac_decode_frame_int (aacdec.c:2816)
==18868==    by 0x9D9CE2C: aac_decode_frame (aacdec.c:2950)
==18868==    by 0x9C896D0: avcodec_decode_audio4 (utils.c:1657)
==18868==    by 0x98C84EC: gst_ffmpegauddec_audio_frame.isra.0 (gstavauddec.c:475)
==18868==    by 0x98C8B60: gst_ffmpegauddec_frame (gstavauddec.c:631)
==18868==    by 0x98C93A0: gst_ffmpegauddec_handle_frame (gstavauddec.c:752)
==18868==    by 0x4807F61: gst_audio_decoder_handle_frame.isra.3 (gstaudiodecoder.c:1473)
==18868==    by 0x480828A: gst_audio_decoder_push_buffers (gstaudiodecoder.c:1571)
==18868==    by 0x480883A: gst_audio_decoder_chain_forward (gstaudiodecoder.c:1685)
==18868==    by 0x480A6DF: gst_audio_decoder_chain (gstaudiodecoder.c:1943)
==18868==    by 0x40DE99E: gst_pad_push_data (gstpad.c:4038)
==18868==    by 0x48598D1: gst_base_parse_push_frame (gstbaseparse.c:2339)
==18868==    by 0x485AB88: gst_base_parse_chain (gstbaseparse.c:2949)
==18868==    by 0x40DE99E: gst_pad_push_data (gstpad.c:4038)
==18868==    by 0x6A899BF: gst_multi_queue_loop (gstmultiqueue.c:1237)
==18868==    by 0x41138E8: gst_task_func (gsttask.c:331)
==18868==    by 0x4114A8E: default_func (gsttaskpool.c:68)
==18868==    by 0x4273404: ??? (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==18868==  Uninitialised value was created by a heap allocation
==18868==    at 0x402C17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==18868==    by 0x4251BE2: g_malloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==18868==    by 0x4268281: g_slice_alloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==18868==    by 0x409B173: _sysmem_new_block (gstallocator.c:414)
==18868==    by 0x409B84A: gst_allocator_alloc (gstallocator.c:311)
==18868==    by 0x40A6D15: gst_buffer_new_allocate (gstbuffer.c:755)
==18868==    by 0x4872C08: gst_base_src_default_alloc (gstbasesrc.c:1435)
==18868==    by 0x4871B44: gst_base_src_default_create (gstbasesrc.c:1473)
==18868==    by 0x4875121: gst_base_src_get_range (gstbasesrc.c:2455)
==18868==    by 0x48776B3: gst_base_src_getrange (gstbasesrc.c:2623)
==18868==    by 0x40DF6D0: gst_pad_get_range_unchecked (gstpad.c:4477)
==18868==    by 0x40E75C4: gst_pad_pull_range (gstpad.c:4716)
==18868==    by 0x40CEA6D: gst_proxy_pad_getrange_default (gstghostpad.c:184)
==18868==    by 0x40DF6D0: gst_pad_get_range_unchecked (gstpad.c:4477)
==18868==    by 0x40E75C4: gst_pad_pull_range (gstpad.c:4716)
==18868==    by 0x6AA6B53: gst_type_find_element_getrange (gsttypefindelement.c:988)
==18868==    by 0x40DF6D0: gst_pad_get_range_unchecked (gstpad.c:4477)
==18868==    by 0x40E75C4: gst_pad_pull_range (gstpad.c:4716)
==18868==    by 0x72CD6EC: gst_qtdemux_pull_atom (qtdemux.c:663)
==18868==    by 0x72F268C: gst_qtdemux_loop (qtdemux.c:4693)



This is happening due to allocator using g_slice_alloc.
When i use g_slice_alloc0, it does the same as g_slice_alloc and memsets it to 0, thus removing the uninitialized error.
Comment 1 Vineeth 2015-07-29 01:05:54 UTC
Created attachment 308350 [details] [review]
initialize the slice before using it
Comment 2 Tim-Philipp Müller 2015-07-29 07:43:31 UTC

*** This bug has been marked as a duplicate of bug 747110 ***
Comment 3 Vineeth 2015-07-29 07:57:18 UTC
i did see the other bug..
but for that bug it was showing as "Invalid read of size 4" and for me "Use of uninitialised value of size 4", so i thought it was different.
And the cause of both seemed to be different.
Comment 4 Tim-Philipp Müller 2015-07-29 08:08:30 UTC
I'm 99% sure it's the exact same issue just with slightly different inputs.
Comment 5 Nicolas Dufresne (ndufresne) 2015-07-29 12:32:33 UTC
(In reply to Vineeth from comment #1)
> Created attachment 308350 [details] [review] [review]
> initialize the slice before using it

This would have a performance impact on something that I believe is a bug upstream.