You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ASan new-delete-type-mismatch in stress-http (HTTP 3.0) #130031
==9==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x74dfbf086270 in thread T20:
object passed to delete has wrong type:
size of the allocated type: 24 bytes;
size of the deallocated type: 16 bytes.
SUMMARY: AddressSanitizer: new-delete-type-mismatch /repo/src/coreclr/vm/excep.cpp:6674 in UnwindAndContinueRethrowHelperAfterCatch(Frame*, Exception*, bool)
I am not sure I understand the problem here. The allocated exception is of type HRException derived from Exception, so it is obviously larger than the base Exception. We delete the instance via the Exception pointer and the Exception has virtual destructor.
Note that we haven't changed anything on our side and we've been running with sanitizer for more than a year. This is not the first time we've caught an issue like this.
With help of copilot, I've understood the problem. We use ::delete to delete the exception. That makes C++ skip dynamic lookup for a specific delete and use a sized delete. Since the pointer that we use to delete the object is of Exception (base class) type, the sized delete gets the size of this base class. The address sanitizer then checks this and complains about the mismatch.
I'll try to change the ::delete to just delete to see if there are any issues with that.
Activity
ManickaP commentedon Jun 30, 2026
cc @janvorli
dotnet-policy-service commentedon Jun 30, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Jun 30, 2026
Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.
janvorli commentedon Jul 7, 2026
I am not sure I understand the problem here. The allocated exception is of type HRException derived from Exception, so it is obviously larger than the base Exception. We delete the instance via the Exception pointer and the Exception has virtual destructor.
ManickaP commentedon Jul 14, 2026
I'm not an expert on native code, bu it's still happening, here is more recent log:
Note that we haven't changed anything on our side and we've been running with sanitizer for more than a year. This is not the first time we've caught an issue like this.
janvorli commentedon Jul 14, 2026
With help of copilot, I've understood the problem. We use
::deleteto delete the exception. That makes C++ skip dynamic lookup for a specific delete and use a sized delete. Since the pointer that we use to delete the object is of Exception (base class) type, the sized delete gets the size of this base class. The address sanitizer then checks this and complains about the mismatch.I'll try to change the
::deleteto justdeleteto see if there are any issues with that.Fix address sanitizer issues (#130932)