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 746354 - Malformed XGES syntax detection problems
Malformed XGES syntax detection problems
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-editing-services
1.4.5
Other Linux
: Normal normal
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-17 16:11 UTC by Kyrylo V. Polezhaiev
Modified: 2015-06-24 14:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
invalid xges file (424 bytes, text/x-xges)
2015-03-17 16:11 UTC, Kyrylo V. Polezhaiev
Details

Description Kyrylo V. Polezhaiev 2015-03-17 16:11:03 UTC
Created attachment 299610 [details]
invalid xges file

For file I attached to this report ges_project_new returns me a project, ges_asset_extract returns me non-null pipeline, and error isn't set.
So I can add this timeline to GesPipeline and have no way to understand that rednering is failed.

However, for simplest syntax errors like empty file or some trash instead of XML, timeline is null and I have something like this in my console:

0:00:14.690729768 20443       0xfe0f90 ERROR   ges_pitivi_formatter ges-pitivi-formatter.c:114:pitivi_can_load_uri: The xptv file for uri file:///mnt/cvd/p1.xges was badly formed or did not exist

I want something like that to detect malformed input files automatically.
Comment 1 Thibault Saunier 2015-03-17 16:24:03 UTC
Why makes you think there is a syntax error in that file?

The error you show (which does not happen in the case you describe here) is from the pitivi formatter (which we do not really care about).
Comment 2 Kyrylo V. Polezhaiev 2015-03-17 16:46:10 UTC
>> Why makes you think there is a syntax error in that file?
I even didn't finished <timeli tag, other XML tags aren't finished.

>> The error you show (which does not happen in the case you describe here) is from the pitivi formatter (which we do not really care about).
Yes, but I have this error message when trying to open empty file via ges_project_new/ges_asset_extract.
Comment 3 Thibault Saunier 2015-03-17 17:04:17 UTC
Sorry I did not actually had a look at the file itself.

Basically we should just make sure that we call g_markup_parse_context_end_parse so that it detects the XML does not properly end.

Patch available at: http://phabricator.freedesktop.org/D38
Comment 4 Kyrylo V. Polezhaiev 2015-03-17 17:11:24 UTC
Looks good, I'll test it tonight.
Comment 5 Kyrylo V. Polezhaiev 2015-03-17 17:16:09 UTC
Unfortunately, there are others XGES syntax issues (deeper than XML level) without option to understand, if GesProject is correctly formed.

For example, document can be XML-valid but have wrong attributes, filter names, properties, etc. In this case GesPipeline hangs and no chance for app to handle this.
Comment 6 Thibault Saunier 2015-03-17 17:38:35 UTC
The parser is usually pretty strict when parsing as it uses g_markup_collect_attributes.

Wrong properties or filter will be catched through project error signals.
Comment 7 Thibault Saunier 2015-03-17 17:39:27 UTC
> Wrong properties or filter will be catched through project error signals.

Namely GESProjectr::error-loading-asset
Comment 8 Thibault Saunier 2015-04-29 17:02:09 UTC
ges:xml-formatter: Call g_markup_parse_context_end_parse

Summary:
Otherwise the parser context will never know that is all the XML it
will receive and fail out if the XML document is not valid (in that
case if it does not end)

https://bugzilla.gnome.org/show_bug.cgi?id=746354

Reviewers: Mathieu_Du

Reviewed By: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D38
Comment 9 Thibault Saunier 2015-04-29 17:09:20 UTC
And the hash: a300ba7a644163e74984c11418c4651431