Description of problem: attempting to run an xpath query on a 3MB XML file Version-Release number of selected component: perl-XML-XPath-1.40-2.fc26 Additional info: reporter: libreport-2.9.1 backtrace_rating: 4 cmdline: /usr/bin/perl /usr/bin/xpath -q -e //attribute[name="mcd_productcode"][text()="437"] crash_function: XML_ParserFree executable: /usr/bin/perl journald_cursor: s=52b9622599c149f3b2bcedca8f7b4442;i=11e0871;b=40ee98e7a11b4e288e018b288f5c9c34;m=aff301cda5;t=554c195af067a;x=6e1ff771cada272b kernel: 4.11.8-300.fc26.x86_64 rootdir: / runlevel: N 5 type: CCpp uid: 1000 Truncated backtrace: Thread no. 1 (10 frames) #6 XML_ParserFree at lib/xmlparse.c:1374 #7 XS_XML__Parser__Expat_ParserFree at Expat.xs:1432 #8 Perl_pp_entersub at pp_hot.c:3988 #9 Perl_runops_standard at run.c:41 #10 Perl_call_sv at perl.c:2807 #11 S_curse at sv.c:6869 #12 Perl_sv_clear at sv.c:6473 #13 Perl_sv_free2 at sv.c:6970 #14 Perl_leave_scope at scope.c:1096 #15 Perl_dounwind at pp_ctl.c:1548
Created attachment 1301842 [details] File: backtrace
Created attachment 1301843 [details] File: cgroup
Created attachment 1301844 [details] File: core_backtrace
Created attachment 1301845 [details] File: cpuinfo
Created attachment 1301846 [details] File: dso_list
Created attachment 1301847 [details] File: environ
Created attachment 1301848 [details] File: limits
Created attachment 1301849 [details] File: maps
Created attachment 1301850 [details] File: open_fds
Created attachment 1301851 [details] File: proc_pid_status
Created attachment 1301852 [details] File: var_log_messages
Could you provide us the XML file? We need a complete reproducer to find the root cause. Looking at the back trace, I think perl raised an exception (Perl_pp_die() call) and then glibc discovered a mistake in memory management when deallocating memory in the XML::Parer::Expat module (XS_XML__Parser__Expat_ParserFree() call).
Created attachment 1302467 [details] A file that causes the error This is as minimal as I can get the test file; if I remove any elements or change any element content the stack trace disappears (although it often still reports that it ran out of memory, depending on what was removed).
Thank you for the test file. I can reproduce it now. It happens only if the file is redirected to the standard input. If I pass it positional argument, it finishes successfully without abortion or complains about insufficiency of memory. Maybe if the file is read from standard input, an IO reference is used and as documented in the On Garbage Collection section of XML::XPath documentation, that can lead to memory leaks.
Minimal reproduced is feeding the test file to stdin of this script: #!/usr/bin/perl use XML::XPath; use open ':std', ':encoding(UTF-8)'; my $xpath = XML::XPath->new(ioref => \*STDIN); $xpath->find('/'); The "use open ':std', ':encoding(UTF-8)';" pragma is important. It looks like there is some issue if PerlIO layer is employed together with IO reference in Expat parser.
This message is a reminder that Fedora 26 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '26'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 26 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
*** Bug 1610977 has been marked as a duplicate of this bug. ***
This message is a reminder that Fedora 27 is nearing its end of life. On 2018-Nov-30 Fedora will stop maintaining and issuing updates for Fedora 27. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '27'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 27 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
perl-XML-Parser-2.44-14.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-e14a4bcc87
perl-XML-Parser-2.44-12.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-0d0dd93395
perl-XML-Parser-2.44-12.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-0d0dd93395
perl-XML-Parser-2.44-14.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.
perl-XML-Parser-2.44-12.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.