GNOME Bugzilla – Bug 783289
gst_structure_from_string fails to parse some objects
Last modified: 2017-06-01 10:37:20 UTC
Created attachment 352955 [details] [review] tests/gststructure: add unit test to verify deserialization of a stream-status message I came across this warning in some project and wrote a quick unit test to verify it's an upstream bug. I have not investigated it further yet. The test case is basically this: Take a new stream-status GstMessage, get its GstStructure, serialize it to a string, then try to parse this string back to a GstStructure. Although the serialized string is ok (see the SERIALIZED line below), parsing it fails and shows a strange, corrupt string in the warning message Running suite(s): GstStructure SERIALIZED: GstMessageStreamStatus, type=(GstStreamStatusType)GST_STREAM_STATUS_TYPE_CREATE, owner=(GstElement)"\(GstBin\)\ element1", object=(GstTask)"\(GstTask\)\ task0"; 0:00:00.002331102 12023 0x564706dfc320 WARN structure gststructure.c:1967:gst_structure_parse_field: failed to parse value owner=(GstElement)(GstBin) element1ent1", object=(GstTask)"\(GstTask\)\ task0"; 0:00:00.002404953 12023 0x564706dfc320 WARN structure gststructure.c:2035:priv_gst_structure_parse_fields: Failed to parse field, r=owner=(GstElement)(GstBin) element1ent1", object=(GstTask)"\(GstTask\)\ task0"; 0%: Checks: 1, Failures: 1, Errors: 0 gst/gststructure.c:357:F:general:test_to_from_string_stream_status_message:0: Assertion 'st2 != NULL' failed
It's not really serializing the GstElement or GstTask, as they're cmplex objects. It's just a debugging tool in that case. So it can't be parsed back into a valid stream-status message.
It sure doesn't make sense to deserialize objects, but imho it shouldn't fail like that. It could maybe warn about being unable to deserialize objects and null them out or something. This error clearly shows some corruption in the parser. But I guess it's a minor issue...