microsoft / microsoft/icu

Memory leak with ICU 72.1.0.2 (Windows 11 24H2)

Open
#152 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
67
Forks
57
PR merge metrics
No merged PRs in 30d

Description

Hello,

We have a memory leak with ICU 72.1.0.2 on Windows 11 24H2. This doesn't happen with ICU 68.2.0.10 on Windows 11 23H2.

Here are the steps in a gui program with a File / Save As command:

  • LoadLibrary('icuuc.dll')
  • Get the addresses of u_init, u_cleanup, and u_setMemoryFunctions
  • LoadLibrary ('icuin.dll'). This loads icu.dll too.
  • Get the addresses of ucol_open, ucol_close, ucol_strcoll, and ucol_setAttribute
  • Call u_setMemoryFunctions to set memory allocation functions
  • Call u_init. The memory allocation functions are called
  • Open a Save As dialog (GetSaveFileName, comdlg32.dll) and cancel
  • Call u_cleanup (). This doesn't release memory allocated by u_init
  • Call FreeLibray for icuin.dll. icu.dll is not unloaded and memory is not released
  • Note that at this step if you haven't called GetSaveFileName, icu.dll is unloaded and the memory is released
  • Call FreeLibrary for icuuc.dll. No change.

Regards,

Michel Terrisse

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Windows sequence in the issue with ICU 72.1.0.2: load icuuc.dll and icuin.dll, call u_setMemoryFunctions, u_init, open and cancel GetSaveFileName, then call u_cleanup and FreeLibrary. Compare the unload and memory behavior with ICU 68.2.0.10; done means the reported allocations are released after cleanup and DLL unloading.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.