Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jdk-17+35 crashes with JFileChooser on Win10 #385

Closed
WLenhard opened this issue Oct 26, 2021 · 10 comments
Closed

jdk-17+35 crashes with JFileChooser on Win10 #385

WLenhard opened this issue Oct 26, 2021 · 10 comments
Labels
bug Something isn't working jbs:reported Someone from our org has reported it to OpenJDK platform:32-bit Windows 32-bit Windows issues stale

Comments

@WLenhard
Copy link

WLenhard commented Oct 26, 2021

Summary

Invoking JFileChooser leads to crash outside the VM in case, FlatLaF is used as the look and feel.

Steps to reproduce

Minimal code to reproduce:

import javax.swing.JFileChooser;
import javax.swing.SwingUtilities;

import com.formdev.flatlaf.FlatLightLaf;

public class FileChooserTest {

	public static void main(String[] args) {
		
		FlatLightLaf.setup();
		
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				try {
					JFileChooser chooser = new JFileChooser();
					chooser.showSaveDialog(null);
					String file = chooser.getSelectedFile().getName();
					System.out.println(file);
				} catch (Exception e) {
					e.printStackTrace();
				}

			}
		});
	}
}

Expected results

Show JFileChooser

Actual results

"An unrecoverable stack overflow has occurred.
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_STACK_OVERFLOW (0xc00000fd) at pc=0x5e141119, pid=11772, tid=12752

JRE version: OpenJDK Runtime Environment Temurin-17+35 (17.0+35) (build 17+35)
Java VM: OpenJDK Client VM Temurin-17+35 (17+35, mixed mode, emulated-client, serial gc, windows-x86)
Problematic frame:
C [awt.dll+0xd1119]

No core dump will be written. Minidumps are not enabled by default on client versions of Windows

An error report file with more information is saved as:
... \hs_err_pid11772.log

If you would like to submit a bug report, please visit:
https://github.com/adoptium/adoptium-support/issues
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug."

Triaging info

Java version:
OpenJDK Client VM Temurin-17+35 (17+35, mixed mode, emulated-client, serial gc, windows-x86)

What is your operating system and platform?
Windows 10 Enterprise, 19042.1288

How did you install Java?
Installer from Adoptium (MSI)

Did it work before?
Yes. No problem with a jdk-16 or earlier.

Did you test with other Java versions?
Yes. OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (build 16.0.1+9) works fine

@WLenhard WLenhard added the bug Something isn't working label Oct 26, 2021
@karianna
Copy link
Contributor

@WLenhard
Copy link
Author

WLenhard commented Oct 26, 2021

Thanks, Karianna. I checked with the nightly build. The crash does not occur there. Seemingly, it is already solved. Best regards!

@WLenhard
Copy link
Author

WLenhard commented Oct 27, 2021

Ok, I did some further testing. The crash occurs in the 32Bit VM but not in the x64. Can't say, if it still occurs with the 32bit VM in the nightlies. I will check with the next official release.

@DevCharly
Copy link

It still crashes on Windows in 17.0.1 32bit.
Works in 16.0.2 32bit.

It is not related to FlatLaf. Occurs also in Windows L&F.
It is a bug in OpenJDK when accessing system icons for the file chooser.

There was a change in this area in JDK 17 to access "large Windows icons", which may be responsible for this crash.
See: https://bugs.openjdk.java.net/browse/JDK-8182043

Maybe this change was never tested on 32 Bit because Oracle distributes only 64 Bit JDKs?

Testcase:

import javax.swing.JFileChooser;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

public class FileChooserTest {
    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
        } catch( Exception ex ) {
            ex.printStackTrace();
        }

        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
                    JFileChooser chooser = new JFileChooser();
                    chooser.showSaveDialog(null);
                    String file = chooser.getSelectedFile().getName();
                    System.out.println(file);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }
}

@jerboaa jerboaa reopened this Nov 8, 2021
@jerboaa jerboaa added jbs:needs-report Waiting for someone from our org to report to OpenJDK and removed Waiting on OP labels Nov 8, 2021
@jerboaa
Copy link

jerboaa commented Nov 10, 2021

@karianna This might be a good item for your Microsoft friends to look into upstream :) 32-bit Windows issue.

@karianna
Copy link
Contributor

@karianna This might be a good item for your Microsoft friends to look into upstream :) 32-bit Windows issue.

Yes - we have David Grieve working on this internally :-)

@dsgrieve
Copy link

dsgrieve commented Nov 10, 2021

As a workaround, set the minimum thread stack size, e.g. -Xss1M

I believe the default should be 1M, but it appears to be 320K. Since this is set by the linker, this may just be a build issue.

See hotspot/os_cpu/windows_x86/globals_windows_x86.hpp

@jerboaa jerboaa added the platform:32-bit Windows 32-bit Windows issues label Nov 11, 2021
@dsgrieve
Copy link

@jerboaa jerboaa added jbs:reported Someone from our org has reported it to OpenJDK and removed jbs:needs-report Waiting for someone from our org to report to OpenJDK labels Nov 17, 2021
@github-actions
Copy link

github-actions bot commented May 4, 2022

We are marking this issue as stale because it has not been updated for a while. This is just a way to keep the support issues queue manageable.
It will be closed soon unless the stale label is removed by a committer, or a new comment is made.

@github-actions github-actions bot added the stale label May 4, 2022
@DevCharly
Copy link

I think this can be closed because JDK-8277299 is fixed in Java 18 and backported to Java 17.0.3

@jerboaa jerboaa closed this as completed May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jbs:reported Someone from our org has reported it to OpenJDK platform:32-bit Windows 32-bit Windows issues stale
Projects
None yet
Development

No branches or pull requests

5 participants