Closed Bug 1049269 Opened 6 years ago Closed 6 years ago

Disabling FFmpeg after it's been allocated properly will cause a crash

Categories

(Core :: Audio/Video, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 1055694

People

(Reporter: jya, Unassigned, Mentored)

Details

Was testing Bug #1048173, to verify the fix I then compiled and installed FFmpeg and played
http://pearce.org.nz/video/h264.html

I then went into about:config and disabled FFmpeg and refreshed the tab with:
http://pearce.org.nz/video/h264.html

It caused a crash.

(lldb) bt
* thread #120: tid = 0x4349bd, 0x00007fff994e6b44 AppleVA`VP3IsAvailable + 28, name = 'Media Decode #4', stop reason = EXC_BAD_ACCESS (code=2, address=0x1277c23f7)
    frame #0: 0x00007fff994e6b44 AppleVA`VP3IsAvailable + 28
    frame #1: 0x00007fff8e0eaec2 VideoToolbox`___lldb_unnamed_function724$$VideoToolbox + 34
    frame #2: 0x00007fff8e09bef0 VideoToolbox`___lldb_unnamed_function273$$VideoToolbox + 1095
    frame #3: 0x00007fff8e07c481 VideoToolbox`VTDecompressionSessionCreateWithOptions + 1434
    frame #4: 0x00007fff8e07c7b2 VideoToolbox`VTDecompressionSessionCreate + 20
  * frame #5: 0x00000001043bd4ff XUL`mozilla::AppleVTDecoder::InitializeSession(this=0x000000011956a830) + 1247 at AppleVTDecoder.cpp:413
    frame #6: 0x00000001043bd005 XUL`mozilla::AppleVTDecoder::Init(this=0x000000011956a830) + 21 at AppleVTDecoder.cpp:60
    frame #7: 0x00000001043b73ce XUL`mozilla::MP4Reader::ReadMetadata(this=0x0000000128377400, aInfo=0x00000001277f5748, aTags=0x0000000128375818) + 3294 at MP4Reader.cpp:356
    frame #8: 0x0000000104295d6a XUL`mozilla::MediaDecoderStateMachine::DecodeMetadata(this=0x0000000128375800) + 394 at MediaDecoderStateMachine.cpp:1868
    frame #9: 0x0000000104294f09 XUL`mozilla::MediaDecoderStateMachine::CallDecodeMetadata(this=0x0000000128375800) + 137 at MediaDecoderStateMachine.cpp:1849
    frame #10: 0x00000001042d1dea XUL`nsRunnableMethodImpl<void (this=0x000000011bb7a7f0)(), void, true>::Run() + 154 at nsThreadUtils.h:391
    frame #11: 0x00000001042af6c7 XUL`mozilla::MediaTaskQueue::Runner::Run(this=0x000000011af9a560) + 599 at MediaTaskQueue.cpp:167
    frame #12: 0x00000001016c0fd7 XUL`nsThreadPool::Run(this=0x000000012b191ca0) + 967 at nsThreadPool.cpp:220
    frame #13: 0x00000001016c10cc XUL`non-virtual thunk to nsThreadPool::Run(this=0x000000012b191ca8) + 28 at Unified_cpp_xpcom_threads0.cpp:234
    frame #14: 0x00000001016bda92 XUL`nsThread::ProcessNextEvent(this=0x0000000135cd8040, aMayWait=false, aResult=0x00000001277f5c4e) + 1570 at nsThread.cpp:766
    frame #15: 0x0000000101714217 XUL`NS_ProcessNextEvent(aThread=0x0000000135cd8040, aMayWait=false) + 151 at nsThreadUtils.cpp:265
    frame #16: 0x0000000101d2eb23 XUL`mozilla::ipc::MessagePumpForNonMainThreads::Run(this=0x000000011950a700, aDelegate=0x00000001273daca0) + 675 at MessagePump.cpp:326
    frame #17: 0x0000000101cb05c6 XUL`MessageLoop::RunInternal(this=0x00000001273daca0) + 118 at message_loop.cc:229
    frame #18: 0x0000000101cb04d5 XUL`MessageLoop::RunHandler(this=0x00000001273daca0) + 21 at message_loop.cc:222
    frame #19: 0x0000000101cb047d XUL`MessageLoop::Run(this=0x00000001273daca0) + 45 at message_loop.cc:196
    frame #20: 0x00000001016bc116 XUL`nsThread::ThreadFunc(aArg=0x0000000135cd8040) + 358 at nsThread.cpp:346
    frame #21: 0x000000010115c0ff libnss3.dylib`_pt_root(arg=0x000000012a3f6b40) + 463 at ptthread.c:212
    frame #22: 0x00007fff97845899 libsystem_pthread.dylib`_pthread_body + 138
    frame #23: 0x00007fff9784572a libsystem_pthread.dylib`_pthread_start + 137
(lldb) 

Upon second try, I couldn't reproduce it...

I experienced the crash twice in about 30 attempts, so it may be nothing... but just in case, keep record of it
So this is with both the MOZ_APPLEMEDIA and MOZ_FFMPEG enabled in the same build? I don't think that's a configuration we want to support, but if it uncovered a bug in the applemedia stuff we should fix that.
I had it happening again just now, this time no ffmpeg code in the way. Straight after a restart and restoring the session (which was a link to a mp4 file)

backtrace:
(lldb) bt
* thread #52: tid = 0x15b21c, 0x00007fff96c92b44 AppleVA`VP3IsAvailable + 28, name = 'Media Decode #1', stop reason = EXC_BAD_ACCESS (code=2, address=0x12b28d3f7)
    frame #0: 0x00007fff96c92b44 AppleVA`VP3IsAvailable + 28
    frame #1: 0x00007fff8b896ec2 VideoToolbox`___lldb_unnamed_function724$$VideoToolbox + 34
    frame #2: 0x00007fff8b847ef0 VideoToolbox`___lldb_unnamed_function273$$VideoToolbox + 1095
    frame #3: 0x00007fff8b828481 VideoToolbox`VTDecompressionSessionCreateWithOptions + 1434
    frame #4: 0x00007fff8b8287b2 VideoToolbox`VTDecompressionSessionCreate + 20
  * frame #5: 0x0000000104c2797f XUL`mozilla::AppleVTDecoder::InitializeSession(this=0x000000013164b650) + 1247 at AppleVTDecoder.cpp:430
    frame #6: 0x0000000104c27485 XUL`mozilla::AppleVTDecoder::Init(this=0x000000013164b650) + 21 at AppleVTDecoder.cpp:60
    frame #7: 0x0000000104c2173e XUL`mozilla::MP4Reader::ReadMetadata(this=0x000000012cc06000, aInfo=0x000000012b2c0748, aTags=0x0000000127396418) + 3294 at MP4Reader.cpp:362
    frame #8: 0x0000000104af87ca XUL`mozilla::MediaDecoderStateMachine::DecodeMetadata(this=0x0000000127396400) + 394 at MediaDecoderStateMachine.cpp:1868
    frame #9: 0x0000000104af7969 XUL`mozilla::MediaDecoderStateMachine::CallDecodeMetadata(this=0x0000000127396400) + 137 at MediaDecoderStateMachine.cpp:1849
    frame #10: 0x0000000104b347ca XUL`nsRunnableMethodImpl<void (this=0x000000012d8b2bb0)(), void, true>::Run() + 154 at nsThreadUtils.h:391
    frame #11: 0x0000000104b12127 XUL`mozilla::MediaTaskQueue::Runner::Run(this=0x000000012c8d4300) + 599 at MediaTaskQueue.cpp:167
    frame #12: 0x0000000101ec7187 XUL`nsThreadPool::Run(this=0x000000012ccf6b00) + 967 at nsThreadPool.cpp:220
    frame #13: 0x0000000101ec727c XUL`non-virtual thunk to nsThreadPool::Run(this=0x000000012ccf6b08) + 28 at Unified_cpp_xpcom_threads0.cpp:234
    frame #14: 0x0000000101ec3c3a XUL`nsThread::ProcessNextEvent(this=0x00000001278a4980, aMayWait=false, aResult=0x000000012b2c0c4e) + 1706 at nsThread.cpp:770
    frame #15: 0x0000000101f1ace7 XUL`NS_ProcessNextEvent(aThread=0x00000001278a4980, aMayWait=false) + 151 at nsThreadUtils.cpp:265
    frame #16: 0x0000000102533d43 XUL`mozilla::ipc::MessagePumpForNonMainThreads::Run(this=0x000000012c8d3500, aDelegate=0x0000000127f17bc0) + 675 at MessagePump.cpp:326
    frame #17: 0x00000001024b5596 XUL`MessageLoop::RunInternal(this=0x0000000127f17bc0) + 118 at message_loop.cc:229
    frame #18: 0x00000001024b54a5 XUL`MessageLoop::RunHandler(this=0x0000000127f17bc0) + 21 at message_loop.cc:222
    frame #19: 0x00000001024b544d XUL`MessageLoop::Run(this=0x0000000127f17bc0) + 45 at message_loop.cc:196
    frame #20: 0x0000000101ec2236 XUL`nsThread::ThreadFunc(aArg=0x00000001278a4980) + 358 at nsThread.cpp:347
    frame #21: 0x0000000101b5fdff libnss3.dylib`_pt_root(arg=0x000000012a970080) + 463 at ptthread.c:212
    frame #22: 0x00007fff94ff1899 libsystem_pthread.dylib`_pthread_body + 138
    frame #23: 0x00007fff94ff172a libsystem_pthread.dylib`_pthread_start + 137

Log at the time:
### XPCOM_MEM_LEAK_LOG defined -- logging leaks to stdout
System JS : WARNING resource://gre/modules/Preferences.jsm:378 - mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
++DOCSHELL 0x119cdc800 == 1 [pid = 95785] [id = 1]
++DOMWINDOW == 1 (0x119f0c400) [pid = 95785] [serial = 1] [outer = 0x0]
++DOMWINDOW == 2 (0x119f0d800) [pid = 95785] [serial = 2] [outer = 0x119f0c400]
++DOCSHELL 0x11c134000 == 2 [pid = 95785] [id = 2]
++DOMWINDOW == 3 (0x11c156800) [pid = 95785] [serial = 3] [outer = 0x0]
++DOMWINDOW == 4 (0x11c157800) [pid = 95785] [serial = 4] [outer = 0x11c156800]
++DOCSHELL 0x11cd4c800 == 3 [pid = 95785] [id = 3]
++DOMWINDOW == 5 (0x11cd68c00) [pid = 95785] [serial = 5] [outer = 0x0]
++DOCSHELL 0x11cd4d000 == 4 [pid = 95785] [id = 4]
++DOMWINDOW == 6 (0x11cd69400) [pid = 95785] [serial = 6] [outer = 0x0]
[95785] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80040111: file /Users/jyavenard/Work/Mozilla/mozilla-central/content/base/src/nsFrameLoader.cpp, line 400
++DOCSHELL 0x124d3e800 == 5 [pid = 95785] [id = 5]
++DOMWINDOW == 7 (0x124f64400) [pid = 95785] [serial = 7] [outer = 0x0]
[95785] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80040111: file /Users/jyavenard/Work/Mozilla/mozilla-central/content/base/src/nsFrameLoader.cpp, line 400
++DOMWINDOW == 8 (0x125038000) [pid = 95785] [serial = 8] [outer = 0x124f64400]
System JS : WARNING chrome://global/content/browser-content.js:283 - anonymous function does not always return a value
[95785] WARNING: NS_ENSURE_TRUE(nsContentUtils::GetCurrentJSContext()) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/docshell/base/nsDocShell.cpp, line 8777
[95785] WARNING: NS_ENSURE_TRUE(mTextInputHandler) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/widget/cocoa/nsChildView.mm, line 5524
[95785] WARNING: NS_ENSURE_TRUE(globalObject && globalObject->GetGlobalJSObject()) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/content/html/document/src/nsHTMLContentSink.cpp, line 741
[95785] WARNING: Subdocument container has no frame: file /Users/jyavenard/Work/Mozilla/mozilla-central/layout/base/nsDocumentViewer.cpp, line 2515
++DOMWINDOW == 9 (0x1250ce800) [pid = 95785] [serial = 9] [outer = 0x11cd68c00]
[95785] WARNING: NS_ENSURE_TRUE(globalObject && globalObject->GetGlobalJSObject()) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/content/html/document/src/nsHTMLContentSink.cpp, line 741
[95785] WARNING: Subdocument container has no frame: file /Users/jyavenard/Work/Mozilla/mozilla-central/layout/base/nsDocumentViewer.cpp, line 2515
++DOMWINDOW == 10 (0x1250cf800) [pid = 95785] [serial = 10] [outer = 0x11cd69400]
++DOMWINDOW == 11 (0x1250d1400) [pid = 95785] [serial = 11] [outer = 0x124f64400]
OpenGL version detected: 210
OpenGL vendor: ATI Technologies Inc.
OpenGL renderer: AMD Radeon HD 6970M OpenGL Engine
OpenGL version detected: 210
OpenGL vendor: ATI Technologies Inc.
OpenGL renderer: AMD Radeon HD 6970M OpenGL Engine
[95785] WARNING: NS_ENSURE_TRUE(mTextInputHandler) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/widget/cocoa/nsChildView.mm, line 5524
[95785] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80040111: file /Users/jyavenard/Work/Mozilla/mozilla-central/dom/events/ContentEventHandler.cpp, line 110
System JS : WARNING resource://gre/modules/FxAccounts.jsm:18 - Cu.import(...) is read-only
System JS : WARNING resource://gre/modules/FxAccounts.jsm:18 - Cu.import(...) is read-only
System JS : WARNING resource://gre/modules/FxAccounts.jsm:64 - assignment to undeclared variable AccountState
++DOMWINDOW == 12 (0x1271ea400) [pid = 95785] [serial = 12] [outer = 0x124f64400]
[95785] WARNING: NS_ENSURE_TRUE(mMutable) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/netwerk/base/src/nsSimpleURI.cpp, line 265
[95785] WARNING: attempt to modify an immutable nsStandardURL: file /Users/jyavenard/Work/Mozilla/mozilla-central/netwerk/base/src/nsStandardURL.cpp, line 1227
[95785] WARNING: attempt to modify an immutable nsStandardURL: file /Users/jyavenard/Work/Mozilla/mozilla-central/netwerk/base/src/nsStandardURL.cpp, line 1227
System JS : WARNING resource:///modules/sessionstore/SessionStore.jsm:449 - reference to undefined property state.windows[0].sizemode
System JS : WARNING resource:///modules/sessionstore/SessionStore.jsm:2889 - reference to undefined property tab.pinned
System JS : WARNING resource:///modules/sessionstore/SessionStore.jsm:2626 - reference to undefined property aWinData.width
[95785] WARNING: NS_ENSURE_TRUE(mMutable) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/netwerk/base/src/nsSimpleURI.cpp, line 265
++DOMWINDOW == 13 (0x12a016400) [pid = 95785] [serial = 13] [outer = 0x124f64400]
[95785] WARNING: attempt to modify an immutable nsStandardURL: file /Users/jyavenard/Work/Mozilla/mozilla-central/netwerk/base/src/nsStandardURL.cpp, line 1227
[95785] WARNING: attempt to modify an immutable nsStandardURL: file /Users/jyavenard/Work/Mozilla/mozilla-central/netwerk/base/src/nsStandardURL.cpp, line 1227
JavaScript strict warning: chrome://global/content/bindings/tree.xml, line 53: reference to undefined property this.treeBoxObject.view
System JS : WARNING file:///Users/jyavenard/Work/Mozilla/mozilla-central/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/components/nsSearchService.js:3364 - reference to undefined property json._dataType
System JS : WARNING file:///Users/jyavenard/Work/Mozilla/mozilla-central/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/components/nsSearchService.js:930 - reference to undefined property param.purpose
++DOCSHELL 0x12aa70000 == 6 [pid = 95785] [id = 6]
++DOMWINDOW == 14 (0x12aade000) [pid = 95785] [serial = 14] [outer = 0x0]
++DOMWINDOW == 15 (0x12aae1000) [pid = 95785] [serial = 15] [outer = 0x12aade000]
[95785] WARNING: NS_ENSURE_TRUE(mMutable) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/netwerk/base/src/nsSimpleURI.cpp, line 265
++DOMWINDOW == 16 (0x12a016c00) [pid = 95785] [serial = 16] [outer = 0x12aade000]
[95785] WARNING: NS_ENSURE_TRUE(mMutable) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/netwerk/base/src/nsSimpleURI.cpp, line 265
++DOMWINDOW == 17 (0x12aae1400) [pid = 95785] [serial = 17] [outer = 0x12aade000]
++DOCSHELL 0x12520f800 == 7 [pid = 95785] [id = 7]
++DOMWINDOW == 18 (0x11bd5b000) [pid = 95785] [serial = 18] [outer = 0x0]
[95785] WARNING: NS_ENSURE_TRUE(aSelection->GetRangeCount()) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/editor/libeditor/base/nsEditor.cpp, line 3836
[95785] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /Users/jyavenard/Work/Mozilla/mozilla-central/editor/libeditor/base/nsEditor.cpp, line 3815
[95785] WARNING: NS_ENSURE_SUCCESS(res, res) failed with result 0x80004005: file /Users/jyavenard/Work/Mozilla/mozilla-central/editor/libeditor/text/nsTextEditRules.cpp, line 441
[95785] WARNING: NS_ENSURE_TRUE(globalObject && globalObject->GetGlobalJSObject()) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/content/html/document/src/nsHTMLContentSink.cpp, line 741
++DOMWINDOW == 19 (0x11ccc5400) [pid = 95785] [serial = 19] [outer = 0x11bd5b000]
System JS : WARNING resource://services-sync/status.js:45 - reference to undefined property this._service
[95785] WARNING: NS_ENSURE_TRUE(window) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/dom/base/nsLocation.cpp, line 49
++DOMWINDOW == 20 (0x11cd6d800) [pid = 95785] [serial = 20] [outer = 0x11bd5b000]
System JS : WARNING resource://gre/modules/FxAccountsClient.jsm:16 - Cu.import(...) is read-only
System JS : WARNING resource://gre/modules/FxAccountsClient.jsm:16 - Cu.import(...) is read-only
pldhash: for the aTable at address 0x12a9544a0, the given aEntrySize of 168 definitely favors chaining over double hashing.
++DOCSHELL 0x127343800 == 8 [pid = 95785] [id = 8]
++DOMWINDOW == 21 (0x11cd6c000) [pid = 95785] [serial = 21] [outer = 0x0]
++DOMWINDOW == 22 (0x12a515400) [pid = 95785] [serial = 22] [outer = 0x11cd6c000]
++DOMWINDOW == 23 (0x12a51bc00) [pid = 95785] [serial = 23] [outer = 0x11cd6c000]
[95785] WARNING: NS_ENSURE_TRUE(mMutable) failed: file /Users/jyavenard/Work/Mozilla/mozilla-central/netwerk/base/src/nsSimpleURI.cpp, line 265
[95785] WARNING: Could not get disk status from nsIDiskSpaceWatcher: file /Users/jyavenard/Work/Mozilla/mozilla-central/uriloader/prefetch/nsOfflineCacheUpdateService.cpp, line 326
++DOMWINDOW == 24 (0x12cc07400) [pid = 95785] [serial = 24] [outer = 0x124f64400]
[95785] ###!!! ASSERTION: Must be pinned: 'mPinCount > 0', file /Users/jyavenard/Work/Mozilla/mozilla-central/content/media/MediaCache.cpp, line 2408
[95785] ###!!! ASSERTION: Must be pinned: 'mPinCount > 0', file /Users/jyavenard/Work/Mozilla/mozilla-central/content/media/MediaCache.cpp, line 2408
[95785] ###!!! ASSERTION: Must be pinned: 'mPinCount > 0', file /Users/jyavenard/Work/Mozilla/mozilla-central/content/media/MediaCache.cpp, line 2408
[95785] ###!!! ASSERTION: Must be pinned: 'mPinCount > 0', file /Users/jyavenard/Work/Mozilla/mozilla-central/content/media/MediaCache.cpp, line 2408
[95785] ###!!! ASSERTION: Must be pinned: 'mPinCount > 0', file /Users/jyavenard/Work/Mozilla/mozilla-central/content/media/MediaCache.cpp, line 2408
I/SampleTable(95785): There are reordered frames present.
AVF info: Successfully connected to the Intel plugin, offline Gen6
Sorry, I'd been ignoring this because of ffmpeg in the title. This is the same stack trace as bug 1055694, and jya confirmed oob that disabling jemalloc made it go away. Closing in favour of the newer bug since it has more analysis.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1055694
You need to log in before you can comment on or make changes to this bug.