Closed Bug 363024 Opened 18 years ago Closed 17 years ago

Calling createInstance() on mozIStorageService crashes

Categories

(Toolkit :: Storage, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla1.9alpha6

People

(Reporter: ancestor.ak, Assigned: sdwilsh)

Details

(Keywords: crash)

Attachments

(1 file, 1 obsolete file)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061206 Minefield/3.0a1

Even though mozIStorageService is a service, I don't think that calling createInstance() is allowed to crash.

Steps to reproduce:
1. Evaluate
Components.classes['@mozilla.org/storage/service;1'].createInstance(Components.interfaces.mozIStorageService);
2. Load any page.

Results:
Excessive CPU usage or a crash.

Incident ID: 26989156
Stack Signature	 PR_Lock e59b0431
Product ID	FirefoxTrunk
Build ID	2006120606
Trigger Time	2006-12-06 18:08:10.0
Platform	Win32
Operating System	Windows NT 5.1 build 2600
Module	nspr4.dll + (00015960)
URL visited	
User Comments	
Since Last Crash	30 sec
Total Uptime	85 sec
Trigger Reason	Stack overflow
Source File, Line No.	e:\builds\tinderbox\fx-trunk\winnt_5.2_depend\mozilla\nsprpub\pr\src\threads\combined\prulock.c, line 226
Stack Trace 	
PR_Lock  [mozilla\nsprpub\pr\src\threads\combined\prulock.c, line 226]
Attached patch v1.0 (obsolete) — Splinter Review
There's no good way to make createInstance fail, but we can at least ensure that we always have a singleton object that will prevent this crash.
Assignee: vladimir → sdwilsh
Status: NEW → ASSIGNED
Attachment #268511 - Flags: review?(sspitzer)
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → mozilla1.9alpha6
Comment on attachment 268511 [details] [diff] [review]
v1.0

a couple questions:

1)

How come you removed the default constructor for mozStorageService?

2)

in mozStorageService::~mozStorageService(), should you be doing "gStorageService = nsnull";
(In reply to comment #2)
> How come you removed the default constructor for mozStorageService?
it didn't do anything, and the complier automatically generates it, so there is no need for it to be in the code.

> in mozStorageService::~mozStorageService(), should you be doing
> "gStorageService = nsnull";
yes
Attached patch v1.1Splinter Review
Attachment #268511 - Attachment is obsolete: true
Attachment #268824 - Flags: review?(sspitzer)
Attachment #268511 - Flags: review?(sspitzer)
Comment on attachment 268824 [details] [diff] [review]
v1.1

r=sspitzer

shawn, can you log that spin off bug we discussed about iterating over all components and doing createInstance()?
Attachment #268824 - Flags: review?(sspitzer) → review+
Filed Bug 384973
Checking in storage/build/mozStorageModule.cpp;
new revision: 1.5; previous revision: 1.4
Checking in storage/src/mozStorageService.cpp;
new revision: 1.11; previous revision: 1.10
Checking in storage/src/mozStorageService.h;
new revision: 1.5; previous revision: 1.4
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.