Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 98087 - EXCEPTION_ACCESS_VIOLATION by Combo with READ_ONLY
Summary: EXCEPTION_ACCESS_VIOLATION by Combo with READ_ONLY
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1 RC3   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 74162 74757 98409 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-06-02 08:14 EDT by Michael Henninghaus CLA
Modified: 2005-06-17 11:52 EDT (History)
4 users (show)

See Also:


Attachments
PID-Log (17.90 KB, application/octet-stream)
2005-06-02 08:22 EDT, Michael Henninghaus CLA
no flags Details
hs_err_pid4928.log (10.01 KB, application/octet-stream)
2005-06-16 01:44 EDT, Michael Henninghaus CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Henninghaus CLA 2005-06-02 08:14:17 EDT
I use a Combo-Widget in my code with the attribute READ_ONLY (combo = new
Combo(parent, SWT.READ_ONLY);)

When I select this Combo and close it by selecting another Widget the following
error occures:

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x77d3baf7, pid=5572, tid=3964
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-b64 mixed mode, sharing)
# Problematic frame:
# C  [USER32.dll+0x2baf7]
#
# An error report file with more information is saved as hs_err_pid5572.log
#
Comment 1 Michael Henninghaus CLA 2005-06-02 08:22:30 EDT
Created attachment 22219 [details]
PID-Log
Comment 2 Michael Henninghaus CLA 2005-06-02 09:26:28 EDT
Additional Comments:
This happens only if the control will be disposed by a FocusLost Event.

When control looses focus, a Method called acceptValueFromControl will be invoked.
After running through its algorithm the following code will be accessed:

     if (control != null) {
         control.dispose();
         control = null;
      }

The last location i can get to with my debugger is in Dialog.java in Method
windowProc the following line:

return control.windowProc(hwnd, msg, wParam, lParam);


I hope this will help, i can´t understand where the problem is.
With style SWT.NONE everything works fine !  
Comment 3 Michael Henninghaus CLA 2005-06-02 09:33:45 EDT
Second additional comment:

In successfullCase (SWT.NONE) the next method appering in debugger is 
/** Ansi/Unicode wrappers */

public static final int CallWindowProc (int lpPrevWndFunc, int hWnd, int Msg,
int wParam, int lParam) {
	if (IsUnicode) return CallWindowProcW (lpPrevWndFunc, hWnd, Msg, wParam, lParam);
	return CallWindowProcA (lpPrevWndFunc, hWnd, Msg, wParam, lParam);
}

in OS.java.

Comment 4 Veronika Irvine CLA 2005-06-14 12:59:28 EDT
*** Bug 98409 has been marked as a duplicate of this bug. ***
Comment 5 Veronika Irvine CLA 2005-06-14 13:00:43 EDT
Bug 98409 has a simple example showing the problem.
Comment 6 Steve Northover CLA 2005-06-15 16:43:58 EDT
This code WORKSFORME on XP.  Does it fail for you?

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;

public class PR_98087 {
public static void main (String [] args) {
	final Display display = new Display ();
	final Shell shell = new Shell (display);
	shell.setLayout (new FillLayout ());
	final Combo combo = new Combo (shell, SWT.READ_ONLY);
	combo.addListener (SWT.FocusOut, new Listener () {
		public void handleEvent (Event event) {
			combo.dispose ();
		}
	});
	new Button (shell, SWT.PUSH);
	shell.pack ();
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
}
Comment 7 Marco Maccaferri CLA 2005-06-15 16:57:55 EDT
(In reply to comment #6)

> This code WORKSFORME on XP.  Does it fail for you?

Your code fails for me, on XP SP1 and swt 3136.

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x77D31C8B
Function=LockWindowUpdate+0x1A45
Library=C:\WINDOWS\system32\USER32.dll

Current Java thread:
	at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1574)
	at org.eclipse.swt.widgets.Combo.callWindowProc(Combo.java:276)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3123)
[...]
Comment 8 Billy Biggs CLA 2005-06-15 18:32:02 EDT
Strange, works for me on XP SP1, SWT 3137.
Comment 9 Michael Henninghaus CLA 2005-06-16 01:43:06 EDT
Yes, your code fails for me, to (Using 3137, XP SP2)!
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x77d3baf7, pid=4928, tid=3884
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-b64 mixed mode, sharing)
# Problematic frame:
# C  [USER32.dll+0x2baf7]
#
# An error report file with more information is saved as hs_err_pid4928.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Comment 10 Michael Henninghaus CLA 2005-06-16 01:44:15 EDT
Created attachment 23269 [details]
hs_err_pid4928.log
Comment 11 Marco Maccaferri CLA 2005-06-16 09:57:58 EDT
(In reply to comment #8)
> Strange, works for me on XP SP1, SWT 3137.

Updated to SWT 3137 from RC2, same result.
Downloaded the nighly build N20050616-0010 but no changes.
Same environment, JRE 1.4.1_02.
Comment 12 Michael Henninghaus CLA 2005-06-16 10:00:59 EDT
I´m Using Java 5, but thats not a hint, or ?
Comment 13 Steve Northover CLA 2005-06-16 10:39:16 EDT
I can make this happen now by not running with the XP manifest.
Comment 14 Marco Maccaferri CLA 2005-06-16 11:00:38 EDT
(In reply to comment #13)
> I can make this happen now by not running with the XP manifest.

Yes, adding the manifest file has fixed the problem for me.
Comment 15 Steve Northover CLA 2005-06-16 11:47:01 EDT
McQ, can we fix this for RC3?
Comment 16 Steve Northover CLA 2005-06-16 11:48:56 EDT
*** Bug 74162 has been marked as a duplicate of this bug. ***
Comment 17 Steve Northover CLA 2005-06-16 11:54:59 EDT
Fixed > 20050616

McQ said "yes".
Comment 18 Steve Northover CLA 2005-06-16 11:56:42 EDT
Now it's fixed.
Comment 19 Steve Northover CLA 2005-06-16 12:06:35 EDT
*** Bug 74757 has been marked as a duplicate of this bug. ***
Comment 20 Michael Henninghaus CLA 2005-06-17 01:31:28 EDT
Sorry for my question:
Which manifest file ??
Comment 21 Steve Northover CLA 2005-06-17 11:52:52 EDT
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-
home/faq.html#xpthemes