Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML line numbers above 65535 are reported as 65535 #3272

Open
marnanel opened this issue Nov 17, 2023 · 1 comment
Open

XML line numbers above 65535 are reported as 65535 #3272

marnanel opened this issue Nov 17, 2023 · 1 comment

Comments

@marnanel
Copy link

marnanel commented Nov 17, 2023

Describe the bug
All XML line numbers beyond 65535 are reported in warnings and errors as being line 65535.

To Reproduce
Steps to reproduce the behavior:

  1. Create an enormous sif file, such as this one: ginormous.zip . This contains a 65535-line comment, before the line which imports wheel.png.
  2. Rename wheel.png to something else, so that rendering ginormous.sif will cause a warning.
  3. Render ginormous.sif (either from the commandline or from Studio).
  4. Note the warning: synfig(261538) [20:11:50] warning: ginormous.sif:<string>:65535: Layer 'import' rejected value for parameter 'filename'
  5. Note also that the import layer is not at line 65535:
$ grep -n wheel.png ginormous.sif
65600:        <layer type="import" active="true" exclude_from_rendering="false" version="0.1" desc="wheel.png">

Expected behavior
The warning should show the correct line, thus:

synfig(261538) [20:11:50] warning: ginormous.sif:<string>:65600: Layer 'import' rejected value for parameter 'filename'

System information:

  • OS: Debian
  • OS version: 12.2
  • Commit ID: 69f4ea7

Additional comments
This is an upstream issue with libxml2. (Presumably in the past someone at libxml2 decided that 64K was enough for anybody.)

The fix: Before each xmlpp::DomParser is used to parse_stream(), call set_parser_options with the flag [XML_PARSE_BIG_LINES](https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlParserOption).

DomParsers are created in six places in Synfig. I can make a PR to fix this, but I don't know my way around your code very well, so I might need to ask a few questions.

@ice0
Copy link
Collaborator

ice0 commented Nov 20, 2023

Hi!

I can make a PR to fix this, but I don't know my way around your code very well, so I might need to ask a few questions.

Sure, that will be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants