Closed Bug 540566 Opened 16 years ago Closed 16 years ago

nsCacheEntryDescriptor::GetDeviceID may crash in NS_strdup [@strlen | NS_strdup(char const*) ]

Categories

(Core :: Networking: Cache, defect)

x86
Windows Vista
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla1.9.3a2
Tracking Status
blocking2.0 --- beta1+
blocking1.9.2 --- -
status1.9.2 --- .4-fixed

People

(Reporter: m_kato, Assigned: timeless)

References

Details

(Keywords: crash, verified1.9.2, Whiteboard: [firebug-p1])

Crash Data

Attachments

(1 file, 3 obsolete files)

Signature strlen | NS_strdup(char const*) UUID 1f071269-bff9-4637-bed3-9149b2100118 Time 2010-01-18 12:54:21.453810 Uptime 47677 Last Crash 634943 seconds before submission Product Firefox Version 3.7a1pre Build ID 20100116042715 Branch 1.9.3 OS Windows NT OS Version 6.1.7600 CPU x86 CPU Info GenuineIntel family 6 model 15 stepping 11 Crash Reason EXCEPTION_ACCESS_VIOLATION Crash Address 0x0 User Comments Processor Notes Related Bugs Crashing Thread Frame Module Signature [Expand] Source 0 mozcrt19.dll strlen strlen.asm:81 1 xul.dll NS_strdup obj-firefox/xpcom/build/nsCRTGlue.cpp:145 2 xul.dll nsCacheEntryDescriptor::GetDeviceID netwerk/cache/src/nsCacheEntryDescriptor.cpp:98 3 xul.dll NS_InvokeByIndex_P xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp:102
Severity: normal → critical
Keywords: crash
Attached patch patch (obsolete) — Splinter Review
note that afaict this is never called by Gecko c++ code, so it's just used by us in js and others whereever. Given that it has always crashed, I don't think people can have expectations about what it returns in this case :).
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #422308 - Flags: review?(cbiesinger)
timeless, you should fix nsCacheEntryInfo::GetDeviceID(), too http://mxr.mozilla.org/mozilla-central/source/netwerk/cache/src/nsCacheEntry.cpp#302
Attached patch both (obsolete) — Splinter Review
Attachment #422308 - Attachment is obsolete: true
Attachment #422340 - Flags: review?(cbiesinger)
Attachment #422308 - Flags: review?(cbiesinger)
Comment on attachment 422340 [details] [diff] [review] both - nsCacheEntryInfo is only used for entries that already have a device. Consequently, you don't need this change. - Please add an xpcshell testcase. Here's a crashing testcase: var cache = Components.classes["@mozilla.org/network/cache-service;1"].getService(Components.interfaces.nsICacheService); var session = cache.createSession("client", 0, true); var entry = session.openCacheEntry("key", 2, true); entry.deviceID (but use constants instead of these fixed numbers)
Attachment #422340 - Flags: review?(cbiesinger) → review-
While reproducing a firebug user report, http://code.google.com/p/fbug/issues/detail?id=2779 I crashed FF 3.6 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.2pre) Gecko/20100201 Namoroka/3.6.2pre with http://crash-stats.mozilla.com/report/index/7cd94720-d565-4b4a-b357-55e262100201 and the link lead here. Several other comments on the crash-stats page mention Firebug. I'm confused by comment 5 > Consequently, you don't need this change. Is this is fix or no?
blocking1.9.2: --- → ?
Whiteboard: [firebug-p1]
Attached patch with test (obsolete) — Splinter Review
Attachment #422340 - Attachment is obsolete: true
Attachment #424612 - Flags: review?(cbiesinger)
John: with what version of Firebug did you crash? You've marked this as a Firebug P1 which is serious, but it would be good to know if it's blocking an upcoming Firebug release, or causes problems with the existing one, and if that's the case, how often it comes up. Not blocking for now, but if you can answer those questions, please renominate.
blocking1.9.2: ? → -
Sorry, I thought you also had seen my crash report, which includes that info: http://crash-stats.mozilla.com/report/index/bp-6c1cee4a-250f-42cb-8000-554262100201 It's Firebug version 1.5.0. And to prove it was Firebug, I deleted all other AddOns when I tested and crahsed.
(In reply to comment #9) > John: with what version of Firebug did you crash? I crashed 1.6a4; the original Firebug user report was against 1.5.0 (the current AMO release). > You've marked this as a > Firebug P1 which is serious, but it would be good to know if it's blocking an > upcoming Firebug release, or causes problems with the existing one, and if > that's the case, how often it comes up. I would say this crash is rare, based little information. It must require more that just Firebug + full cache refresh or we would hear more. > > Not blocking for now, but if you can answer those questions, please renominate. This is a crasher with multiple reports and a patch. In my opinion this should be reviewed and land on 1.9.3 promptly.
blocking2.0: --- → ?
Comment on attachment 424612 [details] [diff] [review] with test + do_test_finished(); You only need this if you used do_test_pending, which you don't Also, tests should preferrably be in the public domain, see http://www.mozilla.org/MPL/license-policy.html
Attachment #424612 - Flags: review?(cbiesinger) → review+
I'd love to have a JS stack trace of the Firebug crashes... Does Firebug access the deviceID of cache entries anywhere? If so could you post a link to the code? Re comment 6, when I said "you don't need this change" I was referring to only half of the patch.
Christian, You said "I'd love to have a JS stack trace of the Firebug crashes...". If you tell me what you want, I can try and get it for you. I just turned all my other AddOn's off, turned Firebug on, and FF consistently crashes again when I navigate to any page. Jay
(In reply to comment #14) > > I just turned all my other AddOn's off, turned Firebug on, and FF consistently > crashes again when I navigate to any page. Jay, there is almost certainly something else wrong on our installation. We have some millions of users and this crash is rare. please install Firebug in a clean newly created Firefox profile. (See http://getfirebug.com/wiki/index.php/FAQ for hints). If you crash then it issue is in your Firefox or OS install; if not then the problem is a setting in your current profile.
On the crash there seems to be just one JS frame, a callback that accesses descriptor.deviceID: http://code.google.com/p/fbug/source/browse/branches/firebug1.6/content/firebug/net.js#4388
As John suggested, I created a new profile and the issue has gone away. For me at least, something must have gotten corrupted locally and impacted Firebug, etc. Thanks.
(In reply to comment #16) > On the crash there seems to be just one JS frame, a callback that accesses > descriptor.deviceID: > http://code.google.com/p/fbug/source/browse/branches/firebug1.6/content/firebug/net.js#4388 That's weird; cache entries that got opened for reading should have a device...
Ok here's hint, the crashing entry for the test case from comment 6 is a swf file: extensions.firebug: net.onCacheEntryAvailable for file.href=http://www.caterstop .com/App_Themes/catering/img/caterstop-catering-equipment-logo-trans.swf
Blocking, primarily because this is a firebug-p1 bug.
blocking2.0: ? → beta1
Attached patch smaller testSplinter Review
Attachment #424612 - Attachment is obsolete: true
Attachment #427681 - Flags: review+
Keywords: checkin-needed
(In reply to comment #22) > *** Bug 546851 has been marked as a duplicate of this bug. *** Note that that bug has a 100% reproducible crash with Firebug and a clean cache here: http://beaufour.dk/blog_crash
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a2
Comment on attachment 427681 [details] [diff] [review] smaller test This seems to have fallen through the cracks. Requesting approval for 1.9.2.3.
Attachment #427681 - Flags: approval1.9.2.3?
#14 topcrash in early firefox 3.6.2 crash data so getting this in to 1.9.2.3 would be good.
chofmann: i doesn't have approval... anyway, once it gets approval, someone should push it. i'm unlikely to do so for roughly a month.
> This seems to have fallen through the cracks. Requesting approval for 1.9.2.3. This request seems not to have been set, so I am setting it. By FF 3.6.3 the patch from comment 24 would be baked well on trunk.
blocking1.9.2: - → ?
(In reply to comment #28) > > This seems to have fallen through the cracks. Requesting approval for 1.9.2.3. > > This request seems not to have been set It's on the patch.
blocking1.9.2: ? → -
Comment on attachment 427681 [details] [diff] [review] smaller test a=beltzner for 1.9.2.3
Attachment #427681 - Flags: approval1.9.2.3? → approval1.9.2.3+
Keywords: checkin-needed
I would land this, but I'm on vacation and don't have a good enough connection to do so.
john: please read the bugzilla flags for bugs before complaining in them. this one has status1.9.2: .4-fixed (the approval flag on the attachment is approval1.9.2.4+ too)
Marking as verified for 1.9.2 based on the passing checked in test in lieu of manual reproduction steps for the bug. John, this won't be fixed in a shipped release until Firefox 3.6.4 is out.
Keywords: verified1.9.2
Crash Signature: [@strlen | NS_strdup(char const*) ]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: