View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
11357Feature requestsOtherpublic2016-06-13 00:10
Reporterhermann Assigned To 
PrioritynoneSeverity@50@ 
Status newResolutionopen 
Summary11357: Memory exhaustion when selecting large page-sizes in long lists
Description

I have a survey that has a lot of participants (3429). When I display the list of those participants ("Survey participants" -> "Display participants") and scroll to the end of the list I can set "rows per page".
That select box lets me select up to 10,000 rows per page.
When I choose more than 1,000 rows per page I get after some waiting a javascript pop-up containing only
"Error 500"
and see a "500 Internal Server Error" response in Firebug.

On the server I found (after some tinkering and increasing error_reporting) this in the Apache error-log:

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4218881 bytes) in .../limesurvey250plus/framework/zii/widgets/grid/CGridColumn.php on line 155, referer: https://.../xxx/index.php/admin/tokens/sa/browse/surveyid/yyyyyyy

The line of the error changes but is always somewhere in a grid-file.

Steps To Reproduce
  1. Create a survey and activate it in closed mode.
  2. Import a long list of participants.
  3. Display this list and change the "rows per page" setting to a big value.
TagsNo tags attached.
Bug heat4
Story point estimate
Users affected %

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2016-06-08 15:16

developer   ~39328

We can noyt fix it : you ask a very big array with light memory.

hermann

hermann

2016-06-09 12:32

reporter   ~39342

Last edited: 2016-06-09 12:32

I am aware, that you can't fix the underlying problem.
But there should be a way to fail more gracefully, shouldn't it?

For me as a server administrator some kind of message in the web-server logs are helpful. I suggest something in the line of what I did:
<pre>
--- framework/base/CApplication.php.orig 2016-06-08 16:44:14.364563000 +0200
+++ framework/base/CApplication.php 2016-06-08 16:55:19.674554000 +0200
@@ -197,6 +197,12 @@
*/
public function end($status=0,$exit=true)
{

  • if ($exit === false) {
  • $error = error_get_last();
  • if(($error['type'] === E_ERROR) || ($error['type'] === E_USER_ERROR)) {
  • error_log("A fatal error has occured: ". $error['message'] ." in file ". $error['file'] ." at line ". $error['line']);
  • }
  • }
    if($this->hasEventHandler('onEndRequest'))
    $this->onEndRequest(new CEvent($this));
    if($exit)
    </pre>

You are registering CApplication::end as a shutdown function in CApplication::run. So it gets called even on a fatal error and you can "handle" those errors...

DenisChenu

DenisChenu

2016-06-09 12:41

developer   ~39344

OK,

Thne more a "beter log error" system.

Did you try with Yii error log system ? I think we must improve it.

But it's more a Feature request, not a bug. See the onEndRequest for the fix :)

Issue History

Date Modified Username Field Change
2016-06-08 14:27 hermann New Issue
2016-06-08 14:35 hermann Issue Monitored: hermann
2016-06-08 15:16 DenisChenu Note Added: 39328
2016-06-09 12:32 hermann Note Added: 39342
2016-06-09 12:32 hermann Note Edited: 39342
2016-06-09 12:41 DenisChenu Note Added: 39344
2016-06-09 12:58 c_schmitz Project Bug reports => Feature requests
2016-06-13 00:10 c_schmitz Issue End Monitor: hermann