Closed Bug 592144 Opened 10 years ago Closed 10 years ago

Incubator Embedding: ConsoleListener crashes [@ MozView::GetListener] when tries to access already destroyed owner

Categories

(Core Graveyard :: Embedding: APIs, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tatiana, Assigned: tatiana)

Details

Attachments

(3 files, 1 obsolete file)

crash can be reproduced with same steps as in bug #590546, 
but we need to have at least 2 MozViews as in attached test app

output of my debugging prints:

nsresult TermEmbedding():296
virtual MozView::~MozView():305
5672168:5672176
1989200
0
nsresult TermEmbedding():296
virtual MozView::~MozView():305
6594048:6594056
5620320
0
nsresult TermEmbedding():296
nsresult TermEmbedding():300
virtual nsresult ConsoleListener::Observe(nsIConsoleMessage*):56
MozViewListener* MozView::GetListener():501
6594048:0
6594048:0
virtual nsresult ConsoleListener::Observe(nsIConsoleMessage*):56
MozViewListener* MozView::GetListener():501
5672168:7148976
5672168:-301964187
virtual nsresult ConsoleListener::Observe(nsIConsoleMessage*):61
Segmentation fault (core dumped)


i.e after MozView 5672168 is already destroyed, it's ConsoleListener still tries to GetListener from this MozView
Attached file backtrace
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → tanya.meshkova
Status: NEW → ASSIGNED
Attachment #470647 - Flags: review?(mark.finkle)
Attachment #470647 - Flags: feedback?(romaxa)
The patch starts coupling the code a bit too tightly. I'd like it better if we found a way to avoid the friend class and setting the data member to null.

We could just add a Detach method or something and call it, instead of using "friend" and accessing the data member.

If we found a way to detach with the nsIConsoleListener, that would be better, but I don't mind using nsCOMPtr<ConsoleListener>
Attachment #470647 - Attachment is obsolete: true
Attachment #471313 - Flags: review?(mark.finkle)
Attachment #471313 - Flags: feedback?(romaxa)
Attachment #470647 - Flags: review?(mark.finkle)
Attachment #470647 - Flags: feedback?(romaxa)
Attachment #471313 - Flags: feedback?(romaxa)
Attachment #471313 - Flags: review?(mark.finkle) → review+
http://hg.mozilla.org/incubator/embedding/rev/29ac0fe51754
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.