Test case attached.
Steps to reproduce:
- Open eval.php, and create an OggHandler object.
- Set your memory limit below 50M
- Call $OggHandler->getMetadata( null, '/path/to/test/case' );
Result:
PHP dies with OOM.
This is occurring on Wikimedia sites for *some* files with uncached metadata.
I did some research and debugging, and it always seems to die in _decodePageHeader, in File/Ogg.php. It seems to try and list the streams (which, in theory there should only be 5 or 6 of), storing the data as it goes. It then runs through the streams to generate aggregate data.
Using COUNT_RECURSIVE and no memory_limit, I counted the number of pieces of stream information stored in _streamList for the test case, and for the featured media of the day, which happened to be [[File:Eichmann_trial_news_story.ogg]]
$h = new OggHandler; $m = $h->getMetadata( null, '/Users/andrew/En-The_Raven-wikisource.ogg' )
Class File_Ogg not found; skipped loading
Memory used: 50356180
Size of _streamList is 398175
$h = new OggHandler; $m = $h->getMetadata( null, '/Users/andrew/Eichmann_trial_news_story.ogg' );
Class File_Ogg not found; skipped loading
Memory used: 7901476
Size of _streamList is 10662
RECOMMENDED RESOLUTION:
It makes the most sense to resolve this by aggregating whatever data is needed to be aggregated as the stream list is generated, rather than at the end.
Version: unspecified
Severity: major