Closed Bug 957230 Opened 10 years ago Closed 10 years ago

HTTP cache v2: Potential deadlock with CacheFile.mLock

Categories

(Core :: Networking: Cache, defect)

Other Branch
x86_64
Linux
defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 949250

People

(Reporter: mayhemer, Unassigned)

References

Details

Need to run --enable-trace-malloc build to reproduce and get stacks...

while ./mach xpcshell-test netwerk/test/unit/test_doomentry.js; do true; done

with https://bugzilla.mozilla.org/attachment.cgi?id=8356671&action=edit applied

 0:02.65 TEST-INFO | profile dir is /tmp/firefox/xpcshellprofile
 0:02.65 TEST-INFO | /home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/test_doomentry.js | full command: ['/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/xpcshell', '-g', '/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin', '-a', '/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin', '-r', '/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/components/httpd.manifest', '-m', '-n', '-s', '-e', 'const _HTTPD_JS_PATH = "/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/components/httpd.js";', '-e', 'const _HEAD_JS_PATH = "/home/mayhemer/Mozilla/src/gum/testing/xpcshell/head.js";', '-e', 'const _TESTING_MODULES_DIR = "/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/modules/";', '-f', '/home/mayhemer/Mozilla/src/gum/testing/xpcshell/head.js', '-p', '/tmp/tmp6J6SeG', '-e', 'const _SERVER_ADDR = "localhost"', '-e', u'const _HEAD_FILES = ["/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/head_channels.js", "/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/head_cache.js", "/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/head_cache2.js"];', '-e', 'const _TAIL_FILES = [];', '-e', u'const _TEST_FILE = ["/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/test_doomentry.js"];', '-e', '_execute_test(); quit(0);']
 0:02.65 TEST-INFO | /home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/test_doomentry.js | current directory: u'/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit'
 0:02.65 TEST-INFO | /home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/test_doomentry.js | environment: ['XPCOM_DEBUG_BREAK=stack-and-abort', 'MOZ_CRASHREPORTER=1', 'NS_TRACE_MALLOC_DISABLE_STACKS=1', 'XPCSHELL_TEST_TEMP_DIR=/tmp/tmpuCuIZb', 'LD_LIBRARY_PATH=/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin', 'XPCSHELL_TEST_PROFILE_DIR=/tmp/firefox/xpcshellprofile', 'MOZ_CRASHREPORTER_NO_REPORT=1']
 0:02.99 
 0:02.99 TEST-INFO | (xpcshell/head.js) | test MAIN run_test pending (1)
 0:03.00 
 0:03.00 TEST-INFO | (xpcshell/head.js) | test pending (2)
 0:03.00 
 0:03.00 TEST-INFO | (xpcshell/head.js) | test MAIN run_test finished (2)
 0:03.00 
 0:03.00 TEST-INFO | (xpcshell/head.js) | running event loop
 0:03.01 
 0:03.01 TEST-PASS | /home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/test_doomentry.js | [check_doom1 : 48] 0 == 0
 0:03.01 
 0:03.01 TEST-PASS | /home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/test_doomentry.js | [check_doom2 : 54] 2147746065 == 2147746065
 0:03.03 
 0:03.03 TEST-PASS | /home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/test_doomentry.js | [check_doom3 : 74] 0 == 0
 0:03.06 
 0:03.06 TEST-PASS | /home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/test_doomentry.js | [check_doom4 : 86] 2147746065 == 2147746065
 0:03.06 
 0:03.06 TEST-INFO | (xpcshell/head.js) | test finished (1)
 0:03.07 
 0:03.07 TEST-INFO | (xpcshell/head.js) | exiting test
 0:03.07 
 0:03.07 TEST-PASS | (xpcshell/head.js) | 4 (+ 0) check(s) passed
 0:03.07 
 0:03.07 TEST-INFO | (xpcshell/head.js) | 0 check(s) todo
 0:03.09 ###!!! ERROR: Potential deadlock detected:
 0:03.09 === Cyclical dependency starts at
 0:03.09 --- Mutex : CacheFile.mLock (currently acquired)
 0:03.10  calling context
 0:03.10   [stack trace unavailable]
 0:03.10 
 0:03.10 === Cycle completed at
 0:03.10 --- Mutex : CacheFile.mLock (currently acquired)
 0:03.10  calling context
 0:03.10   [stack trace unavailable]
 0:03.10 
 0:03.10 ###!!! Deadlock may happen NOW!
 0:03.10 
 0:03.10 [30199] ###!!! ASSERTION: Potential deadlock detected:
 0:03.10 Cyclical dependency starts at
 0:03.10 Mutex : CacheFile.mLock (currently acquired)
 0:03.10 Cycle completed at
 0:03.10 Mutex : CacheFile.mLock (currently acquired)
 0:03.10 
 0:03.10 ###!!! Deadlock may happen NOW!
 0:03.10 
 0:03.10 : 'Error', file /home/mayhemer/Mozilla/src/gum/xpcom/glue/BlockingResourceBase.cpp, line 125
 0:03.10 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00a3e703]
 0:03.10 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00a3eba6]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cc585e]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cc245e]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cc0097]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cdd0fa]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cdd140]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00a50282]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cddf55]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cd43c5]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cc796f]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cc249d]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cc0097]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cba027]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cba0a2]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cb9bb4]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cc0161]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cb969f]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cb96da]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00cb94e6]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00a77df5]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00a781f3]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00a78597]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00a7867c]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x00a774aa]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x04663fc7]
 0:03.11 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x046640bc]
 0:03.12 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x045f17e5]
 0:03.12 XRE_XPCShellMain+0x000011b0 [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/libxul.so +0x020250eb]
 0:03.12 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/xpcshell +0x0000350b]
 0:03.12 __libc_start_main+0x000000f5 [/lib64/libc.so.6 +0x00021735]
 0:03.12 UNKNOWN [/home/mayhemer/Mozilla/src/gum/_obj-browser-debug/dist/bin/xpcshell +0x000033e9]
 0:03.12 [30199] ###!!! ASSERTION: Potential deadlock detected:
 0:03.12 Cyclical dependency starts at
 0:03.12 Mutex : CacheFile.mLock (currently acquired)
 0:03.12 Cycle completed at
 0:03.12 Mutex : CacheFile.mLock (currently acquired)
 0:03.12 
 0:03.12 ###!!! Deadlock may happen NOW!
 0:03.12 
 0:03.12 : 'Error', file /home/mayhemer/Mozilla/src/gum/xpcom/glue/BlockingResourceBase.cpp, line 125
 0:03.12 Hit MOZ_CRASH() at /home/mayhemer/Mozilla/src/gum/memory/mozalloc/mozalloc_abort.cpp:30
 0:03.45 TEST-UNEXPECTED-FAIL | /home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/test_doomentry.js | test failed (with xpcshell return code: -11)
 0:03.45 >>>>>>>
 0:03.45 <<<<<<<
PROCESS-CRASH | /home/mayhemer/Mozilla/src/gum/_obj-browser-debug/_tests/xpcshell/netwerk/test/unit/test_doomentry.js | application crashed [Unknown top frame]
Crash dump filename: /tmp/tmpuCuIZb/2cac290f-bd98-cf34-348ec4cd-509240df.dmp
MINIDUMP_STACKWALK not set, can't process dump.
 0:03.45 INFO | Result summary:
 0:03.45 INFO | Passed: 0
 0:03.45 INFO | Failed: 1
 0:03.45 INFO | Todo: 0
 0:03.45 INFO | Retried: 0
This could also well be just a problem with one of my patches for the crashes.  I will rerun the test on a greener gum cs and potentially dup/inv.
Hell.. this is probably the same as https://tbpl.mozilla.org/php/getParsedLog.php?id=32597098&tree=Gum#error2
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.