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

Bug 195384

Summary: [launcher] Memory violation in Launcher when -vm is incorrect
Product: [Eclipse Project] Equinox Reporter: Daniel Weber <daniel.weber.dev>
Component: FrameworkAssignee: equinox.framework-inbox <equinox.framework-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: 3.4 M1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Bug Depends on:    
Bug Blocks: 196184    
Attachments:
Description Flags
Error message when using C:/WINNT
none
Error message when using C:/WINNT
none
Error message when using C:\WINNT none

Description Daniel Weber CLA 2007-07-04 10:17:17 EDT
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 Daniel Weber CLA 2007-07-04 10:19:14 EDT
Created attachment 73029 [details]
Error message when using C:/WINNT

I'm sorry it's in german, but I think the english dialog looks pretty much the same.
Comment 2 Daniel Weber CLA 2007-07-04 10:19:42 EDT
Created attachment 73030 [details]
Error message when using C:/WINNT

I'm sorry it's in german, but I think the english dialog looks pretty much the same.
Comment 3 Daniel Weber CLA 2007-07-04 10:20:27 EDT
Created attachment 73031 [details]
Error message when using C:\WINNT
Comment 4 Andrew Niefer CLA 2007-07-10 11:41:46 EDT
The crash is due to the use of forward slashes in the path.
It was also noted here: https://issues.apache.org/jira/browse/HARMONY-4006#action_12509061

I'm not sure about the failure to start when using forward slashes.  I suspect that C:\WINNT\jvm.dll is not a full jre in itself, it may be like C:\WINNT\java.exe and redirects to a jre installed elsewhere on the machine.
I'm not really sure what can be done if this is the case.  Should the launcher recognize that %SYSTEMROOT%\jvm.dll is not a jre?
Comment 5 Daniel Weber CLA 2007-07-11 02:22:48 EDT
The forward slashes may be one of the problems, but they work in principle. Using

  eclipsec.exe -vm D:/Programme/jdk1.6.0/bin
  
works without trouble. Slashes only make a difference if a jvm cannot be found. 

In my original example, I just wanted to use a directory which is likely to exist on other Windows machines. There is no jvm.dll in my WINNT directory. The launcher seems to treat the following three cases differently

 1) -vm D:/Programme ==> Crashes

 2) -vm D:\Programme ==> Seems to use D:\Programme\jvm.dll as fallback although it does not exists and then fails to start it
 
 3) -vm D:\  ==> "A JRE or JDK must be available..."
 
I'd expect 1) and 2) to behave in the same way that 3) does: Provide a helpful error message and quit.
Comment 6 Andrew Niefer CLA 2007-07-24 15:04:54 EDT
Done in HEAD, binaries will be recompiled for I20070731