Bug #79642 [Opn->Dup]: xml_parse() fails with XML_ERROR_NO_MEMORY with a mere 17M file
| From: | nielsdos@php.net | Date: | Sat, 23 Sep 2023 18:06:44 +0000 |
| Subject: | Bug #79642 [Opn->Dup]: xml_parse() fails with XML_ERROR_NO_MEMORY with a mere 17M file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-245422@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79642&edit=1
ID: 79642
Updated by: nielsdos@php.net
Reported by: php4fan at gmail dot com
Summary: xml_parse() fails with XML_ERROR_NO_MEMORY with a
mere 17M file
-Status: Open
+Status: Duplicate
Type: Bug
Package: *XML functions
Operating System: debian
PHP Version: 7.2.31
Block user comment: Y
Private report: N
New Comment:
Duplicate of #68325, and will be addressed by https://wiki.php.net/rfc/xml_option_parse_huge
Previous Comments:
------------------------------------------------------------------------
[2022-01-22 16:18:41] requinix@php.net
I turned it back off a bit later but the history doesn't show that. Going to leave it on this
time.
------------------------------------------------------------------------
[2022-01-22 15:30:36] php4fan at gmail dot com
What is "block user comments" supposed to accomplish? I see the spammers are spamming
anyway.
------------------------------------------------------------------------
[2020-05-27 16:51:01] cmb@php.net
> why can't parse_xml() do it internally, by the way?
Well, it could, but you'd still have to provide the full XML as
string, what might be wasteful. In my opinion, xml_parse_stream()
would be nice to have, but on the other hand, that can easily be
written in userland as well.
------------------------------------------------------------------------
[2020-05-27 15:08:01] php4fan at gmail dot com
> The problem might be that XML_PARSE_HUGE is not set;
Yep, found out that's the problem.
Been known for like three years at least, right?
> unfortunately, it is currently not possible to pass that option
> via xml_parser_set_option() or otherwise.
Quite a disgrace.
Yep, I worked around it by parsing in chunks. (why can't parse_xml() do it internally, by the
way?)
------------------------------------------------------------------------
[2020-05-27 14:50:36] cmb@php.net
The problem might be that XML_PARSE_HUGE is not set;
unfortunately, it is currently not possible to pass that option
via xml_parser_set_option() or otherwise.
Anyway, it may be better to parse in chunks.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=79642
--
Edit this bug report at https://bugs.php.net/bug.php?id=79642&edit=1