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 767642 - g-log: We got a g_log critical issue : gst_caps_is_equal: assertion 'GST_IS_CAPS (caps1)' failed
g-log: We got a g_log critical issue : gst_caps_is_equal: assertion 'GST_IS_C...
Status: RESOLVED NOTGNOME
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.6.3
Other Linux
: Normal critical
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-14 10:25 UTC by yvonne.chen
Modified: 2016-06-17 09:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valgrind log (25.80 KB, text/plain)
2016-06-15 02:49 UTC, yvonne.chen
Details

Description yvonne.chen 2016-06-14 10:25:43 UTC
Hello guys 
I get one gst-validat failed items that  I cannot get rid of.
I am using custom decoders . It seems GST_IS_BUFFER (buffer) in fucntion gst_buffer_unmap . I added the check before gst_buffer_unmap call in my custom codes. But find nothing caused this.
How to locate the issue? Need your help. Thanks!
# GST_GL_XINITTHREADS=1 gst-validate-media-check-1.0  file:///mnt/gst-validate/gst-integration-testsuites/medias/defaults/exMPD_BIP_TC1/ElephantsDream_AAC48K_064.mp4 --expe
cted-results "/mnt/gst-validate/gst-integration-testsuites/medias/defaults/exMPD_BIP_TC1/ElephantsDream_AAC48K_064.mp4.media_info"
(gst-validate-media-check-1.0:22358): GStreamer-CRITICAL **: gst_debug_log_valist: assertion 'category != NULL' failed
              validate gst-validate-reporter.c:176:gst_validate_report_valist: <(null)> 1590 (critical) : g-log: We got a g_log critical issue : gst_caps_is_equal: assertion 'GST_IS_CAPS (caps1)' failed
0:00:00.413386000 22358 0xb5a34460 ERROR               validate gst-validate-reporter.c:176:gst_validate_report_valist: <(null)> 1575 (critical) : file-checking: resulting file stream profiles didn't match expected values : Reference descriptor for stream 480add4955b8afc393fc8f3e09448e7d32b7c9e3a3565f409c466954aa0a83d3/001 has caps: NULL but compared stream 62084f72bed87ae40ade86b74ff96ec004e28b4910c05cc4acd1b538abd00199/001 has caps: audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)1, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)1310, rate=(int)24000, channels=(int)2


0:00:00.579737000 19953    0x19600 WARN               structure gststructure.c:2270:gst_structure_parse_field: failed to parse value codec_data=(buffer)NULL, rate=(int)24000, channels=(int)2
0:00:00.580045000 19953    0x19600 WARN               structure gststructure.c:2438:priv_gst_structure_parse_fields: Failed to parse field, r=codec_data=(buffer)NULL, rate=(int)24000, channels=(int)2
0:00:00.581495000 19953    0x19600 ERROR               validate gst-validate-reporter.c:176:gst_validate_report_valist: <(null)> 1590 (critical) : g-log: We got a g_log critical issue : gst_caps_is_equal: assertion 'GST_IS_CAPS (caps1)' failed
0:00:00.582136000 19953    0x19600 ERROR               validate gst-validate-reporter.c:176:gst_validate_report_valist: <(null)> 1575 (critical) : file-checking: resulting file stream profiles didn't match expected values : Reference descriptor for stream 480add4955b8afc393fc8f3e09448e7d32b7c9e3a3565f409c466954aa0a83d3/001 has caps: NULL but compared stream 62084f72bed87ae40ade86b74ff96ec004e28b4910c05cc4acd1b538abd00199/001 has caps: audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)1, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)1310, rate=(int)24000, channels=(int)2
0:00:00.583365000 19953    0x19600 INFO                GST_INIT gst.c:952:gst_deinit: deinitializing GStreamer
0:00:00.609409000 19953    0x19600 INFO                GST_INIT gst.c:1083:gst_deinit: deinitialized GStreamer
Comment 1 Tim-Philipp Müller 2016-06-14 18:23:43 UTC
Can you run it in valgrind on your device?

I would guess it's again a bug in your custom decoder, perhaps around codec_data handling this time?
Comment 2 yvonne.chen 2016-06-15 02:49:22 UTC
Created attachment 329830 [details]
valgrind log
Comment 3 yvonne.chen 2016-06-15 03:19:47 UTC
and another issue I get critical errors using gst-validate-launcher -M /mnt/gst-validate --generate-media-info -t validate.dash.playback.change_state_intensive.dash_exMPD_BIP_TC1

==== Got criticals, Return value set to 18 ====
     Critical error Wrong combined flow return flushing(-2). Expected: ok(0)
     Critical error Wrong combined flow return flushing(-2). Expected: ok(0)

Issues found: 4
Returning 18 as error where found
=======> Test FAILED (Return value: 18)

[1 / 1] validate.dash.playback.change_state_intensive.dash_exMPD_BIP_TC1: Failed (Application returned 18 (issues: [flow return from pad push doesn't match expected value]))

but when I use reproduce command ,  GST_GL_XINITTHREADS=1 GST_VALIDATE_OVERRIDE=:/mnt/gst-validate/gst-integration-testsuites/medias/defaults/online-streams-infos/dash/dash.exMPD_BIP_TC1.override GST_VALIDATE_SCENARIO=change_state_intensive gst-validate-1.0  playbin uri=http://127.0.0.1:8079/defaults/exMPD_BIP_TC1/exMPD_BIP_TC1.mpd --set-media-info "/mnt/gst-validate/gst-integration-testsuites/medias/defaults/online-streams-infos/dash/dash.exMPD_BIP_TC1.stream_info"

the test passed.

how can I locate the issue?
Comment 4 yvonne.chen 2016-06-16 08:17:45 UTC
Hi How about the valgrind log show?
Comment 5 Sebastian Dröge (slomo) 2016-06-17 08:38:05 UTC
It shows that somewhere an invalid read is happening, related to caps and a buffer in caps. So probably again codec_data or streamheaders handling in your custom decoder. Please reopen if it is indeed a bug not in your custom decoder element.


There are also lots of warnings from inside your decoder, you should really try to get rid of them.
Comment 6 yvonne.chen 2016-06-17 09:07:48 UTC
Thanks for your attention,slomo.  I reopen it first for your attention.  I am not so familiar with the buffer handling.  Maybe the following codes related? 
Please take a moment help me to find it out.My project is blocked by it. Thanks
if (gst_structure_has_field(structure, "codec_data")) {
    extra_data_buf = (GValue *) gst_structure_get_value(structure, "codec_data");

if (extra_data_buf) {
    info->configdata = gst_buffer_copy(gst_value_get_buffer(extra_data_buf));
			AML_DUMP_BUFFER(info->configdata, "Audio Codec Data");
    }
}
====================
int extract_adts_header(StreamInfo *info,codec_para_t *pcodec, GstBuffer *buffer)
{
	adts_header_t hdr;
	guint8 *p = NULL;
	guint8 *buf;
	GstMapInfo map;
	if (info->configdata) {
		gst_buffer_map(info->configdata, &map, GST_MAP_READ);
		p = map.data;
		hdr.profile = (*p >> 3) - 1;                  
		hdr.sample_freq_idx = (*p & 0x7) << 1 | (*(p + 1) >> 7);                    
		hdr.channel_configuration = (*(p + 1) & 0x7f) >> 3;                    
		gst_buffer_unmap(info->configdata, &map);
	} else {
		return 0;
	}

	hdr.syncword = 0xfff;
	hdr.id = 0;
	hdr.layer = 0;
	hdr.protection_absent = 1;
	hdr.private_bit = 0;
	hdr.original_copy = 0;
	hdr.home = 0;
	hdr.copyright_identification_bit = 0;
	hdr.copyright_identification_start = 0;
	hdr.aac_frame_length = 0;
	hdr.adts_buffer_fullness = 0x7ff;

	gst_buffer_map(buffer, &map, GST_MAP_WRITE);
	buf = map.data;
	if (buf) {
		buf[0] = (char) (hdr.syncword >> 4);
		buf[1] = (char) ((hdr.syncword & 0xf << 4) ;
		buf[2] = (char) ((hdr.profile << 6) ;
		buf[3] = (char) (((hdr.channel_configuration & 0x3) << 6));
		buf[4] = (char) ((hdr.aac_frame_length >> 3) & 0xff);
		buf[5] = (char) (((hdr.aac_frame_length & 0x7) << 5);
		buf[6] = (char) (((hdr.adts_buffer_fullness & 0x3f) << 2);
		
		gst_buffer_unmap(buffer, &map);

		gst_buffer_unref(info->configdata);
		
		info->configdata = gst_buffer_copy(buffer);

		gst_buffer_set_size(info->configdata, ADTS_HEADER_SIZE);


	} else {		
		return -1;
	}

	return 0;
}
=================================
gint adts_startcode(StreamInfo* info, codec_para_t *pcodec, GstBuffer *buffer)
{
    gint8 *buf ;
    int i;
    int size = ADTS_HEADER_SIZE + gst_buffer_get_size(buffer);   // 13bit valid
    size &= 0x1fff;
    guint8 *adts_header=NULL;
    GstBuffer *buffer1;
    GstMapInfo map;
    if (!info->configdata) {
    	return 0;
    }

    while (buffer&&gst_buffer_get_size(buffer)>=ADTS_HEADER_SIZE) {
        buffer1 = gst_buffer_new_and_alloc(ADTS_HEADER_SIZE);
        if (buffer1) {
        	gst_buffer_copy_into(buffer1, buffer, GST_BUFFER_COPY_DEEP, 0, ADTS_HEADER_SIZE);
        	gst_buffer_map(buffer1, &map, GST_MAP_READ);
        	adts_header=map.data;
        	//gst_buffer_unmap(buffer1, &map);
			
		if (((adts_header[0] << 4) != 0xFFF)     
			break;
		if (((*(adts_header + 4) & 0xFF) << 3))    
			break;
		}
		else  break;
        GST_WARNING(" AAC es has adts header,don't add again");
        
        gst_buffer_unmap(buffer1, &map);
        if(adts_header){
            gst_buffer_unref(buffer1);
             buffer1=NULL;
        }		
        return 0; 
    }


    if(adts_header){
        gst_buffer_unmap(buffer1, &map);	
        gst_buffer_unref(buffer1);
        buffer1=NULL;
    }
	
    gst_buffer_map(info->configdata, &map, GST_MAP_WRITE);
	  buf = map.data;
    if (buf!=NULL) {
        buf[3] = (buf[3] & 0xfc) | (size >> 11);
        buf[4] = (size >> 3) & 0xff;
        buf[5] = ((size & 0x7) << 5);
        
        if ( gst_buffer_get_size(info->configdata) == ADTS_HEADER_SIZE) {
            codec_write(pcodec,buf,gst_buffer_get_size(info->configdata));
	        }
    }
	  gst_buffer_unmap(info->configdata, &map);

    return 0;
}
Comment 7 Sebastian Dröge (slomo) 2016-06-17 09:11:27 UTC
This is not a support forum for any possible code using GStreamer. Please ask on the mailing list, thanks!