Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 196184 - [launcher] Memory violation in Launcher when -vm is incorrect
Summary: [launcher] Memory violation in Launcher when -vm is incorrect
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.3.1   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 195384
Blocks:
  Show dependency tree
 
Reported: 2007-07-11 12:05 EDT by Andrew Niefer CLA
Modified: 2007-07-18 11:09 EDT (History)
0 users

See Also:
tjwatson: review+


Attachments
patch (5.45 KB, patch)
2007-07-11 15:15 EDT, Andrew Niefer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Niefer CLA 2007-07-11 12:05:47 EDT
Cloned for consideration in 3.3.1

+++ This bug was initially created as a clone of Bug #195384 +++

When running "eclipsec.exe -vm C:/WINNT" (from a batch file, command line or via a shortcut; there is no difference), the launcher crashes with a memory violation (looks like a null pointer access), see 'crash-1.png'. 

When running "eclipsec.exe -vm C:\WINNT" (using a backslash), the launcher crashes, too. But this time with another error message (crash-2.png).

In both cases, the launcher can impossibly find a JVM in the given directory, so the initial error was mine. But it should catch this error and provide a proper error message. By the way, a helpful message (something like "..A JRE must be available in C:...") pops up when I run "eclipsec.exe -vm C:\".

I renamed eclipse.ini to make sure nothing there is causing the problem.

Using eclipse.exe instead of the console launcher produces the same errors.
Comment 1 Andrew Niefer CLA 2007-07-11 12:10:42 EDT
2 Problems here: 
1) Finding the shared library should return null instead of a nonexistant file.
2) On windows, the adjustSearchPath needs to handle '/' path separators in addition to the normal '\'.  (This can cause NPE with valid paths)
Comment 2 Andrew Niefer CLA 2007-07-11 15:15:26 EDT
Created attachment 73584 [details]
patch
Comment 3 Thomas Watson CLA 2007-07-12 10:44:57 EDT
Andrew and I think some restructuring could be done to separate some of the common code, but that can be done in 3.4.  This patch is good and the change is minimal for 3.3.x.
Comment 4 Andrew Niefer CLA 2007-07-16 14:45:31 EDT
done in 3.3.1
Comment 5 Thomas Watson CLA 2007-07-17 22:28:40 EDT
Andrew, why has this fix not been released to HEAD for bug 195384?
Comment 6 Andrew Niefer CLA 2007-07-18 11:09:06 EDT
I think I was going to try and refactor the code as per comment #3 to get a nicer fix