oneTBB: Application using scalable allocator crashes on Windows 11 when opening a file dialog

A minimal program was created to reproduce the issue. The program opens a file dialog using GetOpenFileName.

On Windows 10, the program runs successfully both with and without the TBB scalable allocator.

On Windows 11, the program crashes when the scalable allocator is used. The crash occurs right after the file dialog displays. The application runs successfully with the scalable allocator removed.

The TBB allocator was enabled using the linker option:

tbbmalloc_proxy.lib /INCLUDE:"__TBB_malloc_proxy"

The code:

#include <windows.h>
#include <Commdlg.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{

    OPENFILENAME ofn;
    char szFile[500];
    ZeroMemory(&ofn, sizeof(ofn));
    ofn.lStructSize = sizeof(ofn);
    ofn.hwndOwner = NULL;
    ofn.lpstrFile = szFile;
    ofn.lpstrFile[0] = '\0';
    ofn.nMaxFile = sizeof(szFile);
    ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
    ofn.nFilterIndex = 1;
    ofn.lpstrFileTitle = NULL;
    ofn.nMaxFileTitle = 0;
    ofn.lpstrInitialDir = NULL;
    ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
    GetOpenFileName(&ofn);

    MessageBox(NULL, ofn.lpstrFile, "File Name", MB_OK);
    return 0;
}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

@myoung301, we are able to reproduce the issue with your steps and got same call stack. Analysis is in progress.