<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>28947</bug_id>
          
          <creation_ts>2009-09-03 07:27:02 -0700</creation_ts>
          <short_desc>ASSERT executing the webhistory unittest in a debug build</short_desc>
          <delta_ts>2009-10-06 04:57:32 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xan Lopez">xan.lopez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>144510</commentid>
    <comment_count>0</comment_count>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2009-09-03 07:27:02 -0700</bug_when>
    <thetext>/webkit/webhistoryitem/get_data: ASSERTION FAILED: isMainThread()
(../../WebCore/platform/text/TextEncodingRegistry.cpp:176 void WebCore::buildBaseTextCodecMaps())

Program received signal SIGSEGV, Segmentation fault.
0x014d7e48 in buildBaseTextCodecMaps () at ../../WebCore/platform/text/TextEncodingRegistry.cpp:176
176	    ASSERT(isMainThread());
Current language:  auto; currently c++
Missing separate debuginfos, use: debuginfo-install libgcc-4.4.0-0.31.i586 libstdc++-4.4.0-0.31.i586 libxml2-2.7.3-2.fc10.i386
(gdb) bt
#0  0x014d7e48 in buildBaseTextCodecMaps () at ../../WebCore/platform/text/TextEncodingRegistry.cpp:176
#1  0x014d811f in WebCore::atomicCanonicalTextEncodingName (name=0x1d5eb8c &quot;UTF-8&quot;) at ../../WebCore/platform/text/TextEncodingRegistry.cpp:241
#2  0x014d57ff in TextEncoding (this=0x29d8c00, name=0x1d5eb8c &quot;UTF-8&quot;) at ../../WebCore/platform/text/TextEncoding.cpp:61
#3  0x014d6402 in WebCore::UTF8Encoding () at ../../WebCore/platform/text/TextEncoding.cpp:266
#4  0x014689dc in KURL (this=0xbfffeb94, base=@0xbfffebd0, relative=@0xbfffebcc) at ../../WebCore/platform/KURL.cpp:319
#5  0x00ec783a in webkit_web_history_item_new_with_data (uri=0x8048709 &quot;http://example.com/&quot;, title=0x8048700 &quot;Example1&quot;)
    at ../../WebKit/gtk/webkit/webkitwebhistoryitem.cpp:300
#6  0x0804824e in web_history_item_fixture_setup (fixture=0x804d928, data=0x0) at ../../WebKit/gtk/tests/testwebhistoryitem.c:33
#7  0x00c79077 in test_case_run (tc=0x804c808) at gtestutils.c:1129
#8  0x00c7934c in g_test_run_suite_internal (suite=0x8076540, path=0xcbb04c &quot;&quot;) at gtestutils.c:1179
#9  0x00c79401 in g_test_run_suite_internal (suite=0x8076530, path=0xcbb04c &quot;&quot;) at gtestutils.c:1189
#10 0x00c79401 in g_test_run_suite_internal (suite=0x8076510, path=0xcbb04c &quot;&quot;) at gtestutils.c:1189
#11 0x00c79588 in IA__g_test_run_suite (suite=0x8076510) at gtestutils.c:1230
#12 0x00c7876c in IA__g_test_run () at gtestutils.c:862
#13 0x08048623 in main (argc=1, argv=0xbfffef14) at ../../WebKit/gtk/tests/testwebhistoryitem.c:71
(gdb)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>144511</commentid>
    <comment_count>1</comment_count>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2009-09-03 07:29:28 -0700</bug_when>
    <thetext>This was touched recently in r47911, which claimed to be also fixing a possible ASSERT in debug builds. Mmmm :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152618</commentid>
    <comment_count>2</comment_count>
      <attachid>40701</attachid>
    <who name="Alejandro G. Castro">alex</who>
    <bug_when>2009-10-06 01:44:00 -0700</bug_when>
    <thetext>Created attachment 40701
Patch fixing the problem

The problem was caused because webkit_init was not called before the instantiation of a KURL. Apparently webkit_init is being called in the class_init but it is not enough in these cases. If we want a more general solution we can check all the places that could cause a problem like this or comment that webkit_init should be called by the programs before doing anything (but this would mean adding the function to the API if it is not). Anyway we have to consider that if someone uses webkit library and tries to create a KURL is going to have problems if they do not call webkit_init in advance calling other API functions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152619</commentid>
    <comment_count>3</comment_count>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2009-10-06 01:47:42 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Created an attachment (id=40701) [details]
&gt; Patch fixing the problem
&gt; 
&gt; The problem was caused because webkit_init was not called before the
&gt; instantiation of a KURL. Apparently webkit_init is being called in the
&gt; class_init but it is not enough in these cases. If we want a more general
&gt; solution we can check all the places that could cause a problem like this or
&gt; comment that webkit_init should be called by the programs before doing anything
&gt; (but this would mean adding the function to the API if it is not). Anyway we
&gt; have to consider that if someone uses webkit library and tries to create a KURL
&gt; is going to have problems if they do not call webkit_init in advance calling
&gt; other API functions.

Keep in mind that KURL and everything else in WebCore is not public API, so that is not a problem. The problem is that we might have lots of other functions where calls to WebCore are made before any class_init is called, which as shown in this test can cause problems.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152620</commentid>
    <comment_count>4</comment_count>
      <attachid>40702</attachid>
    <who name="Alejandro G. Castro">alex</who>
    <bug_when>2009-10-06 01:53:52 -0700</bug_when>
    <thetext>Created attachment 40702
Fixed Changelog style

Sorry about that :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152621</commentid>
    <comment_count>5</comment_count>
      <attachid>40702</attachid>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2009-10-06 01:56:48 -0700</bug_when>
    <thetext>Comment on attachment 40702
Fixed Changelog style

r=me, thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152673</commentid>
    <comment_count>6</comment_count>
      <attachid>40702</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-10-06 04:57:29 -0700</bug_when>
    <thetext>Comment on attachment 40702
Fixed Changelog style

Clearing flags on attachment: 40702

Committed r49172: &lt;http://trac.webkit.org/changeset/49172&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152674</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-10-06 04:57:32 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>40701</attachid>
            <date>2009-10-06 01:44:00 -0700</date>
            <delta_ts>2009-10-06 01:53:52 -0700</delta_ts>
            <desc>Patch fixing the problem</desc>
            <filename>webhistoryitem_assertion_28947.patch</filename>
            <type>text/plain</type>
            <size>1550</size>
            <attacher name="Alejandro G. Castro">alex</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYktpdC9ndGsvQ2hhbmdlTG9nIGIvV2ViS2l0L2d0ay9DaGFuZ2VMb2cK
aW5kZXggYTllZjM0NC4uYTJiOWQ5MSAxMDA2NDQKLS0tIGEvV2ViS2l0L2d0ay9DaGFuZ2VMb2cK
KysrIGIvV2ViS2l0L2d0ay9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxMiBAQAorMjAwOS0xMC0wNiAg
QWxlamFuZHJvIEcuIENhc3RybyAgPGFsZXhAaWdhbGlhLmNvbT4KKworICAgICAgICBSZXZpZXdl
ZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBXZSBo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IHdlYkhpc3RvcnlJdGVtID0gV0VCS0lUX1dFQl9ISVNU
T1JZX0lURU0oZ19vYmplY3RfbmV3KFdFQktJVF9UWVBFX1dFQl9ISVNUT1JZX0lURU0sIE5VTEwp
KTsKICAgICBXZWJLaXRXZWJIaXN0b3J5SXRlbVByaXZhdGUqIHByaXYgPSB3ZWJIaXN0b3J5SXRl
bS0+cHJpdjsKIAorICAgIFdlYkNvcmU6OktVUkwgaGlzdG9yeVVyaShXZWJDb3JlOjpLVVJMKCks
IHVyaSk7CisgICAgV2ViQ29yZTo6U3RyaW5nIGhpc3RvcnlUaXRsZSA9IFdlYkNvcmU6OlN0cmlu
Zzo6ZnJvbVVURjgodGl0bGUpOwogICAgIFJlZlB0cjxXZWJDb3JlOjpIaXN0b3J5SXRlbT4gaXRl
bSA9IFdlYkNvcmU6Okhpc3RvcnlJdGVtOjpjcmVhdGUoaGlzdG9yeVVyaSwgaGlzdG9yeVRpdGxl
LCAwKTsKICAgICBwcml2LT5oaXN0b3J5SXRlbSA9IGl0ZW0ucmVsZWFzZSgpLnJlbGVhc2VSZWYo
KTsKICAgICB3ZWJraXRfaGlzdG9yeV9pdGVtX2FkZCh3ZWJIaXN0b3J5SXRlbSwgcHJpdi0+aGlz
dG9yeUl0ZW0pOwo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>40702</attachid>
            <date>2009-10-06 01:53:52 -0700</date>
            <delta_ts>2009-10-06 04:57:28 -0700</delta_ts>
            <desc>Fixed Changelog style</desc>
            <filename>webhistoryitem_assertion_28947.patch</filename>
            <type>text/plain</type>
            <size>1680</size>
            <attacher name="Alejandro G. Castro">alex</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYktpdC9ndGsvQ2hhbmdlTG9nIGIvV2ViS2l0L2d0ay9DaGFuZ2VMb2cK
aW5kZXggYTllZjM0NC4uMWQ4MTk3MSAxMDA2NDQKLS0tIGEvV2ViS2l0L2d0ay9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