Closed Bug 1191447 Opened 9 years ago Closed 9 years ago

Assertion failure: debugStats == mIndexStats at netwerk/cache2/CacheIndex.cpp:2367

Categories

(Core :: Networking, defect)

42 Branch
Unspecified
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: milan, Unassigned)

Details

Assertion failure: debugStats == mIndexStats, at /Users/msreckovic/Repos/mozilla-central/netwerk/cache2/CacheIndex.cpp:2367
#01: mozilla::net::CacheIndex::EnsureCorrectStats()[/Users/msreckovic/Repos/mozilla-central/obj-x86_64-apple-darwin13.4.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4b7fd7]
#02: mozilla::net::CacheIndex::ProcessPendingOperations()[/Users/msreckovic/Repos/mozilla-central/obj-x86_64-apple-darwin13.4.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4b7e6a]
#03: mozilla::net::CacheIndex::FinishRead(bool)[/Users/msreckovic/Repos/mozilla-central/obj-x86_64-apple-darwin13.4.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4b5410]
#04: mozilla::net::CacheIndex::ParseJournal()[/Users/msreckovic/Repos/mozilla-central/obj-x86_64-apple-darwin13.4.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4baa7d]
#05: mozilla::net::CacheIndex::OnDataRead(mozilla::net::CacheFileHandle*, char*, nsresult)[/Users/msreckovic/Repos/mozilla-central/obj-x86_64-apple-darwin13.4.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4bed69]
#06: mozilla::net::ReadEvent::Run()[/Users/msreckovic/Repos/mozilla-central/obj-x86_64-apple-darwin13.4.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4debe5]
#07: mozilla::net::CacheIOThread::LoopOneLevel(unsigned int)[/Users/msreckovic/Repos/mozilla-central/obj-x86_64-apple-darwin13.4.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4b269c]
#08: mozilla::net::CacheIOThread::ThreadFunc()[/Users/msreckovic/Repos/mozilla-central/obj-x86_64-apple-darwin13.4.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4b2435]
#09: mozilla::net::CacheIOThread::ThreadFunc(void*)[/Users/msreckovic/Repos/mozilla-central/obj-x86_64-apple-darwin13.4.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4b1fe9]
#10: _pt_root[/Users/msreckovic/Repos/mozilla-central/obj-x86_64-apple-darwin13.4.0/dist/NightlyDebug.app/Contents/MacOS/libnss3.dylib +0x37f56f]
#11: _pthread_body[/usr/lib/system/libsystem_pthread.dylib +0x1899]
#12: _pthread_struct_init[/usr/lib/system/libsystem_pthread.dylib +0x172a]

Don't know if this is important or useful, but I hit it as a startup crash in the local debug build.  Restart was clean.
Me too.
Version: 33 Branch → 42 Branch
Nick, could this be related to bug 1182961?
Flags: needinfo?(n.nethercote)
(In reply to Blake Kaplan (:mrbkap) (please use needinfo!) from comment #2)
> Nick, could this be related to bug 1182961?

Yes. I was hitting this failure 100% reliably in early versions of the patches in that bug (see bug 1182961 comment 6). I thought I'd fixed it but looks like it still can happen. Odd that it only seems to be happening once per user, though.

Bug 1182961 also triggered bug 1191907, which is really bad, so I've backed out the patches.
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(n.nethercote)
Resolution: --- → FIXED
For what it's worth, I was hitting this every other startup.
It seems like I see this once per profile that I've run on an old build, but then it works the second time.

(gdb) thr 21
[Switching to thread 21 (Thread 0x7f6a5424f700 (LWP 9535))]
#6  0x00007f6a686d8e8b in mozilla::net::CacheIndex::EnsureCorrectStats (
    this=this@entry=0x2ad0180)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/netwerk/cache2/CacheIndex.cpp:2367
2367	  MOZ_ASSERT(debugStats == mIndexStats);
(gdb) bt
#0  0x00007f6a77032c4d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f6a77032ae4 in __sleep (seconds=0)
    at ../sysdeps/unix/sysv/linux/sleep.c:138
#2  0x00007f6a6a89d0f2 in ah_crap_handler(int) (signum=11)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/toolkit/xre/nsSigHandlers.cpp:105
#3  0x00007f6a6a890858 in nsProfileLock::FatalSignalHandler(int, siginfo_t*, void*) (signo=11, info=0x7f6a5424e6f0, context=0x7f6a5424e5c0)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/toolkit/profile/nsProfileLock.cpp:195
#4  0x00007f6a6ae90909 in AsmJSFaultHandler(int, siginfo_t*, void*) (signum=<optimized out>, info=0x7f6a5424e6f0, context=0x7f6a5424e5c0)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/js/src/asmjs/AsmJSSignalHandlers.cpp:1135
#5  0x00007f6a77d73d10 in <signal handler called> ()
    at /lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007f6a686d8e8b in mozilla::net::CacheIndex::EnsureCorrectStats() (this=this@entry=0x2ad0180)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/netwerk/cache2/CacheIndex.cpp:2367
#7  0x00007f6a686e6eb6 in mozilla::net::CacheIndex::ProcessPendingOperations() (this=this@entry=0x2ad0180)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/netwerk/cache2/CacheIndex.cpp:1540
#8  0x00007f6a686e9da4 in mozilla::net::CacheIndex::FinishRead(bool) (this=this@entry=0x2ad0180, aSucceeded=<optimized out>)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/netwerk/cache2/CacheIndex.cpp:2442
#9  0x00007f6a686ea9ea in mozilla::net::CacheIndex::ParseJournal() (this=0x2ad0180)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/netwerk/cache2/CacheIndex.cpp:2285
#10 0x00007f6a686eafd4 in mozilla::net::CacheIndex::OnDataRead(mozilla::net::CacheFileHandle*, char*, nsresult) (this=0x2ad0180, aHandle=0x7f6a1c001690, aBuf=<optimized out>, aResult=nsresult::NS_OK)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/netwerk/cache2/CacheIndex.cpp:3448
#11 0x00007f6a687047df in mozilla::net::ReadEvent::Run() (this=0x7f6a1c001170)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/netwerk/cache2/CacheFileIOManager.cpp:619
#12 0x00007f6a686f7b68 in mozilla::net::CacheIOThread::LoopOneLevel(unsigned int) (this=this@entry=0x2acf9d0, aLevel=3)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/netwerk/cache2/CacheIOThread.cpp:287
#13 0x00007f6a686f7dcf in mozilla::net::CacheIOThread::ThreadFunc() (this=this@entry=0x2acf9d0)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/netwerk/cache2/CacheIOThread.cpp:217
#14 0x00007f6a686f7ef6 in mozilla::net::CacheIOThread::ThreadFunc(void*) (aClosure=0x2acf9d0)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/netwerk/cache2/CacheIOThread.cpp:167
#15 0x00007f6a76d4f2f9 in _pt_root (arg=0x2acfbe0)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/nsprpub/pr/src/pthreads/ptthread.c:212
#16 0x00007f6a77d6a6aa in start_thread (arg=0x7f6a5424f700)
    at pthread_create.c:333
#17 0x00007f6a7706eeed in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb) f 6
#6  0x00007f6a686d8e8b in mozilla::net::CacheIndex::EnsureCorrectStats (
    this=this@entry=0x2ad0180)
    at /home/dbaron/builds/ssd/mozilla-central/mozilla/netwerk/cache2/CacheIndex.cpp:2367
2367	  MOZ_ASSERT(debugStats == mIndexStats);
(gdb) p debugStats
$1 = {
  mCount = 4635, 
  mNotInitialized = 0, 
  mRemoved = 0, 
  mDirty = 125, 
  mFresh = 0, 
  mEmpty = 0, 
  mSize = 138727, 
  mStateLogged = false, 
  mDisableLogging = true
}
(gdb) p mIndexStats
$2 = {
  mCount = 4510, 
  mNotInitialized = 0, 
  mRemoved = 0, 
  mDirty = 0, 
  mFresh = 0, 
  mEmpty = 0, 
  mSize = 132638, 
  mStateLogged = false, 
  mDisableLogging = false
}
Thank you for the tip, dbaron. I can now reproduce this somewhat reliably by using a single profile and alternating between a debug build with this patch and one without it.
You need to log in before you can comment on or make changes to this bug.