<?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>35624</bug_id>
          
          <creation_ts>2010-03-02 18:06:50 -0800</creation_ts>
          <short_desc>Closing a database while a transaction is in progress can cause a crash</short_desc>
          <delta_ts>2010-03-03 17:02:29 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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="Dumitru Daniliuc">dumi</reporter>
          <assigned_to name="Dumitru Daniliuc">dumi</assigned_to>
          <cc>michaeln</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>195341</commentid>
    <comment_count>0</comment_count>
    <who name="Dumitru Daniliuc">dumi</who>
    <bug_when>2010-03-02 18:06:50 -0800</bug_when>
    <thetext>Before running any transaction step on the DB thread or the main thread, we check if the database is closed by calling the SQLTransaction::checkAndHandleClosedDatabase() method. Parts of that method though are intended to run only on the DB thread, and could cause a crash if run on the main thread. In particular, calling SQLTransactionCoordinator::releaseLock() on the main thread after SQLTransactionCoordinator::shutdown() was called on the DB thread triggers an assertion failure.

Solution: check what thread we&apos;re on inside SQLTransaction::checkAndHandleClosedDatabase() and only run the appropriate code for that thread.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>195355</commentid>
    <comment_count>1</comment_count>
      <attachid>49874</attachid>
    <who name="Dumitru Daniliuc">dumi</who>
    <bug_when>2010-03-02 18:40:48 -0800</bug_when>
    <thetext>Created attachment 49874
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>195356</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Nordman">michaeln</who>
    <bug_when>2010-03-02 18:52:13 -0800</bug_when>
    <thetext>yup... lgtm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>195727</commentid>
    <comment_count>3</comment_count>
      <attachid>49874</attachid>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2010-03-03 13:11:18 -0800</bug_when>
    <thetext>Comment on attachment 49874
patch

Per our IM discussion, please describe why it&apos;s impossible to write a deterministic regression test for it and mention the flakiness in the layout test it fixes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>195823</commentid>
    <comment_count>4</comment_count>
    <who name="Dumitru Daniliuc">dumi</who>
    <bug_when>2010-03-03 17:02:29 -0800</bug_when>
    <thetext>Landed as r55487.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>49874</attachid>
            <date>2010-03-02 18:40:48 -0800</date>
            <delta_ts>2010-03-03 13:11:18 -0800</delta_ts>
            <desc>patch</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>1382</size>
            <attacher name="Dumitru Daniliuc">dumi</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA1NTQ0NykKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTYgQEAKKzIwMTAtMDMtMDIgIER1bWl0cnUgRGF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lbnRRdWV1ZS5jbGVh
cigpOwogICAgIG1fbmV4dFN0ZXAgPSAwOwogCisgICAgLy8gVGhlIG5leHQgc3RlcHMgc2hvdWxk
IGJlIGV4ZWN1dGVkIG9ubHkgaWYgd2UncmUgb24gdGhlIERCIHRocmVhZC4KKyAgICBpZiAoY3Vy
cmVudFRocmVhZCgpICE9IGRhdGFiYXNlKCktPnNjcmlwdEV4ZWN1dGlvbkNvbnRleHQoKS0+ZGF0
YWJhc2VUaHJlYWQoKS0+Z2V0VGhyZWFkSUQoKSkKKyAgICAgICAgcmV0dXJuOworCiAgICAgLy8g
VGhlIGN1cnJlbnQgU1FMaXRlIHRyYW5zYWN0aW9uIHNob3VsZCBiZSBzdG9wcGVkLCBhcyB3ZWxs
CiAgICAgaWYgKG1fc3FsaXRlVHJhbnNhY3Rpb24pIHsKICAgICAgICAgbV9zcWxpdGVUcmFuc2Fj
dGlvbi0+c3RvcCgpOwo=
</data>
<flag name="review"
          id="32858"
          type_id="1"
          status="+"
          setter="dglazkov"
    />
    <flag name="commit-queue"
          id="32859"
          type_id="3"
          status="-"
          setter="dumi"
    />
          </attachment>
      

    </bug>

</bugzilla>