Skip to content

crash when running with Address Sanitizer on #10670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jpribele opened this issue Mar 29, 2025 · 1 comment
Open

crash when running with Address Sanitizer on #10670

jpribele opened this issue Mar 29, 2025 · 1 comment
Labels
Investigate Requires further investigation by the WPF team. 📭 waiting-author-feedback To request more information from author.

Comments

@jpribele
Copy link

jpribele commented Mar 29, 2025

Description

This is a bit of shot in the dark. We getting this crash when using are application with and address sanitizer turned on.

- =================================================================
- ==11160==ERROR: AddressSanitizer: unknown-crash on address 0x7ff8362de130 at pc 0x7ff839a93d49 bp 0x00b5dbe7ed00 sp 0x00b5dbe7e4d0
- READ of size 8 at 0x7ff8362de130 thread T11
- ==11160==*** WARNING: Failed to initialize DbgHelp!              ***
- ==11160==*** Most likely this means that the app is already      ***
- ==11160==*** using DbgHelp, possibly with incompatible flags.    ***
- ==11160==*** Due to technical reasons, symbolization might crash ***
- ==11160==*** or produce wrong results.                           ***
-     #0 0x7ff839a93d48 in _asan_wrap_GlobalUnlock+0xb8 (clang_rt.asan_dynamic-x86_64.dll+0x180043d48)
-     #1 0x7ff836158740 in RenderOptions_EnableHardwareAccelerationInRdp+0x568c0 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x180058740)
-     #2 0x7ff83615f1b5 in RenderOptions_EnableHardwareAccelerationInRdp+0x5d335 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x18005f1b5)
-     #3 0x7ff83615e46f in RenderOptions_EnableHardwareAccelerationInRdp+0x5c5ef (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x18005e46f)
-     #4 0x7ff83615549d in RenderOptions_EnableHardwareAccelerationInRdp+0x5361d (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x18005549d)
-     #5 0x7ff836154bf6 in RenderOptions_EnableHardwareAccelerationInRdp+0x52d76 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x180054bf6)
-     #6 0x7ff8361547d2 in RenderOptions_EnableHardwareAccelerationInRdp+0x52952 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800547d2)
-     #7 0x7ff836153e5e in RenderOptions_EnableHardwareAccelerationInRdp+0x51fde (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x180053e5e)
-     #8 0x7ff83623f85c in MilUtility_ArcToBezier+0xaf4c (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x18013f85c)
-     #9 0x7ff83622cec8 in InteropDeviceBitmap_GetAsSoftwareBitmap+0x19c8 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x18012cec8)
-     #10 0x7ff83622ccc4 in InteropDeviceBitmap_GetAsSoftwareBitmap+0x17c4 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x18012ccc4)
-     #11 0x7ff83621983c in MILCreateFactory+0x9bc (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x18011983c)
-     #12 0x7ff83620787f in MilContent_DetachFromHwnd+0x5750f (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x18010787f)
-     #13 0x7ff836206a6f in MilContent_DetachFromHwnd+0x566ff (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x180106a6f)
-     #14 0x7ff83620529e in MilContent_DetachFromHwnd+0x54f2e (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x18010529e)
-     #15 0x7ff8361f45b7 in MilContent_DetachFromHwnd+0x44247 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800f45b7)
-     #16 0x7ff8361f4428 in MilContent_DetachFromHwnd+0x440b8 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800f4428)
-     #17 0x7ff8361f4539 in MilContent_DetachFromHwnd+0x441c9 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800f4539)
-     #18 0x7ff8361b130d in MilContent_DetachFromHwnd+0xf9d (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800b130d)
-     #19 0x7ff8361b148e in MilContent_DetachFromHwnd+0x111e (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800b148e)
-     #20 0x7ff8361b11a2 in MilContent_DetachFromHwnd+0xe32 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800b11a2)
-     #21 0x7ff839aa4d2e in _asan_default_suppressions__dll+0x130e (clang_rt.asan_dynamic-x86_64.dll+0x180054d2e)
-     #22 0x7ff8a9c17373 in BaseThreadInitThunk+0x13 (C:\Windows\System32\KERNEL32.DLL+0x180017373)
-     #23 0x7ff8aba9cc90 in RtlUserThreadStart+0x20 (C:\Windows\SYSTEM32\ntdll.dll+0x18004cc90)
- 
- Address 0x7ff8362de130 is a wild pointer inside of access range of size 0x000000000008.
- SUMMARY: AddressSanitizer: unknown-crash (clang_rt.asan_dynamic-x86_64.dll+0x180043d48) in _asan_wrap_GlobalUnlock+0xb8
- Shadow bytes around the buggy address:
-   0x11fb1c95bbd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bbe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bbf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- =>0x11fb1c95bc20: 00 00 00 00 00 00[00]00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- Shadow byte legend (one shadow byte represents 8 application bytes):
-   Addressable:           00
-   Partially addressable: 01 02 03 04 05 06 07
-   Heap left redzone:       fa
-   Freed heap region:       fd
-   Stack left redzone:      f1
-   Stack mid redzone:       f2
-   Stack right redzone:     f3
-   Stack after return:      f5
-   Stack use after scope:   f8
-   Global redzone:          f9
-   Global init order:       f6
-   Poisoned by user:        f7
-   Container overflow:      fc
-   Array cookie:            ac
-   Intra object redzone:    bb
-   ASan internal:           fe
-   Left alloca redzone:     ca
-   Right alloca redzone:    cb
- Thread T11 created by T7 here:
-     #0 0x7ff839aa6b37 in _asan_wrap_CreateThread+0x77 (clang_rt.asan_dynamic-x86_64.dll+0x180056b37)
-     #1 0x7ff8361b128d in MilContent_DetachFromHwnd+0xf1d (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800b128d)
-     #2 0x7ff8361b0881 in MilContent_DetachFromHwnd+0x511 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800b0881)
-     #3 0x7ff8361b112e in MilContent_DetachFromHwnd+0xdbe (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800b112e)
-     #4 0x7ff8361b072d in MilContent_DetachFromHwnd+0x3bd (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800b072d)
-     #5 0x7ff8361b054d in MilContent_DetachFromHwnd+0x1dd (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800b054d)
-     #6 0x7ff8361b00d7 in MILRelease+0x181d7 (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\wpfgfx_cor3.dll+0x1800b00d7)
-     #7 0x7ff83d96a144  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\PresentationCore.dll+0x1802fa144)
-     #8 0x7ff83d92a9e0  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\PresentationCore.dll+0x1802ba9e0)
-     #9 0x7ff83d92c100  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\PresentationCore.dll+0x1802bc100)
-     #10 0x7ff83d991a52  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\PresentationCore.dll+0x180321a52)
-     #11 0x7ff83d99a49c  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\PresentationCore.dll+0x18032a49c)
-     #12 0x7ff83e8b505e  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\PresentationFramework.dll+0x18068505e)
-     #13 0x7ff83df07db3  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\System.Xaml.dll+0x180067db3)
-     #14 0x7ff83df11e8d  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\System.Xaml.dll+0x180071e8d)
-     #15 0x7ff83dee2046  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\System.Xaml.dll+0x180042046)
-     #16 0x7ff83dee03eb  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\System.Xaml.dll+0x1800403eb)
-     #17 0x7ff83dededd8  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\System.Xaml.dll+0x18003edd8)
-     #18 0x7ff83e6afb12  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\PresentationFramework.dll+0x18047fb12)
-     #19 0x7ff83e6af5fc  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\PresentationFramework.dll+0x18047f5fc)
-     #20 0x7ff83e6af365  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\PresentationFramework.dll+0x18047f365)
-     #21 0x7ff83e6b5275  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\PresentationFramework.dll+0x180485275)
-     #22 0x7ff83e535fcf  (D:\packages\DotNetSdk\8.0.303_21038920\installed\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.7\PresentationFramework.dll+0x180305fcf)
-     #23 0x7ff7e7c76d9f  (<unknown module>)```

### Reproduction Steps

No real repro steps. 

### Expected behavior

No crash

### Actual behavior

not crash

### Regression?

no idea if it is a regression or not

### Known Workarounds

_No response_

### Impact

_No response_

### Configuration

_No response_

### Other information

_No response_
@lindexi
Copy link
Member

lindexi commented Mar 31, 2025

@jpribele

It seens be crash in

void WINAPI
RenderOptions_EnableHardwareAccelerationInRdp(BOOL fEnable)
{
RenderOptions::EnableHardwareAccelerationInRdp(fEnable);
}

But which just set the field:

void
RenderOptions::EnableHardwareAccelerationInRdp(BOOL fEnable)
{
CGuard<CCriticalSection> guard(m_cs);
m_fHwAccelerationInRdpEnabled = !!fEnable;
}

How about disable the feature by :

        public App()
        {
            AppContext.SetSwitch("Switch.System.Windows.Media.EnableHardwareAccelerationInRdp", false);
        }

Emmm, I do not believe EnableHardwareAccelerationInRdp can cause this crash. And I do not know the follow info means:

- Address 0x7ff8362de130 is a wild pointer inside of access range of size 0x000000000008.
- SUMMARY: AddressSanitizer: unknown-crash (clang_rt.asan_dynamic-x86_64.dll+0x180043d48) in _asan_wrap_GlobalUnlock+0xb8
- Shadow bytes around the buggy address:
-   0x11fb1c95bbd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bbe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bbf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- =>0x11fb1c95bc20: 00 00 00 00 00 00[00]00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-   0x11fb1c95bc60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Could you send the dump file? @jpribele

@siagupta0202 siagupta0202 added 📭 waiting-author-feedback To request more information from author. Investigate Requires further investigation by the WPF team. labels Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team. 📭 waiting-author-feedback To request more information from author.
Projects
None yet
Development

No branches or pull requests

3 participants