Closed Bug 605835 Opened 14 years ago Closed 14 years ago

Stack exhaustion in cookie observers on startup with 10-20 nightly

Categories

(Core :: Networking: Cookies, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- beta8+

People

(Reporter: bent.mozilla, Assigned: dwitte)

Details

Attachments

(2 files)

Attached file Stack
I can't launch my nightly today on mac. See attached stack, we're doing something recursive in cookie land now. I even renamed my old cookies.sqlite file to see if that helped but I still crash in the same way.
blocking2.0: --- → ?
DumpJSStack()?
So, today's nightly is also very crashy for me, but it's a crash in JS (bug 605452) which was fixed on trunk an hour ago. (Note that I can't reproduce on my own debug build with the rev of last night's nightly, but I can with opt.)

Can you roll an opt build of current tip, or download an hourly, and retest?

Meantime, I'll look through the observers in our tree and see if anything leaps out at me.
Note that this could also be an addon -- what do you have installed?
And can you repro on a debug build?
Attached patch patchSplinter Review
Upon code inspection, I did find a bug in how we handle stale cookies. It may well be the cause of this, since it affects how notifications are dispatched.
Assignee: nobody → dwitte
Status: NEW → ASSIGNED
Attachment #484745 - Flags: review?(sdwilsh)
blocking2.0: ? → beta8+
Comment on attachment 484745 [details] [diff] [review]
patch

>+++ b/netwerk/cookie/nsCookieService.cpp
>+    bool isStale = oldCookie->Expiry() <= currentTime;
move this below the comment, right above the if.

>+    // Check if the old cookie is stale (i.e. has already expired). If so, we
>+    // need to be careful about the semantics of removing it and adding the new
>+    // cookie.
Why?  Please explain.

>+    if (isStale) {
>+      if (aCookie->Expiry() <= currentTime) {
>+        // The new cookie has expired and the old one is stale. Nothing to do.
>+        COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader,
>+          "cookie has already expired");
nit: line up with (

>+      // If the old cookie is httponly, make sure we're not coming from script.
>+      if (!aFromHttp && oldCookie->IsHttpOnly()) {
>+        COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader,
>+          "previously stored cookie is httponly; coming from script");
ditto

>+      COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader,
>+        "previously stored cookie was deleted");
and here

>+      // If the new cookie has expired -- i.e. the intent was simply to delete
>+      // the old cookie -- then we're done.
>+      if (aCookie->Expiry() <= currentTime)
>+        return;
nit: brace this if please

>     if (aCookie->Expiry() <= currentTime) {
>-      COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader, "cookie has already expired");
>+      COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader,
>+        "cookie has already expired");
nit: line up with (

r=sdwilsh
Attachment #484745 - Flags: review?(sdwilsh) → review+
Done.

http://hg.mozilla.org/mozilla-central/rev/9bd3db0de90e
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: