JDK-4854196 : -Xss does not work on Win32 causing Java application to crash(Stack Overflow)
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.4.1_02
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-04-25
  • Updated: 2003-05-07
  • Resolved: 2003-05-07
Related Reports
Duplicate :  
Description
Customer Problem Description:
--------------------------------

I am using 3rd party software (Jintegra) to embed MS graphical activeX controls into java swing components.  My problem is that some operations on this embedded activeX control causes the java process to crash. Testcase attached:

 Here goes:
 
1)       activeX.zip contains ViewerActiveX50.exe which will install the activeX control on your system(s).
2)    jintegra_dlls.zip contains dlls that must be added to a directory on your machine's system path.
3)       java_sources.zip contains all the source files you'll need to run a simple test program illustrating the bug.  The main class is Test.java.  You will need to add "jintegra.jar" to your classpath in order to compile and run Test.java.
 
Now here are the steps to reproduce the bug:
1)       Run the java program.
2)       Right click on the activeX control.
3)       Select File --> Import From...
4)       Import "TRna.pdb", which I have attached
5)       Right click on the activeX control.
6)       Select Edit --> Select All
7)       Right click on the activeX control.
8)       Select Edit --> Copy
9)       The program will crash.
 
###@###.### 2003-05-01

comments from JIntegra:

-Xss does not work as it should on Win32 in scenarios related to 
only calling native code as shown in the attached testcase.
(Java code calls into a native DLL)

This results in a java stack overflow problem

Comments
WORK AROUND There is a workaround but it requires modifying java.exe. A dll has no control over stack size, it is the process loading the dll that does (java.exe) - so modifying the DLL makes no difference. so, it was java.exe that was the cause - it was being built with a default stack size (per thread) of 1 MB which is not enough for big molecules. FYI, through my experimentation, -Xss parameter is pretty much useless and ignored by Windows. The only way was to modify java.exe - go figure! Steps to take: 1. You need Visual Studio 6 on your machine, or at least the EDITBIN.EXE tool that is included with it. 2. In your JDK1.3.1\bin directory: editbin.exe /STACK:2000000 java.exe will increase it to 2MB.
11-06-2004

EVALUATION I'm going to guess that this is a issue with the ActiveX Bridge. At least, that is probably the best place to start looking. ###@###.### 2003-04-25 The bug is reported against Jintegra ActiveX control, which is a third party product. We need to get additional information from the users if the bug is really in the AWT/Swing. Lower priority to P3. ###@###.### 2003-04-29 Tried to run the test case with 1.4.2 but failed because the sun/awt/DrawingSurface no longer exists in 1.4.1 and 1.4.2; it only exists in 1.3.1. Can the submitter clarify whether the customer is using 1.3.1 jre? BTW, there's no activex bridge support in 1.4.1 based jre. ActiveX bridge is being re-introduced in 1.4.2. I'm currently asking AWT team on what's the equivalent class to sun/awt/DrawingSurface in 1.4.x. ###@###.### 2003-04-30 When the problem happens, the call-stack from VC shows that there's a deep call stack within the application's MdmDataModel50.dll. I'm attaching the top portion of the call stack (see call_stack.txt). Is it possible to get a debug version of MdmDataModel50.dll so that we have more understanding what the apps. is trying to do when the problem happens? ###@###.### 2003-05-01 The suggested workaround is basically the same as building java.exe with the /STACK=2000000 linker option. There were a few bugs filed for this issue. On windows, the -Xss option won't change the stack size for the main thread. Bug 4689767 gives a very good summary on the status of this issue on various platforms: Solaris, Linux, Windows. There's a fix available on Linux - see bug 4678676. ###@###.### 2003-05-02
02-05-2003