<?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>14269</bug_id>
          
          <creation_ts>2007-06-20 23:48:47 -0700</creation_ts>
          <short_desc>REGRESSION: Gmail links stop working after computer sleep</short_desc>
          <delta_ts>2007-08-25 14:51:11 -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>Page Loading</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://mail.google.com/mail</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction, InRadar, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ruben Bakker">ruben</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
    
    <cc>darin</cc>
    
    <cc>ddkilzer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>6942</commentid>
    <comment_count>0</comment_count>
    <who name="Ruben Bakker">ruben</who>
    <bug_when>2007-06-20 23:48:47 -0700</bug_when>
    <thetext>The problem occurs when using Gmail and putting the Mac to sleep. After wakeup the Gmail page is not responsive, e.g., most links do not work anymore. After a delay of about 1 to 3 minutes the links start working again. A page reload does solve the problem, too.

Steps to duplicate the problem:
1. Open http://mail.google.com/mail and login
2. While on the &quot;Inbox&quot; page: put your Mac to sleep
3. Wait a least 5 minutes (If you wait less, you cannot dup the problem).
4. Wakeup your Mac
5. Press the &quot;Refresh&quot; link or &quot;Sent mail&quot; link -&gt; nothing happens
6. Wait about 1 to 2 minutes and the links work again

I put &quot;Regression&quot; in the title, as the problem cannot be duplicated in Safari 2 (Tiger/419.x) .</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6932</commentid>
    <comment_count>1</comment_count>
      <attachid>15154</attachid>
    <who name="Ruben Bakker">ruben</who>
    <bug_when>2007-06-21 00:06:14 -0700</bug_when>
    <thetext>Created attachment 15154
WebCore/Timer.cpp patch to work around the problem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6935</commentid>
    <comment_count>2</comment_count>
    <who name="Ruben Bakker">ruben</who>
    <bug_when>2007-06-21 00:15:30 -0700</bug_when>
    <thetext>After some debugging I found the WebCore SharedTimer to be the problem. Normally, the SharedTimer is restarted when the time of the first Timer on the timerHeap changes. 

After a sleep however, the first Timer on the timerHeap has an absolute time that is in the past. The SharedTimer doesn&apos;t get updated when new Timers (for loading pages) are added as they never can become the first timer. 

My workaround (see attached patch) is to always update the SharedTimer, even when the timer is not the the first timer.

I hope this makes sense :-).




</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6898</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-06-21 07:33:49 -0700</bug_when>
    <thetext>Updating bug since it&apos;s a regression.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6899</commentid>
    <comment_count>4</comment_count>
      <attachid>15154</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-06-21 07:40:30 -0700</bug_when>
    <thetext>Comment on attachment 15154
WebCore/Timer.cpp patch to work around the problem

Thanks for the patch and the detective work, Ruben!

NOTE: I&apos;m not reviewing the correctness of the code changes in the patch, but instead the patch itself.

1. Please create a ChangeLog entry for this patch using WebKitTools/Scripts/prepare-ChangeLog.

2. Please use WebKitTools/Scripts/svn-create-patch to generate a patch of the ChangeLog entry and the code fix.

3. All changes need a layout test unless it&apos;s not possible to make one.  (In this case, I&apos;d say it&apos;s not possible to emulate sleeping for over 5 minutes in the layout tests, so just note this in the ChangeLog entry as well.)

More details here:  http://webkit.org/coding/contributing.html

Please make the above corrections and attach a new patch.  Please also set the &quot;review?&quot; flag on the patch so that reviewers will notice it.  Thanks again!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6879</commentid>
    <comment_count>5</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-06-21 08:54:32 -0700</bug_when>
    <thetext>Confirmed with a local debug build of WebKit r23713 with Safari 3.0 (522.11) on Mac OS X 10.4.10 (8R218).

Nice job spotting this bug and tracking down the cause and fix!!

I noticed that the cursor in the Bugzilla &quot;Additional Comments&quot; text area doesn&apos;t blink during this period after wake, either!  :)

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6881</commentid>
    <comment_count>6</comment_count>
    <who name="Ruben Bakker">ruben</who>
    <bug_when>2007-06-21 09:09:49 -0700</bug_when>
    <thetext>Hi David,
Thanks for confirming this bug!
I will follow &quot;the process&quot; and attach a new patch shortly.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6816</commentid>
    <comment_count>7</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-06-21 17:13:29 -0700</bug_when>
    <thetext>&lt;rdar://problem/5286444&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3356</commentid>
    <comment_count>8</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2007-08-01 14:24:18 -0700</bug_when>
    <thetext>This might not be a good idea to do performance-wise as it would involve destroying and then creating a new CFRunLoopTimer each time a timer is added.

Darin, is that acceptable or do you have a better idea?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3203</commentid>
    <comment_count>9</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2007-08-01 15:22:31 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Darin, is that acceptable or do you have a better idea?

This doesn&apos;t fix the real problem. What it does is make scheduling a new timer &quot;tickle&quot; the shared timer and make it fire. There must be a better fix where we make the shared timer fire without scheduling a new timer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3200</commentid>
    <comment_count>10</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2007-08-01 18:03:40 -0700</bug_when>
    <thetext>We could add a new shared timer function that we&apos;d always call when adding a timer. On the Mac, this would check if the fire date is in the past and then re-set the timer. This would rely on new timers always being added sooner or later though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3088</commentid>
    <comment_count>11</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2007-08-03 13:41:38 -0700</bug_when>
    <thetext>Committed revision 24851.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1468</commentid>
    <comment_count>12</comment_count>
    <who name="Ruben Bakker">ruben</who>
    <bug_when>2007-08-25 14:51:11 -0700</bug_when>
    <thetext>I wasn&apos;t able to duplicate the problem anymore.
Thanks for fixing this bug!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>15154</attachid>
            <date>2007-06-21 00:06:14 -0700</date>
            <delta_ts>2007-06-21 07:40:30 -0700</delta_ts>
            <desc>WebCore/Timer.cpp patch to work around the problem</desc>
            <filename>platform_Timer.diff</filename>
            <type>text/plain</type>
            <size>818</size>
            <attacher name="Ruben Bakker">ruben</attacher>
            
              <data encoding="base64">SW5kZXg6IHBsYXRmb3JtL1RpbWVyLmNwcAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBwbGF0Zm9ybS9UaW1lci5j
cHAJKHJldmlzaW9uIDIzNTU5KQorKysgcGxhdGZvcm0vVGltZXIuY3BwCSh3b3JraW5nIGNvcHkp
CkBAIC0yODQsOSArMjg0LDYgQEAKICAgICBkb3VibGUgb2xkVGltZSA9IG1fbmV4dEZpcmVUaW1l
OwogICAgIGlmIChvbGRUaW1lICE9IG5ld1RpbWUpIHsKICAgICAgICAgbV9uZXh0RmlyZVRpbWUg
PSBuZXdUaW1lOwotCi0gICAgICAgIGJvb2wgd2FzRmlyc3RUaW1lckluSGVhcCA9IG1faGVhcElu
ZGV4ID09IDA7Ci0KICAgICAgICAgaWYgKG9sZFRpbWUgPT0gMCkKICAgICAgICAgICAgIGhlYXBJ
bnNlcnQoKTsKICAgICAgICAgZWxzZSBpZiAobmV3VGltZSA9PSAwKQpAQCAtMjk2LDEzICsyOTMs
MTEgQEAKICAgICAgICAgZWxzZQogICAgICAgICAgICAgaGVhcEluY3JlYXNlS2V5KCk7CiAKLSAg
ICAgICAgYm9vbCBpc0ZpcnN0VGltZXJJbkhlYXAgPSBtX2hlYXBJbmRleCA9PSAwOwotCi0gICAg
ICAgIGlmICh3YXNGaXJzdFRpbWVySW5IZWFwIHx8IGlzRmlyc3RUaW1lckluSGVhcCkKLSAgICAg
ICAgICAgIHVwZGF0ZVNoYXJlZFRpbWVyKCk7CisgICAgICAgIHVwZGF0ZVNoYXJlZFRpbWVyKCk7
CiAgICAgfQogCiAgICAgY2hlY2tDb25zaXN0ZW5jeSgpOworICAgIAogfQogCiB2b2lkIFRpbWVy
QmFzZTo6Y29sbGVjdEZpcmluZ1RpbWVycyhkb3VibGUgZmlyZVRpbWUsIFZlY3RvcjxUaW1lckJh
c2UqPiYgZmlyaW5nVGltZXJzKQo=
</data>
<flag name="review"
          id="6249"
          type_id="1"
          status="-"
          setter="ddkilzer"
    />
          </attachment>
      

    </bug>

</bugzilla>