Re: RFR: 8284956: Potential leak awtImageData/color_data when initializes X11GraphicsEnvironment [v2]

2022-05-13 Thread Zhengyu Gu
On Wed, 27 Apr 2022 17:59:01 GMT, Phil Race wrote: >> Zhengyu Gu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Aleksey and Andrew's comments > > Marked as reviewed by prr (Reviewer). Thanks for

Integrated: 8284956: Potential leak awtImageData/color_data when initializes X11GraphicsEnvironment

2022-05-13 Thread Zhengyu Gu
On Wed, 20 Apr 2022 13:48:19 GMT, Zhengyu Gu wrote: > During initializing native data of `X11GraphicsEnvironment`, a single > `AwtGraphicsConfigData` is used/reused, not only failed cases, but also > succeeded cases. So `AwtGraphicsConfigData` internal states need to be > cleanup

Integrated: 8284680: sun.font.FontConfigManager.getFontConfig() leaks charset

2022-05-12 Thread Zhengyu Gu
On Mon, 11 Apr 2022 18:05:09 GMT, Zhengyu Gu wrote: > Please review this small patch that releases temporary charsets to avoid > memory leak. > > Test: > > - [x] jdk_2d This pull request has now been integrated. Changeset: dea6e886 Author:Zhengyu Gu

Re: RFR: 8284680: sun.font.FontConfigManager.getFontConfig() leaks charset [v3]

2022-05-12 Thread Zhengyu Gu
On Wed, 11 May 2022 16:54:28 GMT, Andrew John Hughes wrote: > Looks good to me. Hopefully we caught everything. Thanks @gnu-andrew. - PR: https://git.openjdk.java.net/jdk/pull/8187

Re: RFR: 8284680: sun.font.FontConfigManager.getFontConfig() leaks charset [v3]

2022-05-12 Thread Zhengyu Gu
On Mon, 9 May 2022 20:01:24 GMT, Phil Race wrote: >> Zhengyu Gu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Cleanup at early return > > Marked as reviewed by prr (Reviewer). Thanks @prrace for the rev

Re: RFR: 8284680: sun.font.FontConfigManager.getFontConfig() leaks charset

2022-05-09 Thread Zhengyu Gu
On Wed, 4 May 2022 01:39:49 GMT, Andrew John Hughes wrote: > > > > > > > > > Hmmm, you are right. Phil probably pointed out the same problem, but I > > misunderstood it. > > What's odd is that, I tested (made sure that `FcCharSetDestroy` indeed > > called), it did not crash and `valgrind` sh

Re: RFR: 8284680: sun.font.FontConfigManager.getFontConfig() leaks charset [v3]

2022-05-09 Thread Zhengyu Gu
> Please review this small patch that releases temporary charsets to avoid > memory leak. > > Test: > > - [x] jdk_2d Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision: Cleanup at early return - Chang

Re: RFR: 8284680: sun.font.FontConfigManager.getFontConfig() leaks charset [v2]

2022-04-29 Thread Zhengyu Gu
> Please review this small patch that releases temporary charsets to avoid > memory leak. > > Test: > > - [x] jdk_2d Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision: Andrew's comment -

Re: RFR: 8284680: sun.font.FontConfigManager.getFontConfig() leaks charset

2022-04-28 Thread Zhengyu Gu
On Mon, 11 Apr 2022 18:05:09 GMT, Zhengyu Gu wrote: > Please review this small patch that releases temporary charsets to avoid > memory leak. > > Test: > > - [x] jdk_2d > Hmmm, you are right. Phil probably pointed out the same problem, but I misunderstood it. What&#x

Re: RFR: 8284956: Potential leak awtImageData/color_data when initializes X11GraphicsEnvironment [v2]

2022-04-28 Thread Zhengyu Gu
On Thu, 28 Apr 2022 13:07:22 GMT, Aleksey Shipilev wrote: > What about `_ColorData::img_grays`, `_ColorData::awt_Colors`, > `_ColorData::img_oda_*`? `_ColorData::img_oda_*` are not malloc'd awt_data->color_data->img_oda_red = &(std_img_oda_red[0][0]); awt_data->color_data->img_oda_green =

Re: RFR: 8284956: Potential leak awtImageData/color_data when initializes X11GraphicsEnvironment [v2]

2022-04-28 Thread Zhengyu Gu
On Thu, 28 Apr 2022 13:14:07 GMT, Andrew John Hughes wrote: >> Zhengyu Gu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Aleksey and Andrew's comments > > I see `calloc` calls also for `img_grays`

Re: RFR: 8284956: Potential leak awtImageData/color_data when initializes X11GraphicsEnvironment [v2]

2022-04-28 Thread Zhengyu Gu
t: > - [x] jdk_awt Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision: Aleksey and Andrew's comments - Changes: - all: https://git.openjdk.java.net/jdk/pull/8317/files - new: https://git.openjdk.java.net/jdk/pull/831

RFR: 8284956: Potential leak awtImageData/color_data when initializes X11GraphicsEnvironment

2022-04-20 Thread Zhengyu Gu
During initializing native data of `X11GraphicsEnvironment`, a single `AwtGraphicsConfigData` is used/reused, not only failed cases, but also succeeded cases. So `AwtGraphicsConfigData` internal states need to be cleanup properly to avoid memory leaks. Test: - [x] jdk_awt - Commit

Re: RFR: 8284680: sun.font.FontConfigManager.getFontConfig() leaks charset

2022-04-18 Thread Zhengyu Gu
On Fri, 15 Apr 2022 18:43:27 GMT, Phil Race wrote: >> Please review this small patch that releases temporary charsets to avoid >> memory leak. >> >> Test: >> >> - [x] jdk_2d > > src/java.desktop/unix/native/common/awt/fontpath.c line 1112: > >> 1110: if (currentUnionSet !=

RFR: 8284680: sun.font.FontConfigManager.getFontConfig() leaks charset

2022-04-11 Thread Zhengyu Gu
Please review this small patch that releases temporary charsets to avoid memory leak. Test: - [x] jdk_2d - Commit messages: - v0 Changes: https://git.openjdk.java.net/jdk/pull/8187/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8187&range=00 Issue: https://bugs.op

Integrated: 8284093: Memory leak: X11SD_DisposeXImage should also free obdata

2022-04-11 Thread Zhengyu Gu
On Thu, 31 Mar 2022 13:30:40 GMT, Zhengyu Gu wrote: > Please review this small patch to fix leaking `XShmSegmentInfo` that is > attached to `XImage`. > > Test: > > - [x] jdk_2d This pull request has now been integrated. Changeset: 205cfb84 Author:Zhengyu Gu

Re: RFR: 8284093: Memory leak: X11SD_DisposeXImage should also free obdata

2022-04-11 Thread Zhengyu Gu
On Mon, 11 Apr 2022 13:26:03 GMT, Mario Torre wrote: >> Please review this small patch to fix leaking `XShmSegmentInfo` that is >> attached to `XImage`. >> >> Test: >> >> - [x] jdk_2d > > I'm not officially a reviewer but afaik there isn't any other place where the > obdata is freed, and X11

Re: RFR: 8284093: Memory leak: X11SD_DisposeXImage should also free obdata

2022-04-08 Thread Zhengyu Gu
On Thu, 31 Mar 2022 13:30:40 GMT, Zhengyu Gu wrote: > Please review this small patch to fix leaking `XShmSegmentInfo` that is > attached to `XImage`. > > Test: > > - [x] jdk_2d Friendly ping! May I have a second review? Thanks - PR: https://git.openjdk.java.net/jdk/pull/8060

Integrated: 8284023: java.sun.awt.X11GraphicsDevice.getDoubleBufferVisuals() leaks XdbeScreenVisualInfo

2022-04-06 Thread Zhengyu Gu
On Wed, 30 Mar 2022 19:13:24 GMT, Zhengyu Gu wrote: > Please review this small patch that fixes memory leak of > `XdbeScreenVisualInfo` obtained from `XdbeGetVisualInfo()` method call. > > Test: > - [x] jdk_awt This pull request has now been integrated. Changeset: ec205f68 Aut

Re: RFR: 8284023: java.sun.awt.X11GraphicsDevice.getDoubleBufferVisuals() leaks XdbeScreenVisualInfo [v2]

2022-04-06 Thread Zhengyu Gu
On Wed, 6 Apr 2022 05:20:34 GMT, Sergey Bylokhov wrote: >> Zhengyu Gu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @mrserb's comment > > Marked as reviewed by serb (Reviewer). Thanks

RFR: 8284023: java.sun.awt.X11GraphicsDevice.getDoubleBufferVisuals() leaks XdbeScreenVisualInfo

2022-03-30 Thread Zhengyu Gu
Please review this small patch that fixes memory leak of `XdbeScreenVisualInfo` obtained from `XdbeGetVisualInfo()` method call. Test: - [x] jdk_awt - Commit messages: - 8284023: java.sun.awt.X11GraphicsDevice.getDoubleBufferVisuals() leaks XdbeScreenVisualInfo Changes: https://g

Integrated: 8283217: Leak FcObjectSet in getFontConfigLocations() in fontpath.c

2022-03-21 Thread Zhengyu Gu
On Tue, 15 Mar 2022 19:26:19 GMT, Zhengyu Gu wrote: > Please review this small patch to fix leaking of `FcObjectSet` in > `getFontConfigLocations()` > > > Test: > - [x] jdk_2d This pull request has now been integrated. Changeset: 909986c7 Author:Zhengyu Gu

Re: RFR: 8283217: Leak FcObjectSet in getFontConfigLocations() in fontpath.c [v2]

2022-03-21 Thread Zhengyu Gu
On Thu, 17 Mar 2022 20:46:57 GMT, Phil Race wrote: >> Zhengyu Gu has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains two addi

Re: RFR: 8283217: Leak FcObjectSet in getFontConfigLocations() in fontpath.c [v2]

2022-03-18 Thread Zhengyu Gu
On Wed, 16 Mar 2022 01:05:19 GMT, Zhengyu Gu wrote: >> Please review this small patch to fix leaking of `FcObjectSet` in >> `getFontConfigLocations()` >> >> >> Test: >> - [x] jdk_2d > > Zhengyu Gu has updated the pull request with a new targ

Re: RFR: 8283217: Leak FcObjectSet in getFontConfigLocations() in fontpath.c [v2]

2022-03-15 Thread Zhengyu Gu
> Please review this small patch to fix leaking of `FcObjectSet` in > `getFontConfigLocations()` > > > Test: > - [x] jdk_2d Zhengyu Gu has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes

RFR: 8283217: Leak FcObjectSet in getFontConfigLocations() in fontpath.c

2022-03-15 Thread Zhengyu Gu
Please review this small patch to fix leaking of `FcObjectSet` in `getFontConfigLocations()` Test: - [x] jdk_2d - Commit messages: - v0 Changes: https://git.openjdk.java.net/jdk/pull/7826/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7826&range=00 Issue: https:

Integrated: 8282978: Wrong parameter passed to GetStringXXXChars in various places

2022-03-11 Thread Zhengyu Gu
On Thu, 10 Mar 2022 21:12:46 GMT, Zhengyu Gu wrote: > Another trivial cleanup to fix the last parameter of `GetStringXXXChars` > calls, should be a `jboolean*` instead of a `jboolean`. This pull request has now been integrated. Changeset: 0fd09d38 Author:Zhengyu Gu URL:

Re: RFR: 8282978: Wrong parameter passed to GetStringXXXChars in various places

2022-03-11 Thread Zhengyu Gu
On Fri, 11 Mar 2022 10:33:29 GMT, Alan Bateman wrote: >> Another trivial cleanup to fix the last parameter of `GetStringXXXChars` >> calls, should be a `jboolean*` instead of a `jboolean`. > > The changes to the usages in src/java.base look okay. Thanks, @AlanBateman @dfuch - PR:

RFR: 8282978: Wrong parameter passed to GetStringXXXChars in various places

2022-03-10 Thread Zhengyu Gu
Another trivial cleanup to fix the last parameter of `GetStringXXXChars` calls, should be a `jboolean*` instead of a `jboolean`. - Commit messages: - Fix - 8282978: Wrong parameter passed to GetStringXXXChars in various places Changes: https://git.openjdk.java.net/jdk/pull/7779/fi

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-09 Thread Zhengyu Gu
On Wed, 9 Mar 2022 09:38:51 GMT, Alexey Ivanov wrote: > > You're right. The old icon handles in `hOldIcon` and `hOldIconSm` will be > > leaked here if `CreateIconFromRaster` throws an exception. > > I've submitted > [JDK-8282862](https://bugs.openjdk.java.net/browse/JDK-8282862): > AwtWindow:

Integrated: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig()

2022-03-09 Thread Zhengyu Gu
On Fri, 4 Mar 2022 13:25:12 GMT, Zhengyu Gu wrote: > Please review this small patch that fixes a potential memory leak that > exception return fails to release allocated `cacheDirs` > > Test: > > - [x] jdk_desktop on Linux x86_64 This pull request has now been inte

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-09 Thread Zhengyu Gu
On Wed, 9 Mar 2022 06:53:29 GMT, Thomas Stuefe wrote: >> Zhengyu Gu has updated the pull request incrementally with one additional >> commit since the last revision: >> >> mrserb and aivanov-jdk's comments > > Still looks good to me. Thanks for th

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Zhengyu Gu
On Tue, 8 Mar 2022 21:05:13 GMT, Alexey Ivanov wrote: >> I think `NewStringUTF()` can throw OOM and also return `NULL`, just which >> one you pick. > >> I think `NewStringUTF()` can throw OOM and also return `NULL`, just which >> one you pick. > > Yes. > > But we're discussing whether a check

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Zhengyu Gu
On Tue, 8 Mar 2022 20:57:27 GMT, Alexey Ivanov wrote: >>> ??? You want to check and cleanup if NewStringUTF fails. You only want to >>> call SetObjectElementArray if NewStringUTF succeeds. >> >> If the SetObjectArrayElement will throw an exception we will call the >> NewStringUTF while the exc

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Zhengyu Gu
On Tue, 8 Mar 2022 15:58:57 GMT, Alexey Ivanov wrote: > > I did a quick grep, there are a few suspicious spots, e.g. > > [https://github.com/openjdk/jdk/blob/master/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp#L2711](url), > > I have yet take a close look. > > It doesn't leak

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]

2022-03-08 Thread Zhengyu Gu
> Please review this small patch that fixes a potential memory leak that > exception return fails to release allocated `cacheDirs` > > Test: > > - [x] jdk_desktop on Linux x86_64 Zhengyu Gu has updated the pull request incrementally with one additional commit since

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig()

2022-03-08 Thread Zhengyu Gu
On Fri, 4 Mar 2022 13:25:12 GMT, Zhengyu Gu wrote: > Please review this small patch that fixes a potential memory leak that > exception return fails to release allocated `cacheDirs` > > Test: > > - [x] jdk_desktop on Linux x86_64 > > > The macros are used to h

Re: RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig()

2022-03-04 Thread Zhengyu Gu
On Fri, 4 Mar 2022 21:30:53 GMT, David Holmes wrote: > I would have just inlined JNU_CHECK_EXCEPTION and added the cleanup code > directly. The additional macro wasn't really necessary and would not really > be usable for any kind of general cleanup actions beyond a one-liner. > > But it is ok

RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig()

2022-03-04 Thread Zhengyu Gu
Please review this small patch that fixes a potential memory leak that exception return fails to release allocated `cacheDirs` Test: - [x] jdk_desktop on Linux x86_64 - Commit messages: - 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() Changes: https: