Bug 185705 - java.lang.ArrayIndexOutOfBoundsException wmNotify
Summary: java.lang.ArrayIndexOutOfBoundsException wmNotify
Status: RESOLVED DUPLICATE of bug 142965
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows 2000
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-06 20:38 EDT by Ricky Ng-Adam CLA
Modified: 2008-04-10 17:37 EDT (History)
4 users (show)

See Also:


Attachments
log with bug reproduced multiple times (313.08 KB, application/octet-stream)
2007-05-06 20:39 EDT, Ricky Ng-Adam CLA
no flags Details
what the dialog looks like when locking up (52.17 KB, image/jpeg)
2007-05-12 11:07 EDT, Ricky Ng-Adam CLA
no flags Details
stack captured by debug (2.67 KB, text/plain)
2007-05-16 23:45 EDT, Ricky Ng-Adam CLA
no flags Details
changes that prevent the exception (969 bytes, text/plain)
2007-05-16 23:46 EDT, Ricky Ng-Adam CLA
no flags Details
pedump of what I think is the offending dll (9.10 KB, text/plain)
2007-05-16 23:46 EDT, Ricky Ng-Adam CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ricky Ng-Adam CLA 2007-05-06 20:38:28 EDT
Build ID: I20070503-1400

Steps To Reproduce:
1. Window > Preferences...
2. Java > Editor > Templates
3. Cancel

actual: dialog stops responding, unable to close window, have to force close Eclipse

expected: preferences dialog dismiss

More information:
Comment 1 Ricky Ng-Adam CLA 2007-05-06 20:39:55 EDT
Created attachment 66041 [details]
log with bug reproduced multiple times
Comment 2 Dani Megert CLA 2007-05-07 04:03:52 EDT
This works for me using I20070503-1400 using WindowsXP, Linux and MAC OS X. We don't have a Windows2000 machine.

Moving to SWT as it works on all other systems.

SWT, please also see similar bug 109376.
Comment 3 Steve Northover CLA 2007-05-11 08:24:06 EDT
Grant, can you try this on your 2000 machine?  If it crashes, we need to fix this for 3.3. RC1.
Comment 4 Grant Gayed CLA 2007-05-11 12:16:27 EDT
I don't see this problem on Win2000 SP4, using the same build.  Are there possibly more steps that are required  (eg.- your workspace may be in a different state)?  Does it happen for you if you switch to a new workspace and immediately do the steps?
Comment 5 Ricky Ng-Adam CLA 2007-05-12 11:04:54 EDT
Yes, even if I switch workspace it is reproducible.  I also have Windows 2k SP4. 

More details:

-There is no entries in the templates list
-Even if I switch to another preferences node in the tree the problems occurs in the tree when canceling.  However, if I don't access that particular tree node I can cancel the dialog correctly.
-Import... doesn't work; I can select a file but nothing is imported
-New... doesn't work; I can edit a new template when once saved it doesn't appear in the list

I also tried unsuccessfully to: 

-launch Eclipse with -clean
-with both Sun JRE 1.5.0_6 and JRE 1.6.0_1
-re-decompressing the archive
-use a different name for the workspace
-use workspace on different drives

Some possible differences between my setup and yours:

-my Windows 2000 is in French
-my Windows main drive is F:\ and not the usual C:\
-my screen resolution is 1920x1200
Comment 6 Ricky Ng-Adam CLA 2007-05-12 11:07:00 EDT
Created attachment 66972 [details]
what the dialog looks like when locking up
Comment 7 Ricky Ng-Adam CLA 2007-05-12 11:31:38 EDT
I cannot reproduce the problem on a different French Windows 2K, so that probably isn't related to the problem at hand.
Comment 8 Ricky Ng-Adam CLA 2007-05-12 22:17:44 EDT
After some further investigation, I've finally found what seems to be the source of the problem and it is rather surprising:

I have a Logitech MX518 Optical Mouse with multiple programmable buttons.  That mouse comes with a tray software called Logitech SetPoint (Control Center/Driver version 3.0.104 and also 3.1.116).  

If the program is active, Eclipse's Templates dialog crashes.  If the program is not active (right-click, exit on the tray icon), the dialog works correctly. 

I tried this many times in a row (exiting the SetPoint, restarting SetPoint) and the behavior is consistent.

What is the link between both?  I have no idea! But there it is...  This might be worth looking into since I'm having an hard time believing that this would be the only case where this can happen.

I've also tested with SetPoint 3.10 (latest version supported by W2K SP4 according to Logitech FAQ) with the same results.
Comment 9 Steve Northover CLA 2007-05-14 11:32:07 EDT
Since we can't create the problem, the best I can think of is getting you to run SWT from HEAD, debug/inspect/hack etc. until we can see what is going on.

See http://www.eclipse.org/swt/cvs.php
Comment 10 Ricky Ng-Adam CLA 2007-05-14 11:39:48 EDT
Ok, I'll look into that...  I'd be happy to go deeper than just reporting bugs for once ;-).

Just 2 questions:

1) when you say you haven't been able to reproduce, have you tried downloading and running the SetPoint software even if you don't have this particular mouse?  If not, I'll try that first on my second W2K computer tonight.

2) are we sure this is an SWT problem?  I wonder since there is no entries in the templates list.
Comment 11 Ricky Ng-Adam CLA 2007-05-14 19:08:59 EDT
I installed the SetPoint on the other w2k fr computer that doesn't have a mouse managed by SetPoint and I can still reproduce the behavior.

Also, if after Eclipse as started and I verify that the dialog works, I can immediately reproduce the bad behavior by starting SetPoint.

So:

-SetPoint stop, Eclipse start, templates = ok
-SetPoint started, Eclipse start, templates = bug
-SetPoint started, Eclipse start, SetPoint stop, templates = ok
-SetPoint stop, Eclipse start, SetPoint start, templates = bug
Comment 12 Steve Northover CLA 2007-05-15 18:49:24 EDT
Run Eclipse within Eclipse, make the problem happen, get the stack, paste it here.

If it really is a AIIOBE in Tree, hack Tree.java to catch AIIOBE's around where the thing is happening and put a break.  Have a look at the variables in the tree instance.  What is the size of the array?  What is the index?
Comment 13 Steve Northover CLA 2007-05-15 18:50:02 EDT
Did I say Tree?  I meant Table.
Comment 14 Dani Megert CLA 2007-05-16 02:28:28 EDT
>hack Tree.java to catch AIIOBE's around where
>the thing is happening and put a break.
No need to hack the code: simply add a Java exception breakpoint on AIIOBE (assuming they don't happen that often).
Comment 15 Ricky Ng-Adam CLA 2007-05-16 10:27:44 EDT
As suggested, I imported all the plugins from Eclipse 3.3 and ran a few debug sessions, looking at both Table swt widget and the org.eclipse.jdt.ui Java templates preference pages.  Everything a bit fuzzy, but I think the problem must be twofold; 

1) problem when taking the data and putting it inside the table
2) problem when the table is disposed

I see that the preferences objects are loaded in memory but it seems the table only creates the 4 default items.  My hypothesis is that the bug makes the items count incorrect and when the table is disposed the widget tries to access outside of that actual 0-3 index of those 4 default items.

I'm going to checkout the relevant two plugins from source so I can start trying a few things in the code.
Comment 16 Ricky Ng-Adam CLA 2007-05-16 23:44:55 EDT
More testing today...  

The exception occurs repeatedly when opening the dialog. 

I found out that if I added extra checks in Table I could prevent the exception by not trusting the itemCount (from `int itemCount = OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);`) in releaseChildren and Table._getItem. With these changes, I still get the empty table the first time but subsequent times it is filled with the correct data from the templates.

I've also looked at what SetPoint was doing.  The only DLL common between it and Eclipse is lgscroll.dll that is installed with SetPoint. It has methods "InstallScrollHooks" and "UninstallScrollHooks"; probable that those hooks are causing the problem?
Comment 17 Ricky Ng-Adam CLA 2007-05-16 23:45:41 EDT
Created attachment 67578 [details]
stack captured by debug
Comment 18 Ricky Ng-Adam CLA 2007-05-16 23:46:10 EDT
Created attachment 67579 [details]
changes that prevent the exception
Comment 19 Ricky Ng-Adam CLA 2007-05-16 23:46:33 EDT
Created attachment 67580 [details]
pedump of what I think is the offending dll
Comment 20 Steve Northover CLA 2007-05-23 19:43:07 EDT
Ricky, you've done a great job.  My guess is that SetPoint is installing a Windows system wide hook and that is causing trouble.

Let's look into the table getting disposed.  What does the operating system think that the item count is (ie. what does OS.LVM_GETITEMCOUNT return?).  What is the actual size and contents of the array at that point?

Note: We are late in the Eclipse 3.3 end game and we may be unable to get any more fixes in or be unable to spend the time debugging with you right now but please don't give up on us.  If this bug report goes inactive for a while, ping it.
Comment 21 Mike Wilson CLA 2008-04-10 14:37:06 EDT
Is this still happening? Is there a new version of the Logitech software? Is the Logitech software supposed to work on win2k? Should this be resolved as NOT_ECLIPSE?
Comment 22 Steve Northover CLA 2008-04-10 17:10:37 EDT
Grant to retest on his Windows 2000 box.
Comment 23 Grant Gayed CLA 2008-04-10 17:37:01 EDT
After installing SetPoint 3.10 on my win2000 I can reproduce this with eclipse 3.3 but it works with 3.4M6, so this is yet another manifestation of bug 142965.  Closing report as a duplicate.


*** This bug has been marked as a duplicate of bug 142965 ***