Skip to content

Instantly share code, notes, and snippets.

@Adenilson
Created February 15, 2013 17:55
Show Gist options
  • Save Adenilson/4962091 to your computer and use it in GitHub Desktop.
Save Adenilson/4962091 to your computer and use it in GitHub Desktop.
segfault
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp
index cfa132f..366539b 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp
@@ -28,12 +28,14 @@
#include "PlatformWebView.h"
#include "Test.h"
#include <WebKit2/WKRetainPtr.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
namespace TestWebKitAPI {
static bool firstLoad = false;
static bool resizeAfterCrash = false;
-static PlatformWebView *webView = 0;
+static OwnPtr<PlatformWebView> webView;
static void didFinishLoad(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
{
@@ -45,9 +47,6 @@ static void didFinishLoad(WKPageRef page, WKFrameRef frame, WKTypeRef userData,
EXPECT_FALSE(resizeAfterCrash);
resizeAfterCrash = true;
-
- // FIXME: use a smart/shared pointer here
- delete webView;
}
static void didCrash(WKPageRef page, const void*)
@@ -66,8 +65,7 @@ static void didCrash(WKPageRef page, const void*)
TEST(WebKit2, ResizeWindowAfterCrash)
{
WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
- // TODO: use a smart/shared pointer here
- webView = new PlatformWebView(context.get());
+ webView = adoptPtr(new PlatformWebView(context.get()));
WKPageLoaderClient loaderClient;
memset(&loaderClient, 0, sizeof(loaderClient));
)
[ PASSED ] 1 test.
ASSERTION FAILED: !result
/home/adenilson/apps/webkit/Webkit/Source/WTF/wtf/ThreadingPthreads.cpp(345) : void WTF::Mutex::lock()
1 0x43912d WTF::Mutex::lock()
2 0x43995e WTF::Locker<WTF::Mutex>::Locker(WTF::Mutex&)
3 0x7f063e59f72d void WTF::addIterator<void*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*> >, WTF::PtrHash<void*>, WTF::HashMapValueTraits<WTF::HashTraits<void*>, WTF::HashTraits<WebCore::TextureMapperGLData::SharedGLData*> >, WTF::HashTraits<void*> >(WTF::HashTable<void*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*> >, WTF::PtrHash<void*>, WTF::HashMapValueTraits<WTF::HashTraits<void*>, WTF::HashTraits<WebCore::TextureMapperGLData::SharedGLData*> >, WTF::HashTraits<void*> > const*, WTF::HashTableConstIterator<void*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*> >, WTF::PtrHash<void*>, WTF::HashMapValueTraits<WTF::HashTraits<void*>, WTF::HashTraits<WebCore::TextureMapperGLData::SharedGLData*> >, WTF::HashTraits<void*> >*)
4 0x7f063e5a34da WTF::HashTableConstIterator<void*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*> >, WTF::PtrHash<void*>, WTF::HashMapValueTraits<WTF::HashTraits<void*>, WTF::HashTraits<WebCore::TextureMapperGLData::SharedGLData*> >, WTF::HashTraits<void*> >::HashTableConstIterator(WTF::HashTable<void*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*> >, WTF::PtrHash<void*>, WTF::HashMapValueTraits<WTF::HashTraits<void*>, WTF::HashTraits<WebCore::TextureMapperGLData::SharedGLData*> >, WTF::HashTraits<void*> > const*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*> const*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*> const*, WTF::HashItemKnownGoodTag)
5 0x7f063e5a235c WTF::HashTableIterator<void*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*> >, WTF::PtrHash<void*>, WTF::HashMapValueTraits<WTF::HashTraits<void*>, WTF::HashTraits<WebCore::TextureMapperGLData::SharedGLData*> >, WTF::HashTraits<void*> >::HashTableIterator(WTF::HashTable<void*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*> >, WTF::PtrHash<void*>, WTF::HashMapValueTraits<WTF::HashTraits<void*>, WTF::HashTraits<WebCore::TextureMapperGLData::SharedGLData*> >, WTF::HashTraits<void*> >*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>*, WTF::HashItemKnownGoodTag)
6 0x7f063e5a0d20 WTF::HashTable<void*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*> >, WTF::PtrHash<void*>, WTF::HashMapValueTraits<WTF::HashTraits<void*>, WTF::HashTraits<WebCore::TextureMapperGLData::SharedGLData*> >, WTF::HashTraits<void*> >::makeKnownGoodIterator(WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>*)
7 0x7f063e59f844 WTF::HashTable<void*, WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<void*, WebCore::TextureMapperGLData::SharedGLData*> >, WTF::PtrHash<void*>, WTF::HashMapValueTraits<WTF::HashTraits<void*>, WTF::HashTraits<WebCore::TextureMapperGLData::SharedGLData*> >, WTF::HashTraits<void*> >::end()
8 0x7f063e59e4bd WTF::HashMap<void*, WebCore::TextureMapperGLData::SharedGLData*, WTF::PtrHash<void*>, WTF::HashTraits<void*>, WTF::HashTraits<WebCore::TextureMapperGLData::SharedGLData*> >::end()
9 0x7f063e59df11 WebCore::TextureMapperGLData::SharedGLData::~SharedGLData()
10 0x7f063e5a0da9 WTF::RefCounted<WebCore::TextureMapperGLData::SharedGLData>::deref()
11 0x7f063e59f8dc void WTF::derefIfNotNull<WebCore::TextureMapperGLData::SharedGLData>(WebCore::TextureMapperGLData::SharedGLData*)
12 0x7f063e59ebfb WTF::RefPtr<WebCore::TextureMapperGLData::SharedGLData>::~RefPtr()
13 0x7f063e599a3b WebCore::TextureMapperGLData::~TextureMapperGLData()
14 0x7f063e59c848 WebCore::TextureMapperGL::~TextureMapperGL()
15 0x7f063e59c8b4 WebCore::TextureMapperGL::~TextureMapperGL()
16 0x7f063dd453f8 void WTF::deleteOwnedPtr<WebCore::TextureMapper>(WebCore::TextureMapper*)
17 0x7f063dd42f7b WTF::OwnPtr<WebCore::TextureMapper>::~OwnPtr()
18 0x7f063dd3f2e0 WebCore::CoordinatedGraphicsScene::~CoordinatedGraphicsScene()
19 0x7f063dd3f33e WebCore::CoordinatedGraphicsScene::~CoordinatedGraphicsScene()
20 0x7f0644744a1c WTF::ThreadSafeRefCounted<WebCore::CoordinatedGraphicsScene>::deref()
21 0x7f0644743174 void WTF::derefIfNotNull<WebCore::CoordinatedGraphicsScene>(WebCore::CoordinatedGraphicsScene*)
22 0x7f0644741fcb WTF::RefPtr<WebCore::CoordinatedGraphicsScene>::~RefPtr()
23 0x7f0644740a01 WebKit::CoordinatedLayerTreeHostProxy::~CoordinatedLayerTreeHostProxy()
24 0x7f0644740a5e WebKit::CoordinatedLayerTreeHostProxy::~CoordinatedLayerTreeHostProxy()
25 0x7f064468ab85 void WTF::deleteOwnedPtr<WebKit::CoordinatedLayerTreeHostProxy>(WebKit::CoordinatedLayerTreeHostProxy*)
26 0x7f064468ab59 WTF::OwnPtr<WebKit::CoordinatedLayerTreeHostProxy>::~OwnPtr()
27 0x7f064468a78a WebKit::DrawingAreaProxy::~DrawingAreaProxy()
28 0x7f064468ae1e WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl()
29 0x7f064468ae58 WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl()
30 0x7f06447018e6 void WTF::deleteOwnedPtr<WebKit::DrawingAreaProxy>(WebKit::DrawingAreaProxy*)
31 0x7f064470485c WTF::OwnPtr<WebKit::DrawingAreaProxy>::clear()
ERROR: Thread name "com.apple.WebKit.ChildProcess.WatchDogQueue" is longer than 31 characters and will be truncated by Visual Studio
/home/adenilson/apps/webkit/Webkit/Source/WTF/wtf/Threading.cpp(78) : WTF::ThreadIdentifier WTF::createThread(WTF::ThreadFunction, void*, const char*)
Segmentation fault (core dumped)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment