https://bugzilla.wikimedia.org/show_bug.cgi?id=19476

           Summary: OOM on getting metadata for some OGG files
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: OggHandler
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Test case attached.

Steps to reproduce:

1. Open eval.php, and create an OggHandler object.
2. Set your memory limit below 50M
3. 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.


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to