Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8028512

[macosx] Crash in full screen api if incorrect display mode is used

    XMLWordPrintable

Details

    • b119
    • Verified

    Description

      The code below crashed in macosx after the fix for JDK-8013581

      import java.awt.DisplayMode;
      import java.awt.GraphicsDevice;
      import java.awt.GraphicsEnvironment;
      import javax.swing.*;

      public final class test {

          public static void main(final String[] args) {
              JFrame frame = new JFrame();
              frame.setSize(500, 500);
              frame.setLocationRelativeTo(null);
              frame.setUndecorated(true);
              frame.setVisible(true);
              GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
              gd.setFullScreenWindow(frame);
              try{
                  gd.setDisplayMode(new DisplayMode(1, 1, 1, 1));
              } finally{
                  gd.setFullScreenWindow(null);
              }
          }
      }

      crash log:
      Current thread (0x00007fe72c0b8800): JavaThread "AppKit Thread" daemon [_thread_in_native, id=3847, stack(0x00007fff530f3000,0x00007fff538f3000)]

      Stack: [0x00007fff530f3000,0x00007fff538f3000], sp=0x00007fff538eea70, free space=8174k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.dylib+0x8a2094] VMError::report_and_die()+0x45e
      V [libjvm.dylib+0x2fe395] report_vm_error(char const*, int, char const*, char const*)+0x63
      V [libjvm.dylib+0x3e7d7b] Handle::Handle(Thread*, oop)+0x77
      V [libjvm.dylib+0x4d39ff] jni_FindClass+0x2ad
      C [JavaNativeFoundation+0x18e0] -[JNFException init:as:reason:]+0x30
      C [JavaNativeFoundation+0x15c8] +[JNFException raise:as:reason:]+0x44
      C [libawt_lwawt.dylib+0xb853] __Java_sun_lwawt_macosx_CPlatformWindow_nativeExitFullScreenMode_block_invoke_1+0x130
      C [JavaNativeFoundation+0x65f5] +[JNFRunLoop _performCopiedBlock:]+0x14
      C [Foundation+0x935ca] __NSThreadPerformPerform+0xe1
      C [CoreFoundation+0x12b31] __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__+0x11
      C [CoreFoundation+0x12455] __CFRunLoopDoSources0+0xf5
      C [CoreFoundation+0x357f5] __CFRunLoopRun+0x315
      C [CoreFoundation+0x350e2] CFRunLoopRunSpecific+0x122
      C [HIToolbox+0x5feb4] RunCurrentEventLoopInMode+0xd1
      C [HIToolbox+0x5fb94] ReceiveNextEventCommon+0xa6
      C [HIToolbox+0x5fae3] BlockUntilNextEventMatchingListInMode+0x3e
      C [AppKit+0x155533] _DPSNextEvent+0x2ad
      C [AppKit+0x154df2] -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]+0x80
      C [libosxapp.dylib+0x16c4] -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:]+0x7c
      C [AppKit+0x14c1a3] -[NSApplication run]+0x205
      C [libosxapp.dylib+0x14d8] +[NSApplicationAWT runAWTLoopWithApp:]+0x9c
      C [libawt_lwawt.dylib+0x46edf] -[AWTStarter starter:]+0x369
      C [Foundation+0x935ca] __NSThreadPerformPerform+0xe1
      C [CoreFoundation+0x12b31] __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__+0x11
      C [CoreFoundation+0x12455] __CFRunLoopDoSources0+0xf5
      C [CoreFoundation+0x357f5] __CFRunLoopRun+0x315
      C [CoreFoundation+0x350e2] CFRunLoopRunSpecific+0x122
      C [java+0x56ab] CreateExecutionEnvironment+0x367
      C [java+0x164c] JLI_Launch+0x7a0
      C [java+0x7669] main+0x65
      C [java+0xea4] start+0x34

      Attachments

        Issue Links

          Activity

            People

              serb Sergey Bylokhov
              serb Sergey Bylokhov
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: