Bug 56083 - [GTK] unittests/testapplicationcache crashes
Summary: [GTK] unittests/testapplicationcache crashes
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2011-03-10 02:14 PST by Philippe Normand
Modified: 2011-04-24 00:41 PDT (History)
3 users (show)

See Also:

proposed patch (5.82 KB, patch)
2011-03-10 06:46 PST, Philippe Normand
xan.lopez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2011-03-10 02:14:50 PST
#0  0x00007fe8e57d4916 in WebCore::ApplicationCacheStorage::setCacheDirectory (this=0x1dc8230, cacheDirectory=...) at ../../Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp:359
359	    ASSERT(m_cacheDirectory.isNull());

Thread 1 (Thread 7535):
#0  0x00007fe8e57d4916 in WebCore::ApplicationCacheStorage::setCacheDirectory (this=0x1dc8230, cacheDirectory=...) at ../../Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp:359
#1  0x00007fe8e5203411 in webkit_application_cache_set_database_directory_path (path=0x1e6e430 "/home/slave/.local/share/webkit/databases") at ../../Source/WebKit/gtk/webkit/webkitapplicationcache.cpp:118
#2  0x0000000000400ed9 in test_application_cache_database_directory_path () at ../../Source/WebKit/gtk/tests/testapplicationcache.c:46
#3  0x00007fe8e19d48e3 in test_case_run (suite=0x1d99ba0, path=0x7fe8e1a21c5e "") at /tmp/buildd/glib2.0-2.27.91/./glib/gtestutils.c:1174
#4  g_test_run_suite_internal (suite=0x1d99ba0, path=0x7fe8e1a21c5e "") at /tmp/buildd/glib2.0-2.27.91/./glib/gtestutils.c:1223
#5  0x00007fe8e19d4a56 in g_test_run_suite_internal (suite=<value optimized out>, path=0x7fe8e1a21c5e "") at /tmp/buildd/glib2.0-2.27.91/./glib/gtestutils.c:1233
#6  0x00007fe8e19d4a56 in g_test_run_suite_internal (suite=<value optimized out>, path=0x7fe8e1a21c5e "") at /tmp/buildd/glib2.0-2.27.91/./glib/gtestutils.c:1233
#7  0x00007fe8e19d4d3b in g_test_run_suite (suite=0x1d99b20) at /tmp/buildd/glib2.0-2.27.91/./glib/gtestutils.c:1282
#8  0x0000000000400ff0 in main (argc=1, argv=0x7fff53873978) at ../../Source/WebKit/gtk/tests/testapplicationcache.c:70
Comment 2 Philippe Normand 2011-03-10 02:21:39 PST
Sorry Christian, doesn't seem to be your patch.
Comment 3 Philippe Normand 2011-03-10 02:43:23 PST
Lukasz, the testapplicationcache has been crashing since its checkin in r80225.
Did it ever run fine for you? in Debug build?
Comment 4 Philippe Normand 2011-03-10 03:23:06 PST
webkit_application_cache_set_database_directory_path() is called twice, once in webkitInit() and once in the test itself.

To avoid the ASSERT the test should probably clear the path before setting it again. Or it could be done directly in webkit_application_cache_set_database_directory_path().
Comment 5 Philippe Normand 2011-03-10 03:38:48 PST
The mac port calls cacheStorage().setCacheDirectory() once only in all application life-time and I think we should do the same and not expose an API to modify the cache directory as there's no API to clear m_cacheDirectory in ApplicationCacheStorage.
Comment 6 Philippe Normand 2011-03-10 03:39:53 PST
CCing Xan as he reviewed the original patch.
Comment 7 Philippe Normand 2011-03-10 06:46:56 PST
Created attachment 85316 [details]
proposed patch
Comment 8 Xan Lopez 2011-03-10 06:48:25 PST
Comment on attachment 85316 [details]
proposed patch

Thank you.
Comment 9 Philippe Normand 2011-03-10 06:52:38 PST
Committed r80715: <http://trac.webkit.org/changeset/80715>
Comment 10 Lukasz Slachciak 2011-04-24 00:41:02 PDT
Thx Philippe for fix. I was testing it on the release build and everything seemed OK. I'm sorry for problems.