[Webkit-unassigned] [Bug 175602] New: [GTK] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) when dragging file into webview
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Aug 15 15:08:37 PDT 2017
https://bugs.webkit.org/show_bug.cgi?id=175602
Bug ID: 175602
Summary: [GTK] ASSERTION FAILED:
!HashTranslator::equal(KeyTraits::emptyValue(), key)
when dragging file into webview
Product: WebKit
Version: Other
Hardware: PC
OS: Linux
Status: NEW
Severity: Normal
Priority: P2
Component: WebKit Gtk
Assignee: webkit-unassigned at lists.webkit.org
Reporter: mcatanzaro at igalia.com
CC: bugs-noreply at webkitgtk.org
Created attachment 318181
--> https://bugs.webkit.org/attachment.cgi?id=318181&action=review
Backtrace
I tried dragging a file into Epiphany. It usually works but I guess it is racy as today (using WebKit trunk) I hit this assertion:
ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key)
../../Source/WTF/wtf/HashTable.h(587) : void WTF::HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::checkKey(const T&) [with HashTranslator = WTF::IdentityHashTranslator<WTF::HashMap<_GdkDragContext*, std::unique_ptr<WebKit::DragAndDropHandler::DroppingContext> >::KeyValuePairTraits, WTF::PtrHash<_GdkDragContext*> >; T = _GdkDragContext*; Key = _GdkDragContext*; Value = WTF::KeyValuePair<_GdkDragContext*, std::unique_ptr<WebKit::DragAndDropHandler::DroppingContext> >; Extractor = WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<_GdkDragContext*, std::unique_ptr<WebKit::DragAndDropHandler::DroppingContext> > >; HashFunctions = WTF::PtrHash<_GdkDragContext*>; Traits = WTF::HashMap<_GdkDragContext*, std::unique_ptr<WebKit::DragAndDropHandler::DroppingContext> >::KeyValuePairTraits; KeyTraits = WTF::HashTraits<_GdkDragContext*>]
Detailed backtrace attached. Unfortunately I can't reproduce it. Here's the function it's crashing in:
template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
template<typename HashTranslator, typename T>
void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::checkKey(const T& key)
{
if (!HashFunctions::safeToCompareToEmptyOrDeleted)
return;
ASSERT(!HashTranslator::equal(KeyTraits::emptyValue(), key));
// ...
}
Clearly HashFunctions::safeToCompareToEmptyOrDeleted is returning true, so the function does not return early. Then the assertion fails. It's not clear to me why it is impermissible for a HashMap to contain an empty-valued key, but OK.
A naive speculative fix would add a null-check for the gdkContext in DragAndDropHandler.cpp, like this:
void DragAndDropHandler::dragLeave(GdkDragContext* context)
{
DroppingContext* droppingContext = m_droppingContexts.get(context);
if (!droppingContext || !droppingContext->gdkContext)
return;
// ...
}
But I suspect that's not the right answer. It's not clear to me why the GdkDragContext would ever be null anyway.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170815/e962059c/attachment.html>
More information about the webkit-unassigned
mailing list