From: SourceForge.net <no...@so...> - 2010-08-06 23:55:44
|
Bugs item #2872447, was opened at 2009-10-04 03:10 Message generated for change (Comment added) made by dagger2 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=928231&aid=2872447&group_id=189165 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Behavior Group: v2.3 Status: Open Resolution: Fixed Priority: 5 Private: No Submitted By: Mitch Mitchell (mitchmitchell) Assigned to: Thomas Holland (innot) Summary: getWinAVRBasePath throws exception on Vista 64 Initial Comment: Whenever getWinAVRBasePath is called on my Windows Vista 64 system, I get the exception below. Creating an AVR project, trying to modify the paths under the AVR plugin etc. I think this is because the WinAVR registry key is not in HKML\Software\WinAVR but rather under HKML\Software\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\WinAVR java.lang.NullPointerException at de.innot.avreclipse.core.paths.win32.SystemPathsWin32.getWinAVRBasePath(SystemPathsWin32.java:112) at de.innot.avreclipse.core.paths.win32.SystemPathsWin32.getWinAVRPath(SystemPathsWin32.java:89) at de.innot.avreclipse.core.paths.win32.SystemPathsWin32.getSystemPath(SystemPathsWin32.java:64) at de.innot.avreclipse.core.paths.SystemPathHelper.getPath(SystemPathHelper.java:102) at de.innot.avreclipse.core.paths.AVRPathProvider.getPath(AVRPathProvider.java:63) at de.innot.avreclipse.core.toolinfo.AVRDude.getToolPath(AVRDude.java:152) at de.innot.avreclipse.core.toolinfo.AVRDude.loadProgrammersList(AVRDude.java:666) at de.innot.avreclipse.core.toolinfo.AVRDude.getProgrammersList(AVRDude.java:212) at de.innot.avreclipse.ui.preferences.AVRDudeConfigEditor.<init>(AVRDudeConfigEditor.java:137) at de.innot.avreclipse.ui.preferences.ProgConfigListFieldEditor.editButtonAction(ProgConfigListFieldEditor.java:468) at de.innot.avreclipse.ui.preferences.ProgConfigListFieldEditor.access$7(ProgConfigListFieldEditor.java:434) at de.innot.avreclipse.ui.preferences.ProgConfigListFieldEditor$4.widgetSelected(ProgConfigListFieldEditor.java:376) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:211) at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311) ---------------------------------------------------------------------- Comment By: A. Dewhurst (dagger2) Date: 2010-08-06 23:55 Message: Confirming that path detection works for me. ---------------------------------------------------------------------- Comment By: Thomas Holland (innot) Date: 2010-08-06 23:07 Message: Good, here is the fix: http://avr-eclipse.sourceforge.net/previews/avreclipse-p2-repository-2.3.4.20100807INT.zip If it does work for you I will release this as the final 2.3.4 tomorrow. ---------------------------------------------------------------------- Comment By: A. Dewhurst (dagger2) Date: 2010-08-06 22:28 Message: Good call: $ reg query "HKLM\Software\Wow6432Node\WinAVR" /s | hexdump -C ... 00000020 77 36 34 33 32 4e 6f 64 65 5c 57 69 6e 41 56 52 |w6432Node\WinAVR| 00000030 0d 0a 20 20 20 20 32 30 31 30 30 31 31 30 20 20 |.. 20100110 | 00000040 20 20 52 45 47 5f 53 5a 20 20 20 20 43 3a 5c 42 | REG_SZ C:\B| 00000050 75 69 6c 64 5c 57 69 6e 41 56 52 0d 0a 0d 0a |uild\WinAVR....| ---------------------------------------------------------------------- Comment By: Thomas Holland (innot) Date: 2010-08-06 22:16 Message: As it is hard to see on this webpage, so could you confirm that the output of C:\> reg query "HKLM\Software\Wow6432Node\WinAVR" /s is separated by spaces instead of tabs. Probably the best way to check this is by redirecting the output to a file ' >query.txt' and opening that in a text editor. On my System (WinXP/32bit) the output from 'reg query' has tabs between "20100110", "REG_SZ" and "C:\...", but splitting the string by tabs failed on your machine and caused the "ArrayIndexOutOfBoundsException". So I think that maybe the output is now separated by four spaces instead of tabs. ---------------------------------------------------------------------- Comment By: A. Dewhurst (dagger2) Date: 2010-08-06 21:45 Message: That works (as in, lets me specify the paths manually). C:\>reg query "HKLM\Software\WinAVR" /s & reg query "HKLM\Software\Wow6432Node\WinAVR" /s ERROR: The system was unable to find the specified registry key or value. HKEY_LOCAL_MACHINE\Software\Wow6432Node\WinAVR 20100110 REG_SZ C:\Build\WinAVR (This is on XP 64-bit.) ---------------------------------------------------------------------- Comment By: Thomas Holland (innot) Date: 2010-08-06 18:38 Message: OK, I'am about to give up... ... and upgrade to Window 7 64bit :-) (have this planned anyway for some time now) In the meantime I fixed the ArrayIndexOutOfBoundsException. Could you please try the version at: http://avr-eclipse.sourceforge.net/previews/avreclipse-p2-repository-2.3.4.20100806INT.zip This version probably won't find the paths automatically, but hopefully won't throw Exceptions either. Also, could you execute the following line from a command line and send me the output: reg query "HKLM\Software\WinAVR" /s and reg query "HKLM\Software\Wow6432Node\WinAVR" /s ---------------------------------------------------------------------- Comment By: A. Dewhurst (dagger2) Date: 2010-08-02 13:31 Message: It's still broken, now with java.lang.ArrayIndexOutOfBoundsException: 1 at de.innot.avreclipse.core.paths.win32.MyWindowsRegistry.executeKeyValueCommand(MyWindowsRegistry.java:269) at de.innot.avreclipse.core.paths.win32.MyWindowsRegistry.getKeyName(MyWindowsRegistry.java:204) at de.innot.avreclipse.core.paths.win32.SystemPathsWin32.getWinAVRBasePath(SystemPathsWin32.java:126) at de.innot.avreclipse.core.paths.win32.SystemPathsWin32.getWinAVRPath(SystemPathsWin32.java:92) at de.innot.avreclipse.core.paths.win32.SystemPathsWin32.getSystemPath(SystemPathsWin32.java:63) at de.innot.avreclipse.core.paths.SystemPathHelper.getPath(SystemPathHelper.java:102) Perhaps it should just fail on 64-bit systems? It looks like the problem is that CDT is broken on 64-bit, but this will get fixed at some point. As far as I'm aware, the only time you access registry keys is to fetch the path to WinAVR, and I already know what the path is (I had to pick it during the installation, after all). I'd be happy if it just failed nicely so I could supply it manually. ---------------------------------------------------------------------- Comment By: Thomas Holland (innot) Date: 2010-07-27 12:45 Message: I have once again tried to fix this problem. Before making a full release (which will be 2.3.4) I have uploaded a test version to: http://avr-eclipse.sourceforge.net/previews/avreclipse-p2-repository-2.3.4.20100727betaNGT.zip If anybody still monitoring this tracker item could please give it a try and see if the autodetection of paths now works on a 64bit Windows system. Your feedback would be appreciated. Thomas ---------------------------------------------------------------------- Comment By: Thomas Holland (innot) Date: 2010-07-22 20:32 Message: (Copied from Support Request 3031058) I thought I had this fixed (with 2.3.2), but I noticed that I never fully finished the fix. As I don't have a 64bit Windows I didn't test the fix before releasing it. I try to fix the bug over the weekend. In the meantime you could try the following workarounds: 1. Set the flag "Disable search for system paths at startup" on the AVR -> Paths preference page and manually set the paths. 2. If you can't set the flag due to NullPointerExceptions you could try to hack this flag. With Eclipse *not* running edit the file '{Workspace}\.metadata\.plugins\org.eclipse.core.runtime\.settings\de.innot.avreclipse.core.prefs' and add/edit the following line: 'avrpaths/NoScanAtStartup=true' Once you have done this you can restart Eclipse and again set the paths manually in the preferences. I have just tested this and it seems that with the workaround the offending code does not get called. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2009-10-14 02:28 Message: A simple failure mode that would allow me to manually enter the path to WinAVR would be all that is needed --- right now, the dialog to enter it gets the exception and nothing can be entered in the path field. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2009-10-14 02:26 Message: I am using Galileo on both machines. On the 32bit machine is Build id: 20090920-1017 Here is a copy of the exception on the 32bit machine -- I got to this one through a different path, but it is still in getWinAVRBasePath java.lang.NullPointerException at de.innot.avreclipse.core.paths.win32.SystemPathsWin32.getWinAVRBasePath(SystemPathsWin32.java:112) at de.innot.avreclipse.core.paths.win32.SystemPathsWin32.getWinAVRPath(SystemPathsWin32.java:89) at de.innot.avreclipse.core.paths.win32.SystemPathsWin32.getSystemPath(SystemPathsWin32.java:60) at de.innot.avreclipse.core.paths.SystemPathHelper.getPath(SystemPathHelper.java:102) at de.innot.avreclipse.core.preferences.AVRPathsPreferences$1.run(AVRPathsPreferences.java:168) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) ---------------------------------------------------------------------- Comment By: Thomas Holland (innot) Date: 2009-10-13 22:56 Message: BTW what Eclipse version do you use? ---------------------------------------------------------------------- Comment By: Thomas Holland (innot) Date: 2009-10-13 22:55 Message: I have started to work on this Bug and the obvious culprit is not the AVR Plugin but the WindowRegistry Class from CDT. There is already a bug report that this class is not working on 64bit Windows. https://bugs.eclipse.org/bugs/show_bug.cgi?id=236330 To fix the Problem I will need to check the return value of WindowsRegistry.getRegistry() and if it is Null then either fail gracefully or try some other method of getting access to the registry. I have just contacted the author of the above mentioned bug report to see if I can use his patch as a fallback when getRegistry() fails. Why it also fails on your 32 bit XP I have currently no idea. Can you confirm that it is the same NullPointerException or maybe something other Exception? ---------------------------------------------------------------------- Comment By: Mitch Mitchell (mitchmitchell) Date: 2009-10-04 05:52 Message: I have now confirmed that this exception is also thrown on my 32bit Windows XP machine so the difference in the registry data is not the cause of the null pointer exception ---------------------------------------------------------------------- Comment By: Thomas Holland (innot) Date: 2009-10-04 05:11 Message: Thanks for the detailed description. I will fix this in the next release. ---------------------------------------------------------------------- Comment By: Mitch Mitchell (mitchmitchell) Date: 2009-10-04 03:12 Message: Should have read as HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\WinAVR Also under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Free Software Foundation\WinAVR-20090313 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=928231&aid=2872447&group_id=189165 |