Backup cronjob dying due to 'integer overflow'

Backup cronjob dying due to 'integer overflow'

by Michael Street -
Number of replies: 3
Hi Folks,

Our nightly backup cronjob is breaking on about 20 courses. Well, actually, the script chokes on a different course each night. It's usually a course with a large number of students (400-1000+), and the error message comes from different modules during the backup. For example, one night it's:

Another night it's a problem in the 'book' module. However, when I look the line it's complaining about, it's always the same line in each module:

$base = preg_quote($CFG->wwwroot,"/");

Any thoughts?
--Mike
 
                        
Average of ratings: -
In reply to Michael Street

Re: Backup cronjob dying due to 'integer overflow'

by Martín Langhoff -
We need a ton more details to get close to a diagnosis... exact version of moodle, version of the file if possible (from the top of the file), PHP version, DB version...
In reply to Martín Langhoff

Re: Backup cronjob dying due to 'integer overflow'

by Michael Street -
Sorry about that. I've added the issue to tracker, with much more details, here:

http://tracker.moodle.org/browse/MDL-12009


In reply to Michael Street

Re: Backup cronjob dying due to 'integer overflow'

by Michael Street -
Can anyone please offer any help with this? This is affecting our forum mailouts and nightly backups.

Here's an example of the error (reposted from http://tracker.moodle.org/browse/MDL-12009):

"Fatal error: Possible integer overflow in memory allocation (8 * 8 +0) in /var/www/moodle/lib/datalib.php on line 779"

I've added a memory_get_usage() before all the common points in the file where is breaks. It usually spits out a value in and around 48 MB. Never higher than that though, even though we have allocated 512 MB to both cli and web php scripts. (Correction: I've seen it get to 140 MB before dying now.)

Our cronjob is set to run every 15 mins, in order to lighten the load of what it has to process.

For backups, it'll check and every 30 mins it will start to attempt to backup the courses again. It will eventually hit one (never the same course), and then spit out pages and pages of blank lines, followed by pages of periods (one per line), then a <br/> tag, more periods, and then the "Fatal error". Course size does not seem to matter, nor content. Our settings are set to backup up everything.

For forum posts, it will die at about the same memory usage (48 MB). I have seen it successful process posts of up to 3800 students before dying.

Also, many of the lines where it crashes are 'preg_replace' or similar. Usually something to do with an array of objects.

Here's some more details of our setup:

Moodle 1.6.3 (2006050530)

Mysql server version: 5.0.22-Debian_0ubuntu6.06.2

OS: Debian_0ubuntu6.06.2

PHP version: 5.1.2

First line of mod/forum/lib.php

<?php // $Id: lib.php,v 1.437.2.10 2006/10/10 05:15:10 vyshane Exp $

------

First line of backup/backuplib.php:

<?php //$Id: backuplib.php,v 1.107.2.5 2006/08/21 20:38:44 skodak Exp $

--------
First line of lib/datalib.php:

<?php // $Id: datalib.php,v 1.298.2.11 2006/10/08 19:44:34 skodak Exp $

--------