Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312432

Summary: [Widgets] crash due to invalid memory access when typing in search box
Product: [Eclipse Project] Platform Reporter: Lakshmi P Shanmugam <lshanmug>
Component: SWTAssignee: Lakshmi P Shanmugam <lshanmug>
Status: CLOSED WONTFIX QA Contact: Silenio Quarti <Silenio_Quarti>
Severity: normal    
Priority: P3 CC: lshanmug, Silenio_Quarti, skovatch
Version: 3.6   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
crash log none

Description Lakshmi P Shanmugam CLA 2010-05-11 10:19:06 EDT
Created attachment 167929 [details]
crash log

Happens on Carbon with latest build and OSX 10.6.
Couldn't reproduce it on OSX 10.5

Steps to reproduce:
1) Open the run configuration dialog.
2) Create an eclipse application.
3) select the plugins tab
4) select launch with 'plugins selected below only' in the combo box
5) In the search box (for type filter text) start typing the name of any plugin.
For me, it crashes when I type the 2nd character.
I can reproduce it consistently.
Comment 1 Scott Kovatch CLA 2010-05-11 13:08:32 EDT
I see this, too, with basically the same stack trace. I'll have to find another Carbon app with a search field to see if it's an OS bug.
Comment 2 Scott Kovatch CLA 2010-05-11 13:16:09 EDT
ControlExample doesn't crash, FWIW.
Comment 3 Scott Kovatch CLA 2010-05-11 14:22:55 EDT
Seems to be limited to just this dialog. I can use a filter in the Install Updates dialog with no problems.
Comment 4 Scott Kovatch CLA 2010-05-11 15:00:25 EDT
It seems to be related to the fact that the search field is initially disabled when the window appears. When you select 'plugins selected below only', that enables the search field. When you click on the search field, notice that the caret doesn't appear right away. You have to click it a second time, and then the flashing insertion point appears. At that point you can start typing.
Comment 5 Lakshmi P Shanmugam CLA 2010-05-12 09:08:48 EDT
happens on 10.5 too.
Comment 6 Lakshmi P Shanmugam CLA 2010-05-12 10:13:22 EDT
I can reproduce it with a SWT snippet. When Text.setText is called in mouse down listener, the caret doesn't appear. Typing now into the textbox leads to crash.

public class Bug_312432 {
	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setLayout(new GridLayout(1, false));
		
		final Text text = new Text(shell, SWT.SINGLE | SWT.BORDER);
		text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
		text.setText("type text here");
		text.addMouseListener( new MouseAdapter() {
			public void mouseDown(MouseEvent e) {
				System.out.println("mouse down");
				text.setText("");
			};
			public void mouseUp(MouseEvent e) {
				System.out.println("mouse up");
//				text.setText("");
			};
		});
		shell.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}
Comment 7 Lakshmi P Shanmugam CLA 2012-06-21 02:30:28 EDT
Doesn't happen on cocoa, its carbon only.
Closing report, platform is discontinued.