?
Referenced as Pull Request for: # 6980
avatar dirk-graetz
dirk-graetz
1 Feb 2015

Steps to reproduce the issue

Ad a new "Module Feed Display" and set as Feed URL: http://www.google.com/robots.txt

Expected result

Message "Feed not available" in module position

Actual result

Site crash

Warning: XMLReader::read(): An Error Occurred while reading in \libraries\joomla\feed\factory.php on line 71

System information (as much as possible)

Joomla 3.3.6 / Apache 2.4.4 / PHP 5.5.3 / MySQL 5.6.11

Additional comments

We include a newsfeed which is sometimes down. In this case the feed-server returns a page with text/plain content - and our site crashes.
It makes no difference to include feed via module or via News Feed Manager.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar dirk-graetz dirk-graetz - open - 1 Feb 2015
avatar infograf768
infograf768 - comment - 2 Feb 2015

Confirmed.

avatar brianteeman
brianteeman - comment - 3 Feb 2015

With the same faulty link as above in the newsfeed component view on the frontend i got a different error

Fatal error: Maximum execution time of 30 seconds exceeded in /Applications/MAMP/htdocs/Joomla_3.4.0-beta1-Beta-Full_Package/libraries/joomla/feed/factory.php on line 72

In the module view I get

Fatal error: Maximum execution time of 30 seconds exceeded in /Applications/MAMP/htdocs/Joomla_3.4.0-beta1-Beta-Full_Package/libraries/joomla/feed/factory.php on line 69


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5939.
avatar brianteeman brianteeman - change - 3 Feb 2015
Status New Confirmed
avatar brianteeman brianteeman - change - 4 Feb 2015
The description was changed
Labels Added: ?
avatar Achal-Aggarwal Achal-Aggarwal - reference | 9455367 - 17 Apr 15
avatar DannyBoyk
DannyBoyk - comment - 18 May 2015

The loop where this read error occurs appears to be the issue. When a non-XML document is read, the while loop never terminates, and it appears the XMLReader class continues to allocate memory until something like this eventually occurs:

PHP Fatal error: Allowed memory size of 205520896 bytes exhausted (tried to allocate 179834881 bytes) in /home/usr/public_html/libraries/joomla/feed/factory.php

I do not believe the XMLReader class is being used properly.

The fix is to change the loop from:

do
{
    $reader->read();
}
while ($reader->nodeType !== XMLReader::ELEMENT);

to something like this:

while ($reader->read())
{
    if ($reader->nodeType == XMLReader::ELEMENT)
    {
        break;
    }
}
```<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="http://issues.joomla.org/tracker/joomla-cms/5939">issues.joomla.org/joomla-cms/5939</a>.</sub>
avatar zero-24
zero-24 - comment - 18 May 2015

Closing as we have a PR by @DannyBoyk here: #6980 Thanks ?

avatar zero-24 zero-24 - change - 18 May 2015
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2015-05-18 15:12:43
Closed_By zero-24
Build 3.3.6 staging
avatar zero-24 zero-24 - close - 18 May 2015
avatar zero-24 zero-24 - close - 18 May 2015
avatar sbaheti56
sbaheti56 - comment - 22 Jun 2016

Thanks DannyBoyk
it worked like wonders ? Thank you so much !!!

keep doing good work ?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5939.

Add a Comment

Login with GitHub to post a comment