GNOME Bugzilla – Bug 752989
allocator: Use of uninitialised value of size 4 while using valgrind
Last modified: 2015-07-29 12:32:33 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.
Created attachment 308350 [details] [review] initialize the slice before using it
*** This bug has been marked as a duplicate of bug 747110 ***
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.
I'm 99% sure it's the exact same issue just with slightly different inputs.
(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.