RFR: JDK-8320405: [Windows Server 2016] java/awt/image/MultiResolutionImage/MultiResolutionImageObserverTest.java shows issues in awt_Win32GraphicsDevice.cpp [v2]

Matthias Baesken mbaesken at openjdk.org
Thu Jan 4 14:42:14 UTC 2024


> When running with fastdebug binaries we run intermittent into the issue below in
> jtreg test java/awt/image/MultiResolutionImage/MultiResolutionImageObserverTest.java .
> Seems we miss checking of successful HBITMAP creation before calling GetDIBits.
> 
>   HDC hBMDC = this->GetDC();
>   HBITMAP hBM = ::CreateCompatibleBitmap(hBMDC, 1, 1);
>   VERIFY(::GetDIBits(hBMDC, hBM, 0, 1, NULL, gpBitmapInfo, DIB_RGB_COLORS));
> 
> in awt_Win32GraphicsDevice.cpp . Thats why the releast of hBMDC / hBM fails as well at the end of the function causing the seond and third warning.
> 
> 
> Sat Nov 18 17:29:23 CET 2023
> 
> *********************
> AWT Assertion Failure
> *********************
> ::GetDIBits(hBMDC, hBM, 0, 1, 0, gpBitmapInfo, 0)
> File 'e:\openjdk\openjdk-21u-windows_x86_64-dbg\jdk\src\java.desktop\windows\native\libawt\windows\awt_Win32GraphicsDevice.cpp', at line 184
> GetLastError() is 57 : The parameter is incorrect.
> 
> Do you want to break into the debugger?
> *********************
> *********************
> AWT Assertion Failure
> *********************
> ::DeleteObject(hBM)
> File 'e:\openjdk\openjdk-21u-windows_x86_64-dbg\jdk\src\java.desktop\windows\native\libawt\windows\awt_Win32GraphicsDevice.cpp', at line 297
> GetLastError() is 57 : The parameter is incorrect.
> 
> So it seems, we should have some additional checks/tracing.

Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:

  handle return value of other GetDIBits call, adjust if checks

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/17197/files
  - new: https://git.openjdk.org/jdk/pull/17197/files/cfc9088e..2e0d83f1

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=17197&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17197&range=00-01

  Stats: 8 lines in 1 file changed: 4 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/17197.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17197/head:pull/17197

PR: https://git.openjdk.org/jdk/pull/17197


More information about the client-libs-dev mailing list