Fix crash in wxMSW wxToolInfo when compiling with UBSan (PR #25912)

25 views
Skip to first unread message

Maarten

unread,
Oct 21, 2025, 5:43:24 PM (8 days ago) Oct 21
to wx-...@googlegroups.com, Subscribed

See https://forums.wxwidgets.org/viewtopic.php?p=229882#p229882

This is a simplified version of the patch from the topic above. @Brickmaster1 does this work for you?


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/25912

Commit Summary

  • 6b89bf3 Fix crash in wxMSW wxToolInfo when compiling with UBSan

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25912@github.com>

Brickmasterhunt

unread,
Oct 21, 2025, 7:10:08 PM (8 days ago) Oct 21
to wx-...@googlegroups.com, Subscribed
Brickmaster1 left a comment (wxWidgets/wxWidgets#25912)

Thanks for integrating the patch! I meant to get around to doing this myself, but I kind of forgot about it!


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25912/c3429883692@github.com>

Brickmasterhunt

unread,
Oct 21, 2025, 7:10:25 PM (8 days ago) Oct 21
to wx-...@googlegroups.com, Subscribed
Brickmaster1 left a comment (wxWidgets/wxWidgets#25912)

I am booting my other computer with Windows to test it right now.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25912/c3429884159@github.com>

VZ

unread,
Oct 21, 2025, 7:16:10 PM (8 days ago) Oct 21
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25912)

Sorry, I didn't read the entire forum thread, but is there some explanation for this? I.e. does it work around a bug in our code correctly flagged by UBSAN (in which case I'd, of course, prefer to fix it) or is it really a bug in UBSAN (in which case I guess we don't have much choice, but it would be worth reporting it to UBSAN then)?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25912/c3429894684@github.com>

Brickmasterhunt

unread,
Oct 21, 2025, 8:39:49 PM (8 days ago) Oct 21
to wx-...@googlegroups.com, Subscribed
Brickmaster1 left a comment (wxWidgets/wxWidgets#25912)

I'm honestly not too sure which side causes the problem, I just knew that my patch was able to avoid it by disabling the UBSAN for the instruction.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25912/c3430039732@github.com>

VZ

unread,
Oct 22, 2025, 2:09:29 PM (7 days ago) Oct 22
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25912)

I really don't feel well about disabling UBSAN for this function, this shouldn't be necessary if it's compiled correctly. Rereading the forum thread, it looks like the real error is

thread 349144 panic: member access within null pointer of type 'TTTOOLINFOW' (aka 'tagTOOLINFOW')

at the assignment to cbSize in wxToolInfo ctor which seems to be impossible.

It looks like a problem with zig UBSAN implementation, if you can reproduce the problem with a simple struct inheriting from TOOLINFO (and I think you should be able to), you should submit this as bug to zig team and hopefully they can fix it, but it seems wrong to work around it in wx code.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25912/c3433594642@github.com>

VZ

unread,
Oct 28, 2025, 7:02:14 PM (21 hours ago) Oct 28
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25912)

Maarten, unless you'd really like to merge this, I'd rather leave this out for the reasons explained above.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25912/c3458888593@github.com>

Maarten

unread,
2:23 PM (2 hours ago) 2:23 PM
to wx-...@googlegroups.com, Subscribed

Closed #25912.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25912/issue_event/20587923200@github.com>

Maarten

unread,
2:23 PM (2 hours ago) 2:23 PM
to wx-...@googlegroups.com, Subscribed
MaartenBent left a comment (wxWidgets/wxWidgets#25912)

No problem, I'll close this PR then.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25912/c3463051693@github.com>

Reply all
Reply to author
Forward
0 new messages