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 679204 - Fix GUPnPXMLDoc error reporting
Fix GUPnPXMLDoc error reporting
Status: RESOLVED FIXED
Product: GUPnP
Classification: Other
Component: gupnp
unspecified
Other All
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-06-30 19:25 UTC by Jens Georg
Modified: 2012-08-19 14:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't use xmlRecoverFile, use xmlReadFile (1023 bytes, patch)
2012-06-30 19:25 UTC, Jens Georg
committed Details | Review
Only show libxml2 console messages in debug mode (1.15 KB, patch)
2012-06-30 19:25 UTC, Jens Georg
none Details | Review
Only show libxml2 console messages in debug mode (1.15 KB, patch)
2012-06-30 19:28 UTC, Jens Georg
committed Details | Review

Description Jens Georg 2012-06-30 19:25:25 UTC
Currently GUPnPXMLDoc uses xmlRecoverFile which always returns a non-null
xmlDocPtr so can't detect invalid XML files.

The second patch disables libxml2's console messages unless GUPNP_DEBUG is set.
Comment 1 Jens Georg 2012-06-30 19:25:27 UTC
Created attachment 217743 [details] [review]
Don't use xmlRecoverFile, use xmlReadFile

xmlRecoverFile never errors out (returning a non-null file). So invalid
XML files can't be detected.
Comment 2 Jens Georg 2012-06-30 19:25:30 UTC
Created attachment 217744 [details] [review]
Only show libxml2 console messages in debug mode
Comment 3 Zeeshan Ali 2012-06-30 19:28:04 UTC
Review of attachment 217743 [details] [review]:

I thought that was the point of starting to use xmlRecoverFile: To be very lenient with broken XML descriptions out there.
Comment 4 Jens Georg 2012-06-30 19:28:38 UTC
Created attachment 217745 [details] [review]
Only show libxml2 console messages in debug mode
Comment 5 Jens Georg 2012-06-30 19:32:22 UTC
(In reply to comment #3)
> Review of attachment 217743 [details] [review]:
> 
> I thought that was the point of starting to use xmlRecoverFile: To be very
> lenient with broken XML descriptions out there.

But _new_from_path is used for local description files for services. You should be able to control those.

The remote files are still read with xmlRecoverMemory.
Comment 6 Jens Georg 2012-06-30 19:34:50 UTC
The current behaviour causes Rygel to crash on invalid files in ~/.config/Rygel as we can't detect errors there and just carry on, sometimes crashing nicely.
Comment 7 Zeeshan Ali 2012-06-30 19:35:56 UTC
Review of attachment 217745 [details] [review]:

Ah ok, just make sure that that really is the case. :)
Comment 8 Zeeshan Ali 2012-06-30 19:36:53 UTC
Review of attachment 217745 [details] [review]:

Sorry commented on the wrong one but this looks good too. :)
Comment 9 Zeeshan Ali 2012-06-30 19:37:51 UTC
Review of attachment 217743 [details] [review]:

Please read the comment I put mistakenly on the other patch.
Comment 10 Jens Georg 2012-07-01 09:19:04 UTC
I don't understand that comment. what is always the case?
Comment 11 Zeeshan Ali 2012-07-01 19:23:02 UTC
(In reply to comment #10)
> I don't understand that comment. what is always the case?

I didn't say 'always' but 'really'. :) I meant that make sure we are not using this code-path for device proxy (i-e for XML docs from other devices).
Comment 12 Jens Georg 2012-07-02 12:50:21 UTC
Ah, ok. The only place libgupnp uses _new_from_path is in gupnp-root-device.c. If I read the code correctly, that should be only for local devices. The ControlPoint uses xmlRecoverMemory and does not explicitly create a root device.
Comment 13 Jens Georg 2012-07-03 10:14:08 UTC
I'm kind-of tempted to replace those with xmlReadMemory with XML_PARSE_RECOVER set (which is hopefully equivalent to xmlRecoverMemory) to also turn on the warning/error messages on in debug only - thoughts?
Comment 14 Zeeshan Ali 2012-07-05 02:32:27 UTC
(In reply to comment #13)
> I'm kind-of tempted to replace those with xmlReadMemory with XML_PARSE_RECOVER
> set (which is hopefully equivalent to xmlRecoverMemory) to also turn on the
> warning/error messages on in debug only - thoughts?

Yeah, sounds right!
Comment 15 Jens Georg 2012-08-19 14:13:09 UTC
Attachment 217743 [details] pushed as 4a0ec89 - Don't use xmlRecoverFile, use xmlReadFile
Attachment 217745 [details] pushed as 7010c35 - Only show libxml2 console messages in debug mode