Skip to content

Access violation on shutdown after accessing MS Access via COM #1174

@andreas-wagner-ptv

Description

@andreas-wagner-ptv

Starting from October 6th, 2025, we experience access violations on shutdown in our application that uses mimalloc as well as calls via COM to Microsoft Access. Up to October 2nd, 2025, these crashes did not appear. We did not actively change anything, maybe it started with an automatic update of Microsoft Access.
If I set the environment variable MIMALLOC_DISABLE_REDIRECT=1, the application exits without crash.
I set the environment variable MIMALLOC_VERBOSE=1 to get more output, but the crash is independent of this.
Even with the crash, the access database is still created.

Mimalloc version is 2.2.3, but I tested that is also occurs with mimalloc 2.2.4 and with mimalloc 2.1.9.
The crash only occurs on our test machine, not on my local machine, which has the same OS and Microsoft Access version.

I created and attached a minimal example in AccessCrashMinimalExample.zip.

Exit code of the minimal example executable: -1073741819.

Exception text:

Unhandled exception at 0x00007FF845314853 (ntdll.dll) in AccessCrashMinimalExample.exe.10320.dmp: 0xC0000005: Access violation reading location 0x000005A261F50028.

Console output:

PS C:\dev\AccessCrashExample\x64\Release> .\AccessCrashMinimalExample.exe
mimalloc: process init: 0x2E51D3000
mimalloc: using 1 numa regions
mimalloc: v2.2.3, release (built on Nov  5 2025, 18:03:12)
mimalloc: option 'show_errors': 0
mimalloc: option 'show_stats': 0
mimalloc: option 'verbose': 1
mimalloc: option 'eager_commit': 1
mimalloc: option 'arena_eager_commit': 2
mimalloc: option 'purge_decommits': 1
mimalloc: option 'allow_large_os_pages': 0
mimalloc: option 'reserve_huge_os_pages': 0
mimalloc: option 'reserve_huge_os_pages_at': -1
mimalloc: option 'reserve_os_memory': 0 KiB
mimalloc: option 'deprecated_segment_cache': 0
mimalloc: option 'deprecated_page_reset': 0
mimalloc: option 'abandoned_page_purge': 0
mimalloc: option 'deprecated_segment_reset': 0
mimalloc: option 'eager_commit_delay': 1
mimalloc: option 'purge_delay': 10
mimalloc: option 'use_numa_nodes': 0
mimalloc: option 'disallow_os_alloc': 0
mimalloc: option 'os_tag': 100
mimalloc: option 'max_errors': 32
mimalloc: option 'max_warnings': 32
mimalloc: option 'max_segment_reclaim': 10
mimalloc: option 'destroy_on_exit': 0
mimalloc: option 'arena_reserve': 1048576 KiB
mimalloc: option 'arena_purge_mult': 10
mimalloc: option 'purge_extend_delay': 1
mimalloc: option 'abandoned_reclaim_on_free': 0
mimalloc: option 'disallow_arena_alloc': 0
mimalloc: option 'retry_on_oom': 400
mimalloc: option 'visit_abandoned': 0
mimalloc: option 'guarded_min': 0
mimalloc: option 'guarded_max': 1073741824
mimalloc: option 'guarded_precise': 0
mimalloc: option 'guarded_sample_rate': 0
mimalloc: option 'guarded_sample_seed': 0
mimalloc: option 'target_segments_per_thread': 0
mimalloc: option 'generic_collect': 10000
mimalloc: debug level : 0
mimalloc: secure level: 0
mimalloc: mem tracking: none
mimalloc: malloc is redirected.
mimalloc: reserved 1048576 KiB memory
PS C:\dev\AccessCrashExample\x64\Release> $LastExitCode
-1073741819
PS C:\dev\AccessCrashExample\x64\Release>

Call stack:

ntdll.dll!RtlpFreeHeap()
ntdll.dll!RtlpFreeHeapInternal()
ntdll.dll!RtlFreeHeap()
mso.dll!operator delete(void *)
mso.dll!`winrt::Microsoft::ReactNative::StructInfo<struct Mso::CopilotUI::Home::TellMeSearch::DocumentSearchResult>::GetFieldMap(void)'::`2'::`dynamic atexit destructor for 'fieldMap''(void)
ucrtbase.dll!<lambda>(void)()
ucrtbase.dll!__crt_seh_guarded_call<int>::operator()<<lambda_7777bce6b2f8c936911f934f8298dc43>,<lambda>(void) &,<lambda>(void)>()
ucrtbase.dll!_execute_onexit_table()
mso.dll!Win9xCheckDllSynchronization()
mso.dll!Win9xCheckDllSynchronization()
ntdll.dll!LdrpCallInitRoutine()
ntdll.dll!LdrShutdownProcess()
ntdll.dll!RtlExitUserProcess()
kernel32.dll!ExitProcessImplementation()
ucrtbase.dll!exit_or_terminate_process()
ucrtbase.dll!common_exit()
AccessCrashMinimalExample.exe!__scrt_common_main_seh() Line 295
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()

System info:

Compiler: MSVC v143 (v14.40)
OS: Microsoft Windows 11 Enterprise
Version: 10.0.22631 Build 22631
Microsoft Access 365 Version: Version 2510 Build 19328.20178
mimalloc version: v2.2.3

AccessCrashMinimalExample.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions