Closed Bug 1409546 Opened 7 years ago Closed 7 years ago

./mach gtest MP4Demuxer.Seek leaks 1 string

Categories

(Core :: Audio/Video: Playback, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: cpearce, Assigned: cpearce)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

On Linux and MacOS we see:

$ ./mach gtest MP4Demuxer.Seek
 0:00.12 /usr/bin/make -C testing/gtest -j60 -s gtest
 0:00.20 force-cargo-library-build
 0:00.39 force-cargo-library-build
 0:01.76     Blocking waiting for file lock on build directory
 0:02.05     Finished dev [optimized + debuginfo] target(s) in 0.0 secs
 0:02.45     Finished dev [optimized + debuginfo] target(s) in 0.0 secs
 0:02.60 /home/cpearce/src/firefox/obj-x86_64-pc-linux-gnu/dist/bin/firefox -unittest
[10354, Unnamed thread 7f0b345b25c0] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /home/cpearce/src/firefox/xpcom/base/nsTraceRefcnt.cpp, line 171
[10354, Unnamed thread 7f0b345b25c0] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /home/cpearce/src/firefox/xpcom/base/nsTraceRefcnt.cpp, line 171
[10354, Unnamed thread 7f0b345b25c0] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /home/cpearce/src/firefox/xpcom/base/nsTraceRefcnt.cpp, line 171
Running GTest tests...
Note: Google Test filter = MP4Demuxer.Seek
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from MP4Demuxer
[ RUN      ] MP4Demuxer.Seek
[       OK ] MP4Demuxer.Seek (7 ms)
[----------] 1 test from MP4Demuxer (7 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (7 ms total)
[  PASSED  ] 1 test.
Couldn't convert chrome URL: chrome://branding/locale/brand.properties
[10354, Main Thread] WARNING: Could not get the program name for a cubeb stream.: 'NS_SUCCEEDED(rv)', file /home/cpearce/src/firefox/dom/media/CubebUtils.cpp, line 368
Finished running GTest tests.
[10354, Main Thread] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /home/cpearce/src/firefox/xpcom/base/nsTraceRefcnt.cpp, line 171
[10354, Main Thread] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /home/cpearce/src/firefox/xpcom/base/nsTraceRefcnt.cpp, line 171
[10354, Main Thread] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /home/cpearce/src/firefox/xpcom/base/nsTraceRefcnt.cpp, line 171
[10354, Main Thread] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /home/cpearce/src/firefox/xpcom/base/nsTraceRefcnt.cpp, line 171
nsStringStats
 => mAllocCount:           6289
 => mReallocCount:           42
 => mFreeCount:            6288  --  LEAKED 1 !!!
 => mShareCount:           2436
 => mAdoptCount:             58
 => mAdoptFreeCount:         58
 => Process ID: 10354, Thread ID: 139686120920896



This is leaking 1 string. We bisected this, and the work around is this patch:

diff --git a/media/libstagefright/binding/DecoderData.cpp b/media/libstagefright/binding/DecoderData.cpp
--- a/media/libstagefright/binding/DecoderData.cpp
+++ b/media/libstagefright/binding/DecoderData.cpp
@@ -247,7 +247,7 @@ MP4VideoInfo::Update(const mp4parse_trac
 {
   UpdateTrackProtectedInfo(*this, video->protected_data);
   if (track->codec == mp4parse_codec_AVC) {
-    mMimeType = MEDIA_MIMETYPE_VIDEO_AVC;
+    mMimeType = NS_LITERAL_CSTRING("video/avc");
   } else if (track->codec == mp4parse_codec_VP9) {
     mMimeType = NS_LITERAL_CSTRING("video/vp9");
   } else if (track->codec == mp4parse_codec_MP4V) {


We don't understand why this is, it might be something in the string code.
Comment on attachment 8919605 [details]
Bug 1409546 - Use literal strings instead of assigning const char* to TrackInfo::mMimeType in mp4 demuxer.

https://reviewboard.mozilla.org/r/190484/#review195732

Yep, doesn't make sense to me either! But the workaround is fine. Please open a follow-up bug.
Attachment #8919605 - Flags: review?(gsquelart) → review+
Assignee: nobody → cpearce
Pushed by cpearce@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/be5d40c455a4
Use literal strings instead of assigning const char* to TrackInfo::mMimeType in mp4 demuxer. r=gerald
https://hg.mozilla.org/mozilla-central/rev/be5d40c455a4
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Blocks: 1410289
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: