New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 759997 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

DCHECK leveldb_wrapper_impl.cc:427

Project Member Reported by gaschler@chromium.org, Aug 29 2017

Issue description

Chrome Version: DEBUG build of 9c80e348e0bfea10337919ebc33df6597ed90b64 Mon Aug 28 05:52:39 2017 +0000

OS: Android Debug

Flag: #enable-chrome-home

What steps will reproduce the problem?
(1) Open and close a few tabs, quit, open again, but does not reproduce well.

What is the expected result?

What happens instead?
DCHECK fails. https://cs.chromium.org/chromium/src/content/browser/leveldb_wrapper_impl.cc?l=427


08-29 09:41:35.652  7600  7662 F chromium: [FATAL:leveldb_wrapper_impl.cc(427)] Check failed: map_. 
08-29 09:41:35.652  7600  7662 F chromium: #00 0xd245386b /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x000a886b
08-29 09:41:35.652  7600  7662 F chromium: #01 0xc9f0c04f /data/app/com.google.android.apps.chrome-1/lib/arm/libcontent.cr.so+0x0093404f
08-29 09:41:35.652  7600  7662 F chromium: #02 0xd243825d /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x0008d25d
08-29 09:41:35.652  7600  7662 F chromium: #03 0xd2441e9b /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x00096e9b
08-29 09:41:35.652  7600  7662 F chromium: #04 0xd2459f71 /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x000aef71
08-29 09:41:35.652  7600  7662 F chromium: #05 0xd245a1cf /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x000af1cf
08-29 09:41:35.652  7600  7662 F chromium: #06 0xd245a4c3 /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x000af4c3
08-29 09:41:35.652  7600  7662 F chromium: #07 0xd245c231 /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x000b1231
08-29 09:41:35.652  7600  7662 F chromium: #08 0xd2459d7b /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x000aed7b
08-29 09:41:35.652  7600  7662 F chromium: #09 0xd2472c5b /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x000c7c5b
08-29 09:41:35.652  7600  7662 F chromium: #10 0xd249317b /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x000e817b
08-29 09:41:35.652  7600  7662 F chromium: #11 0xc9dea109 /data/app/com.google.android.apps.chrome-1/lib/arm/libcontent.cr.so+0x00812109
08-29 09:41:35.652  7600  7662 F chromium: #12 0xc9dea1f1 /data/app/com.google.android.apps.chrome-1/lib/arm/libcontent.cr.so+0x008121f1
08-29 09:41:35.652  7600  7662 F chromium: #13 0xd249341f /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x000e841f
08-29 09:41:35.652  7600  7662 F chromium: #14 0xd248e5d3 /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x000e35d3
08-29 09:41:35.652  7600  7662 F chromium: #15 0xed7bf0b3 /system/lib/libc.so+0x000470b3
08-29 09:41:35.652  7600  7662 F chromium: #16 0xed791e3d /system/lib/libc.so+0x00019e3d
08-29 09:41:35.652  7600  7662 F chromium: #17 0xffffffff <unknown>
08-29 09:41:35.652  7600  7662 F chromium: 
08-29 09:41:35.652  7600  7662 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 7662 (Thread-4)
08-29 09:41:35.843 24022 24022 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-29 09:41:35.843 24022 24022 F DEBUG   : Build fingerprint: 'google/angler/angler:7.1.2/N2G47P/3863520:userdebug/dev-keys'
08-29 09:41:35.844 24022 24022 F DEBUG   : Revision: '0'
08-29 09:41:35.844 24022 24022 F DEBUG   : ABI: 'arm'
08-29 09:41:35.844 24022 24022 F DEBUG   : pid: 7600, tid: 7662, name: Thread-4  >>> com.google.android.apps.chrome <<<
08-29 09:41:35.844 24022 24022 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
08-29 09:41:35.846 24022 24022 F DEBUG   : Abort message: '[FATAL:leveldb_wrapper_impl.cc(427)] Check failed: map_. 
08-29 09:41:35.846 24022 24022 F DEBUG   : #00 0xd245386b /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x000a886b
08-29 09:41:35.846 24022 24022 F DEBUG   : #01 0xc9f0c04f /data/app/com.google.android.apps.chrome-1/lib/arm/libcontent.cr.so+0x0093404f
08-29 09:41:35.846 24022 24022 F DEBUG   : #02 0xd243825d /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x0008d25d
08-29 09:41:35.846 24022 24022 F DEBUG   : #03 0xd2441e9b /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so+0x00096e9b
08-29 09:41:35.846 24022 24022 F DEBUG   : #04 0xd2459f71 /data/app/com.google.android.apps.chrome-1/lib/arm/libb
08-29 09:41:35.846 24022 24022 F DEBUG   :     r0 00000000  r1 00001dee  r2 00000006  r3 00000008
08-29 09:41:35.847 24022 24022 F DEBUG   :     r4 c5fde978  r5 00000006  r6 c5fde920  r7 0000010c
08-29 09:41:35.847 24022 24022 F DEBUG   :     r8 c5fddfa4  r9 00000039  sl c5fddb14  fp c7806390
08-29 09:41:35.847 24022 24022 F DEBUG   :     ip 0000000b  sp c5fdda90  lr ed7bf5e7  pc ed7c1e44  cpsr 200f0010
08-29 09:41:35.856 24022 24022 F DEBUG   : 
08-29 09:41:35.856 24022 24022 F DEBUG   : backtrace:
08-29 09:41:35.857 24022 24022 F DEBUG   :     #00 pc 00049e44  /system/lib/libc.so (tgkill+12)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #01 pc 000475e3  /system/lib/libc.so (pthread_kill+34)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #02 pc 0001d8a5  /system/lib/libc.so (raise+10)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #03 pc 000193f1  /system/lib/libc.so (__libc_android_abort+34)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #04 pc 00017034  /system/lib/libc.so (abort+4)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #05 pc 0009697d  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so (_ZN4base5debug13BreakDebuggerEv+20)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #06 pc 000a8a9d  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so (_ZN7logging10LogMessageD1Ev+668)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #07 pc 0093404d  /data/app/com.google.android.apps.chrome-1/lib/arm/libcontent.cr.so (_ZN7content18LevelDBWrapperImpl13CommitChangesEv+80)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #08 pc 0008d25d  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so
08-29 09:41:35.857 24022 24022 F DEBUG   :     #09 pc 00096e99  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so (_ZN4base5debug13TaskAnnotator7RunTaskEPKcPNS_11PendingTaskE+136)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #10 pc 000aef6f  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so (_ZN4base11MessageLoop7RunTaskEPNS_11PendingTaskE+174)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #11 pc 000af1cd  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so (_ZN4base11MessageLoop21DeferOrRunPendingTaskENS_11PendingTaskE+40)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #12 pc 000af4c1  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so (_ZN4base11MessageLoop13DoDelayedWorkEPNS_9TimeTicksE+272)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #13 pc 000b1231  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so (_ZN4base19MessagePumpLibevent3RunEPNS_11MessagePump8DelegateE+84)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #14 pc 000aed7b  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so (_ZN4base11MessageLoop3RunEv+58)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #15 pc 000c7c5b  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so (_ZN4base7RunLoop3RunEv+94)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #16 pc 000e8179  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so (_ZN4base6Thread3RunEPNS_7RunLoopE+92)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #17 pc 00812107  /data/app/com.google.android.apps.chrome-1/lib/arm/libcontent.cr.so (_ZN7content17BrowserThreadImpl11IOThreadRunEPN4base7RunLoopE+10)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #18 pc 008121ef  /data/app/com.google.android.apps.chrome-1/lib/arm/libcontent.cr.so (_ZN7content17BrowserThreadImpl3RunEPN4base7RunLoopE+182)
08-29 09:41:35.857 24022 24022 F DEBUG   :     #19 pc 000e841f  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so (_ZN4base6Thread10ThreadMainEv+410)
08-29 09:41:35.858 24022 24022 F DEBUG   :     #20 pc 000e35d3  /data/app/com.google.android.apps.chrome-1/lib/arm/libbase.cr.so
08-29 09:41:35.858 24022 24022 F DEBUG   :     #21 pc 000470b3  /system/lib/libc.so (_ZL15__pthread_startPv+22)
08-29 09:41:35.858 24022 24022 F DEBUG   :     #22 pc 00019e3d  /system/lib/libc.so (__start_thread+6)


 
  DCHECK(database_);
  DCHECK(map_);
  if (!commit_batch_)
    return;

I can't tell if this crash in production code or not? If !commit_batch its safe, but if there's a commit_batch with with changes to values, we'll crash. The dchecks should be moved down a cpl and then we'll see...

  if (!commit_batch_)
    return;

  DCHECK(database_);
  DCHECK(map_);


Comment 2 by mek@chromium.org, Sep 12 2017

Hmm, weird crash. CommitChanges should only get called when there actually are changes to commit, which should only happen if commit_batch_ is actually non-null (I think it should be safe to even change the if (!commit_batch_) to a DCHECK as well). I also don't see how map_ could be null when this code gets called though... As far as I can tell we're always making sure to have a non-null map_ before scheduling a commit, and the only place where we might set map_ to null checks if we have a non-null commit_batch_ (i.e. a pending commit) and doesn't reset map_ in that case. So I'm probably missing something.

Moving the if to before the dchecks might work, but I'd rather replace the if with a dcheck instead, and figure out what codepath actually results in either commit_batch_ (or apparently map_) being null.
I forgot about this! I would guess it might have to do with a timer expiration happpening after ScheduleImmediateCommit?
Project Member

Comment 4 by bugdroid1@chromium.org, Sep 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cc87d3a27aa5e07e8b1b24221eb14c039c1ff3b6

commit cc87d3a27aa5e07e8b1b24221eb14c039c1ff3b6
Author: Michael Nordman <michaeln@google.com>
Date: Fri Sep 22 19:54:09 2017

Adjust a DCHECK in leveldb_wrapper_impl.cc

It's not clear they were valid in all cases where they were.
They've been relocated to a new callsite where they definitely
should hold true in all cases.

Bug:  759997 
Change-Id: I268a70c37d963bf4f732e71b2455306e3dd3925b
Reviewed-on: https://chromium-review.googlesource.com/664346
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Michael Nordman <michaeln@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503828}
[modify] https://crrev.com/cc87d3a27aa5e07e8b1b24221eb14c039c1ff3b6/content/browser/OWNERS
[modify] https://crrev.com/cc87d3a27aa5e07e8b1b24221eb14c039c1ff3b6/content/browser/leveldb_wrapper_impl.cc

Status: Fixed (was: Assigned)
fixed i think

Sign in to add a comment