Closed
Bug 334556
Opened 19 years ago
Closed 19 years ago
crash on startup when GTK accessibility pref enabled
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: dbaron, Assigned: aaronlev)
References
Details
(Keywords: access, fixed1.8.1)
Attachments
(4 files, 1 obsolete file)
2.34 KB,
text/plain; charset=UTF-8
|
Details | |
2.24 KB,
patch
|
aaronlev
:
review-
|
Details | Diff | Splinter Review |
2.52 KB,
patch
|
ginnchen+exoracle
:
review+
|
Details | Diff | Splinter Review |
2.24 KB,
patch
|
aaronlev
:
review+
dbaron
:
superreview+
ginnchen+exoracle
:
approval-branch-1.8.1+
|
Details | Diff | Splinter Review |
I crash on startup when the GTK accessibility pref is enabled because the root accessible object is destroyed within its own constructor, at the stack to be attached. This is in a trunk build from within the past few hours.
I suspect this is a regression from bug 333134 -- specifically the change to nsDocAccessible.cpp. However, that change is correct -- you just need more of the same. It's against the rules in Mozilla code to pass an object around from its own constructor, for two reasons:
* you crash if something AddRefs and Releases it, since the reference count goes from 0 to 1 to 0 again
* not all the vtable pointers are initialized, so strange things can happen (destructors have the same problem). This is what confused the leak logging and caused the appearance of a negative leak that I'm guessing you were fixing in bug 333134's changes to nsDocAccessible.cpp.
I can see backing out that change temporarily to fix this, but in the long term you want to move forward by not passing |this| around from constructors or destructors.
Reporter | ||
Comment 1•19 years ago
|
||
Assignee | ||
Updated•19 years ago
|
Blocks: fox2access
Assignee | ||
Comment 2•19 years ago
|
||
I'm not getting the crash myself, but this might fix the problem. David, want to test it?
Assignee | ||
Updated•19 years ago
|
Attachment #218923 -
Flags: review?(ginn.chen)
Comment on attachment 218923 [details] [diff] [review]
Untested
It solved the crash, but firefox is not accessible. In at-poke, no accessible window under firefox application.
Backing out accessible/src/base/nsDocAccessible.cpp can solve this bug.
Attachment #218923 -
Flags: review?(ginn.chen) → review-
Attachment #218923 -
Attachment is obsolete: true
Attachment #218956 -
Flags: review?(aaronleventhal)
Assignee | ||
Comment 5•19 years ago
|
||
Comment on attachment 218956 [details] [diff] [review]
patch v2
Oh I forget the upcall, good catch. Very close.
Attachment #218956 -
Flags: review?(aaronleventhal) → review-
Assignee | ||
Comment 6•19 years ago
|
||
Attachment #218967 -
Flags: review?(ginn.chen)
Assignee | ||
Comment 7•19 years ago
|
||
I had accidentally posted this comment to bug 331120:
The only place in the constructor chain for nsRootAccessible that we pass
|this| around is here:
http://lxr.mozilla.org/seamonkey/source/accessible/src/atk/nsRootAccessibleWrap.cpp#49
Ginn, I think we need to move that into nsRootAccessibleWrap::Init()
While we're at it the code in the destructor needs to be moved to the
Shutdown() method. Most things should happen in Shutdown() not in the
destructor because we're guaranteed that Shutdown() will be called when a DOM
Node is no longer needed. Unfortunately the refcount might not be 0 because a
poorly behaving accessibility user might not release when we want them to.
Looks like we'll have to go through the mozilla/accessible/atk and ensure
proper use of Init() and Shutdown() instead of constructor and destructor code.
Comment on attachment 218967 [details] [diff] [review]
Upcall for nsRootAccessible::Init() & Shutdown()
r=me
please don't change
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+N/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
and we don't use rv so we don't need rv
+ nsresult rv = nsRootAccessible::Init();
Attachment #218967 -
Flags: review?(ginn.chen) → review+
Assignee | ||
Comment 9•19 years ago
|
||
Attachment #218970 -
Flags: superreview?(dbaron)
Assignee | ||
Updated•19 years ago
|
Attachment #218970 -
Flags: superreview?(dbaron)
Assignee | ||
Comment 10•19 years ago
|
||
Comment on attachment 218970 [details] [diff] [review]
Don't forget to return rv
Ginn, does this build for you?
Attachment #218970 -
Flags: review?(ginn.chen)
Assignee | ||
Comment 11•19 years ago
|
||
Comment on attachment 218970 [details] [diff] [review]
Don't forget to return rv
Verified that it builds and works.
Attachment #218970 -
Flags: superreview?(dbaron)
Attachment #218970 -
Flags: review?(ginn.chen)
Attachment #218970 -
Flags: review+
Reporter | ||
Updated•19 years ago
|
Attachment #218970 -
Flags: superreview?(dbaron) → superreview+
Reporter | ||
Comment 12•19 years ago
|
||
FWIW, bug 331120 comment 7 was meant for this bug.
Comment 13•19 years ago
|
||
Checking in src/atk/nsRootAccessibleWrap.cpp;
/cvsroot/mozilla/accessible/src/atk/nsRootAccessibleWrap.cpp,v <-- nsRootAccessibleWrap.cpp
new revision: 1.8; previous revision: 1.7
done
Checking in src/atk/nsRootAccessibleWrap.h;
/cvsroot/mozilla/accessible/src/atk/nsRootAccessibleWrap.h,v <-- nsRootAccessibleWrap.h
new revision: 1.8; previous revision: 1.7
done
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Attachment #218970 -
Flags: approval-branch-1.8.1+
Keywords: access,
fixed1.8.1
Assignee | ||
Comment 14•19 years ago
|
||
Comment on attachment 218970 [details] [diff] [review]
Don't forget to return rv
This has to go in at the same time as its sister, bug 333134.
Attachment #218970 -
Flags: approval1.8.0.3?
Comment 15•19 years ago
|
||
Comment on attachment 218970 [details] [diff] [review]
Don't forget to return rv
approved for 1.8.0 branch, a=dveditz for drivers
Attachment #218970 -
Flags: approval1.8.0.3? → approval1.8.0.3+
Reporter | ||
Comment 16•19 years ago
|
||
It seems safer to me to skip this, and the part of the other patch that caused it, for 1.8.0.3.
Assignee | ||
Comment 17•19 years ago
|
||
Comment on attachment 218970 [details] [diff] [review]
Don't forget to return rv
Removing approval since for now we're deciding not to check this in, on dbaron's advice.
Attachment #218970 -
Flags: approval1.8.0.4+
You need to log in
before you can comment on or make changes to this bug.
Description
•