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

Potential leak awtImageData/color_data when initializes X11GraphicsEnvironment

    XMLWordPrintable

Details

    • b23
    • linux

    Backports

      Description

        valgrind caught following leak:

        ==2108002== 560 bytes in 1 blocks are definitely lost in loss record 8,986 of 9,705
        ==2108002== at 0x4849464: calloc (vg_replace_malloc.c:1328)
        ==2108002== by 0x4656BA8E: awt_allocate_colors (X11Color.c:339)
        ==2108002== by 0x4656D223: awtCreateX11Colormap (X11Color.c:1265)
        ==2108002== by 0x4657B38E: findWithTemplate (awt_GraphicsEnv.c:169)
        ==2108002== by 0x4657B56C: makeDefaultConfig (awt_GraphicsEnv.c:248)
        ==2108002== by 0x4657C7F0: Java_sun_awt_X11GraphicsEnvironment_initNativeData (awt_GraphicsEnv.c:705)
        ==2108002== by 0x168065D0: ???

        The leak originates from the loop in findWithTemplate(), where it may call awtCreateX11Colormap() multiple times to calloc awtImageData without freeing/reusing the existing ones.

        AwtGraphicsConfigData.color_data has the same pattern, even it did not show in the leak profile.
         

        Attachments

          Issue Links

            Activity

              People

                zgu Zhengyu Gu
                zgu Zhengyu Gu
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: