Repository: flutter
Issue: Windows FFI crash from __stdio_common_vsprintf in ucrtbased.dll
Labels: c: crash,platform-windows,a: desktop,has reproducible steps,P3,c: fatal crash,team-windows,triaged-windows,found in release: 3.24,found in release: 3.25

### Steps to reproduce

1. Run minigpu on Windows from https://github.com/MichealReed/minigpu
2. Click initialize once the app starts.
3. The app crashes.

This reproduces on stable and master.

### Expected results

The app should show the same output as wasm builds.

```
[info] Requesting adapter
[info] WGPURequestAdapterStatus_Success: 0
[info] WGPURequestAdapterStatus_Unavailable: 1
[info] Status: 0
[info] Requesting device
[info] Waiting for device request to end
[info] Device request ended
[info] Context destroyed
```

### Actual results

The app only shows the output via a console window when running it through the vs 2022 debugger. The flutter app hits a breakpoint at crashes with

```
Exception thrown at 0x00007FFE4BE1AC87 (ucrtbased.dll) in example.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.


```



### Code sample

All code can be found here, including a C++ test executable that builds to show initialize context is working without flutter.

https://github.com/MichealReed/minigpu/tree/master/minigpu_ffi/src

### Logs

<details open><summary>Logs</summary>

```console
 	ucrtbased.dll!00007ffea3b1ac87()	Unknown
 	ucrtbased.dll!00007ffea3b1b370()	Unknown
 	ucrtbased.dll!00007ffea3b1ab16()	Unknown
 	ucrtbased.dll!00007ffea3b1bf8d()	Unknown
 	ucrtbased.dll!00007ffea3a1f128()	Unknown
 	ucrtbased.dll!00007ffea3a1e242()	Unknown
 	ucrtbased.dll!00007ffea3afd4e2()	Unknown
 	ucrtbased.dll!00007ffea3af517f()	Unknown
 	ucrtbased.dll!00007ffea3ae1715()	Unknown
 	ucrtbased.dll!00007ffea3b09579()	Unknown
>	minigpu_ffi.dll!vsnprintf(char * const _Buffer, const unsigned __int64 _BufferCount, const char * const _Format, char * _ArgList) Line 1439	C++
 	minigpu_ffi.dll!snprintf(char * const _Buffer, const unsigned __int64 _BufferCount, const char * const _Format, ...) Line 1931	C++
 	minigpu_ffi.dll!gpu::LOG(gpu::Logger & logger, int level, const char * message, ...) Line 48	C++


```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel master, 3.11.0-6.0.pre.37, on Microsoft Windows [Version 10.0.22631.3880], locale en-US)
    • Flutter version 3.11.0-6.0.pre.37 on channel master at D:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision fa117aad28 (1 year, 3 months ago), 2023-05-11 10:28:08 -0700
    • Engine revision f38f46f66e
    • Dart version 3.1.0 (build 3.1.0-94.0.dev)
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.10.2)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.10.35004.147
    • Windows 10 SDK version 10.0.22621.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] VS Code (version 1.92.1)
    • VS Code at Local\Programs\Microsoft VS Code
    • Flutter extension version 3.94.0

[√] VS Code (version 1.93.0-insider)
    • VS Code at Local\Programs\Microsoft VS Code Insiders
    • Flutter extension version 3.95.20240801

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.3880]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 127.0.6533.120
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 127.0.2651.105

[√] Network resources
    • All expected network resources are available.
```

</details>