New issue
Advanced search Search tips

Issue 667066 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

DCHECK in InspectorPageAgent's maybeEncodeTextContent

Project Member Reported by pdr@chromium.org, Nov 19 2016

Issue description

Version: tip-of-tree / c6e5c1845b9019ff276c16dd8af7bb654279e07d / Nov 19th
OS: MasOS

What steps will reproduce the problem?
(1) Visit https://github.com/progers/base64/blob/master/readme.md
(2) Open the inspector (no need for device emulation)
(3) Refresh the page
(4) If no sadtab yet, refresh again.

It looks like textContent is null... maybe just missing a null check?
frame #2: 0x0000000130313bbc libblink_core.dylib`blink::maybeEncodeTextContent(textContent=0x00007fff5eda0c50, buffer=PassRefPtr<const blink::SharedBuffer> @ 0x00007fff5eda0c48, result=0x00007fff5eda0e58, base64Encoded=0x00007fff5eda0e57) + 428 at InspectorPageAgent.cpp:174
   171 	    *result = base64Encode(buffer->data(), buffer->size());
   172 	    *base64Encoded = true;
   173 	  } else {
-> 174 	    DCHECK(!textContent.is8Bit());
   175 	    *result = base64Encode(textContent.utf8(WTF::LenientUTF8Conversion));
   176 	    *base64Encoded = true;
   177 	  }
(lldb) p textContent.isNull()
(bool) $1 = true

Full backtrace:
* thread #1: tid = 0xee0b, WTF::StringImpl::is8Bit(this=0x0000000000000000) const + 12 at StringImpl.h:230, name = 'CrRendererMain', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
    frame #0: 0x000000012f08cf9c libblink_core.dylib`WTF::StringImpl::is8Bit(this=0x0000000000000000) const + 12 at StringImpl.h:230
   227 	                                                    UChar*& data);
   228 	
   229 	  unsigned length() const { return m_length; }
-> 230 	  bool is8Bit() const { return m_is8Bit; }
   231 	
   232 	  ALWAYS_INLINE const LChar* characters8() const {
   233 	    ASSERT(is8Bit());
(lldb) bt 20
* thread #1: tid = 0xee0b, WTF::StringImpl::is8Bit(this=0x0000000000000000) const + 12 at StringImpl.h:230, name = 'CrRendererMain', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
  * frame #0: WTF::StringImpl::is8Bit(this=0x0000000000000000) const + 12 at StringImpl.h:230
    frame #1: WTF::String::is8Bit(this=0x00007fff5eda0c50) const + 29 at WTFString.h:141
    frame #2: blink::maybeEncodeTextContent(textContent=0x00007fff5eda0c50, buffer=PassRefPtr<const blink::SharedBuffer> @ 0x00007fff5eda0c48, result=0x00007fff5eda0e58, base64Encoded=0x00007fff5eda0e57) + 428 at InspectorPageAgent.cpp:174
    frame #3: blink::InspectorPageAgent::cachedResourceContent(cachedResource=0x0000157e52822ea0, result=0x00007fff5eda0e58, base64Encoded=0x00007fff5eda0e57) + 913 at InspectorPageAgent.cpp:233
    frame #4: blink::NetworkResourcesData::ResourceData::clearWeakMembers(this=0x0000157e52823568, visitor=0x000020096b0b1590) + 337 at NetworkResourcesData.cpp:142
    frame #5: blink::TraceMethodDelegate<blink::NetworkResourcesData::ResourceData, &(blink::NetworkResourcesData::ResourceData::clearWeakMembers(blink::Visitor*))>::trampoline(visitor=0x000020096b0b1590, self=0x0000157e52823568) + 103 at Visitor.h:66
    frame #6: blink::CallbackStack::Item::call(this=0x0000006412567220, visitor=0x000020096b0b1590) + 44 at CallbackStack.h:35
    frame #7: blink::ThreadState::popAndInvokeThreadLocalWeakCallback(this=0x000000012c8b2970, visitor=0x000020096b0b1590) + 163 at ThreadState.cpp:484
    frame #8: blink::ThreadState::threadLocalWeakProcessing(this=0x000000012c8b2970) + 560 at ThreadState.cpp:511
    frame #9: blink::ThreadState::preSweep(this=0x000000012c8b2970) + 136 at ThreadState.cpp:1110
    frame #10: blink::ThreadState::leaveSafePoint(this=0x000000012c8b2970, locker=0x0000000000000000) + 211 at ThreadState.cpp:1382
    frame #11: blink::SafePointScope::~SafePointScope(this=0x00007fff5eda13a0) + 46 at SafePoint.h:29
    frame #12: blink::SafePointScope::~SafePointScope(this=0x00007fff5eda13a0) + 21 at SafePoint.h:27
    frame #13: blink::ThreadState::collectGarbage(this=0x000000012c8b2970, stackState=NoHeapPointersOnStack, gcType=GCWithoutSweep, reason=PreciseGC) + 2527 at ThreadState.cpp:1780
    frame #14: blink::ThreadState::runScheduledGC(this=0x000000012c8b2970, stackState=NoHeapPointersOnStack) + 214 at ThreadState.cpp:1014
    frame #15: blink::ThreadState::safePoint(this=0x000000012c8b2970, stackState=NoHeapPointersOnStack) + 106 at ThreadState.cpp:1324
    frame #16: blink::GCTaskObserver::didProcessTask(this=0x000020096a61c160) + 76 at GCTaskRunner.h:89
    frame #17: blink::scheduler::WebThreadBase::TaskObserverAdapter::DidProcessTask(this=0x00007f8bead0cca0, pending_task=0x00007fff5eda1818) + 41 at webthread_base.cc:32
    frame #18: blink::scheduler::TaskQueueManager::ProcessTaskFromWorkQueue(this=0x00007f8beac16630, work_queue=0x00007f8bec041740) + 2077 at task_queue_manager.cc:368
 
Owner: alph@chromium.org
Status: Assigned (was: Untriaged)

Comment 2 by alph@chromium.org, Nov 28 2016

Status: Fixed (was: Assigned)
Should be fixed already. https://chromium.googlesource.com/chromium/src/+/217752dc305a71efe069ee55f8c8cee3c6b02dac

Sign in to add a comment