Page MenuHomePhabricator

Allowed memory size of 183500800 bytes exhausted (tried to allocate 2018670161 bytes).
Closed, ResolvedPublic

Description

PHP fatal error in /usr/local/apache/common-local/php-1.22wmf15/extensions/TimedMediaHandler/handlers/OggHandler/PEAR/File_Ogg/File/Ogg/Media.php line 119: Allowed memory size of 183500800 bytes exhausted (tried to allocate 2018670161 bytes).

when uploading audio files (Ogg vorbis) at Wikimedia Commons. PLEASE ASAP ask the questions you need to debug/track down this issue. I can't provide the answer and must ask the reporter at https://commons.wikimedia.org/wiki/Commons:Upload_help#.22Unknown_error.22_when_uploading_audio_files_via_Upload_Wizard ( permalink: https://commons.wikimedia.org/w/index.php?title=Commons:Upload_help&oldid=103591481#.22Unknown_error.22_when_uploading_audio_files_via_Upload_Wizard )


Version: unspecified
Severity: normal

Details

Reference
bz53840

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:55 AM
bzimport set Reference to bz53840.

jgerber wrote:

can you provide a link to the file you tried to upload.

Rainer: can you provide a link to the file you tried to upload?

I get the same error any time I try to upload an OGG audio file via https://commons.wikimedia.org/wiki/Special:Upload:

PHP fatal error in /srv/mediawiki/php-1.24wmf21/extensions/TimedMediaHandler/handlers/OggHandler/PEAR/File_Ogg/File/Ogg/Media.php line 119:
Allowed memory size of 268435456 bytes exhausted (tried to allocate 1802524276 bytes)

I tried files ranging in size from 13.2 MB to 6.1 MB. All failed with the same error.

The error seems to happen in _decodeBareCommentsHeader(), which parses the comments header in the ogg file. This header contains a series of comments related to the audio encoded in the stream as well as a string to identify the encoding software. The encoding software that I used was MediaHuman Audio Converter, version 1.9.1.

I think what's happening is that the function is choking when trying to parse the encoded COVERART comment, which is far larger than the other comments in the header.

Change 161174 had a related patch set uploaded by Kaldari:
Protect against exceeding memory errors when parsing Ogg files

https://gerrit.wikimedia.org/r/161174

For some reason, if I try to set any kind of size limit on the comments (even 100 MB), it causes several unit tests to fail. Anyone have any idea what's going on with those unit tests?
https://integration.wikimedia.org/ci/job/mwext-TimedMediaHandler-testextension/7/console

In the meantime, I was able to upload the Ogg file by removing the cover art from the file.

Got the unit tests passing with the fix. It's now skipping any comments that are longer than 10 KB, which should be more than enough for any of the information we're interested in.

Change 161174 merged by jenkins-bot:
Protect against exceeding memory errors when parsing Ogg files

https://gerrit.wikimedia.org/r/161174

Gilles raised the priority of this task from High to Unbreak Now!.Dec 4 2014, 10:11 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to High.Dec 4 2014, 11:23 AM