The default bug view has changed. See this FAQ.

When copyCurrentSelectionToSystemClipboard() method is invoked and no URL is loaded, then JVM crashes

VERIFIED FIXED

Status

Core Graveyard
Java APIs to WebShell
P3
critical
VERIFIED FIXED
17 years ago
5 years ago

People

(Reporter: Oleg Khokhlov, Assigned: Ashu Kulkarni)

Tracking

({crash})

Trunk
x86
Windows NT
crash

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
When copyCurrentSelectionToSystemClipboard() method is invoked and no URL is 
loaded, then JVM crashes :

###!!! ASSERTION: You can't dereference a NULL nsCOMPtr with operator->
().: 'mRawPtr != 0', file ..\..\..\dist\include\nsCOMPtr.h, line 625
#
# HotSpot Virtual Machine Error, EXCEPTION_ACCESS_VIOLATION
#
# Error ID: 4F533F57494E13120E43505002B7
#
	
abnormal program termination

Build Date & Platform:
Mozilla M16, Webclient source from July,7; WinNT 4.0 with SP4

Comment 1

17 years ago
Adding crash keyword.
Keywords: crash

Comment 2

17 years ago
Ashu
Assignee: edburns → ashuk
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 3

17 years ago
The nsIContentViewerEdit component is absent when no URL is loaded. Was fixed
easily by checking if this is null before making calls to SelectAll or
CopySelectionToClipboard.

Will check in changes on Monday, since the office is unusable today and I dont
have CVS on my home PC.

_Ashu
Status: NEW → ASSIGNED
(Assignee)

Comment 4

17 years ago
Created attachment 11830 [details] [diff] [review]
diffs in CurrentPageIMpl.cpp and jni_util.h
(Assignee)

Comment 5

17 years ago
Checked in Fix. Pls see attachment for patch. Code checks for ContentViewer to 
be non-null before issuing CopyCurrentSelectionToSystemClipboard call
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
(Reporter)

Updated

17 years ago
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Reporter)

Comment 6

17 years ago
JVM still crashes.

Possible solution:

in string "rv = initContext->docShell->GetContentViewer(&contentViewer);" method 
GetContentViewer(&contentViewer) always returns NS_OK and rv is always 0.
So we need to check contentViewer value not rv.
We need to change string  "if (NS_FAILED(rv)) {" with string "if 
(contentViewer==nsnull) {".

I tested it and it works. Thanks.
(Assignee)

Updated

17 years ago
Status: REOPENED → ASSIGNED
(Assignee)

Comment 7

17 years ago
Checked in fix suggested by Oleg. Tested it and confirmed that it works fine.
thanks Oleg.

cvs diff CurrentPageImpl.cpp (in directory D:\M16
\mozilla\java\webclient\src_moz)
Index: CurrentPageImpl.cpp
===================================================================
RCS file: /cvsroot/mozilla/java/webclient/src_moz/CurrentPageImpl.cpp,v
retrieving revision 1.9
diff -r1.9 CurrentPageImpl.cpp
74c74
<     if (NS_FAILED(rv))  {
---
>     if (NS_FAILED(rv) || contentViewer==nsnull )  {
339c339
<         if (NS_FAILED(rv))  {
---
>         if (NS_FAILED(rv) || contentViewer==nsnull)  {

*****CVS exited normally with code 1*****

_Ashu
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → FIXED
(Reporter)

Comment 8

16 years ago
I mark it as verified.
Status: RESOLVED → VERIFIED
Component: Java APIs to WebShell → Java APIs to WebShell
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.