[GH-ISSUE #144] Bug: crash for empty DropList #63

Closed
opened 2026-05-05 03:36:56 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @lindquist on GitHub (Feb 3, 2023).
Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/144

Run the following example on Windows.

Click the droplist, then the button, then the dropbutton, then just click the droplist/dropbutton alot and it will crash.

Backtrace:

DebugBreak()
Upp::AssertFailed(file=7ff702ef5ff5 "C:\\devel\\u", line=488, cond=7ff702ef6132 "!IsChild()") at C:\devel\upp\uppsrc\Core\Util.cpp 171
Upp::Ctrl::Create(parent=151186, style=2147483648, exstyle=0, savebits=1, show=4, dropshadow=1) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 488
Upp::Ctrl::PopUpHWND(owner=151186, savebits=1, activate=1, dropshadow=1, topmost=0) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 1163
Upp::Ctrl::PopUp(owner=3d2331f570, savebits=1, activate=1, dropshadow=1, topmost=0) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 1175
Upp::PopUpList::PopUp(owner=3d2331f570, x=238, top=166, bottom=190, width=1826) at C:\devel\upp\uppsrc\CtrlLib\PopUpList.cpp 284
Upp::PopUpList::PopUp(owner=3d2331f570, width=0) at C:\devel\upp\uppsrc\CtrlLib\PopUpList.cpp 305
Upp::DropList::Drop() at C:\devel\upp\uppsrc\CtrlLib\DropList.cpp 81
Upp::DropList::DropPush() at C:\devel\upp\uppsrc\CtrlLib\DropList.cpp 86
Upp::MultiButton::MultiButtons::<lambda13>::operator()() at C:\devel\upp\uppsrc\CtrlLib\MultiButton.cpp 121
Upp::Function<void ()>::Wrapper<`lambda at C:\devel\upp\uppsrc\CtrlLib\MultiButton.cpp:121:16'>::Execute() at C:\devel\upp\uppsrc\Core\Function.h 17
Upp::Function<void ()>::operator()() at C:\devel\upp\uppsrc\Core\Function.h 76
Upp::MultiButton::DoPush(i=0) at C:\devel\upp\uppsrc\CtrlLib\MultiButton.cpp 646
Upp::MultiButton::LeftDown(flags=8) at C:\devel\upp\uppsrc\CtrlLib\MultiButton.cpp 666
Upp::Ctrl::MouseEvent(event=129, p=, zdelta=0, keyflags=8) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 160
Upp::Ctrl::MouseEvent0(event=129, p=, zdelta=0, keyflags=8) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 96
Upp::Ctrl::MouseEventH(event=129, p=, zdelta=0, keyflags=8) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 116
Upp::Ctrl::MEvent0(e=129, p=, zd=0) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 348
Upp::Ctrl::DispatchMouseEvent(e=129, p=, zd=0) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 632
Upp::Ctrl::DispatchMouseEvent(e=129, p=, zd=0) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 632
Upp::Ctrl::DispatchMouse(e=129, p=, zd=0) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 606
Upp::Ctrl::DoMouse(e=129, p=, zd=0) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 562
Upp::Ctrl::WindowProc(message=513, wParam=1, lParam=852658) at C:\devel\upp\uppsrc\CtrlCore\Win32Proc.cpp 273
Upp::TopWindow::WindowProc(message=513, wParam=1, lParam=852658) at C:\devel\upp\uppsrc\CtrlCore\TopWin32.cpp 70
Upp::Ctrl::WndProc(hWnd=151186, message=513, wParam=1, lParam=852658) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 665
CallWindowProcW()
DispatchMessageW()
Upp::Ctrl::sProcessMSG(msg=) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 761
Upp::Ctrl::ProcessEvent(quit=3d2331f29f) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 782
Upp::Ctrl::ProcessEvents(quit=3d2331f29f) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 800
Upp::Ctrl::EventLoop(ctrl=3d2331f408) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 832
Upp::TopWindow::Run(appmodal=0) at C:\devel\upp\uppsrc\CtrlCore\TopWindow.cpp 323
GuiMainFn_() at C:\devel\upp\MyApps\DropListBug\main.cpp 18
Upp::AppExecute__(app=7ff702a114f0) at C:\devel\upp\uppsrc\Core\App.cpp 479
WinMain(hInstance=7ff702a10000, lpCmdLine=22e2d2f0678 "", nCmdShow=10) at C:\devel\upp\MyApps\DropListBug\main.cpp 15
main()
WinMainCRTStartup()
WinMainCRTStartup()
BaseThreadInitThunk()
RtlUserThreadStart()

Test case:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct App : TopWindow {
	DropList drop;
	Button button;
	App() {
		int h = 12 * StdFont().GetLineHeight() / 10;
		Add(drop.HSizePos().TopPos(0, h));
		Add(button.HSizePos().VSizePos(h));
	}
};

GUI_APP_MAIN
{
	App app;
	app.Run();
}
Originally created by @lindquist on GitHub (Feb 3, 2023). Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/144 Run the following example on Windows. Click the droplist, then the button, then the dropbutton, then just click the droplist/dropbutton alot and it will crash. Backtrace: ``` DebugBreak() Upp::AssertFailed(file=7ff702ef5ff5 "C:\\devel\\u", line=488, cond=7ff702ef6132 "!IsChild()") at C:\devel\upp\uppsrc\Core\Util.cpp 171 Upp::Ctrl::Create(parent=151186, style=2147483648, exstyle=0, savebits=1, show=4, dropshadow=1) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 488 Upp::Ctrl::PopUpHWND(owner=151186, savebits=1, activate=1, dropshadow=1, topmost=0) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 1163 Upp::Ctrl::PopUp(owner=3d2331f570, savebits=1, activate=1, dropshadow=1, topmost=0) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 1175 Upp::PopUpList::PopUp(owner=3d2331f570, x=238, top=166, bottom=190, width=1826) at C:\devel\upp\uppsrc\CtrlLib\PopUpList.cpp 284 Upp::PopUpList::PopUp(owner=3d2331f570, width=0) at C:\devel\upp\uppsrc\CtrlLib\PopUpList.cpp 305 Upp::DropList::Drop() at C:\devel\upp\uppsrc\CtrlLib\DropList.cpp 81 Upp::DropList::DropPush() at C:\devel\upp\uppsrc\CtrlLib\DropList.cpp 86 Upp::MultiButton::MultiButtons::<lambda13>::operator()() at C:\devel\upp\uppsrc\CtrlLib\MultiButton.cpp 121 Upp::Function<void ()>::Wrapper<`lambda at C:\devel\upp\uppsrc\CtrlLib\MultiButton.cpp:121:16'>::Execute() at C:\devel\upp\uppsrc\Core\Function.h 17 Upp::Function<void ()>::operator()() at C:\devel\upp\uppsrc\Core\Function.h 76 Upp::MultiButton::DoPush(i=0) at C:\devel\upp\uppsrc\CtrlLib\MultiButton.cpp 646 Upp::MultiButton::LeftDown(flags=8) at C:\devel\upp\uppsrc\CtrlLib\MultiButton.cpp 666 Upp::Ctrl::MouseEvent(event=129, p=, zdelta=0, keyflags=8) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 160 Upp::Ctrl::MouseEvent0(event=129, p=, zdelta=0, keyflags=8) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 96 Upp::Ctrl::MouseEventH(event=129, p=, zdelta=0, keyflags=8) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 116 Upp::Ctrl::MEvent0(e=129, p=, zd=0) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 348 Upp::Ctrl::DispatchMouseEvent(e=129, p=, zd=0) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 632 Upp::Ctrl::DispatchMouseEvent(e=129, p=, zd=0) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 632 Upp::Ctrl::DispatchMouse(e=129, p=, zd=0) at C:\devel\upp\uppsrc\CtrlCore\CtrlMouse.cpp 606 Upp::Ctrl::DoMouse(e=129, p=, zd=0) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 562 Upp::Ctrl::WindowProc(message=513, wParam=1, lParam=852658) at C:\devel\upp\uppsrc\CtrlCore\Win32Proc.cpp 273 Upp::TopWindow::WindowProc(message=513, wParam=1, lParam=852658) at C:\devel\upp\uppsrc\CtrlCore\TopWin32.cpp 70 Upp::Ctrl::WndProc(hWnd=151186, message=513, wParam=1, lParam=852658) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 665 CallWindowProcW() DispatchMessageW() Upp::Ctrl::sProcessMSG(msg=) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 761 Upp::Ctrl::ProcessEvent(quit=3d2331f29f) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 782 Upp::Ctrl::ProcessEvents(quit=3d2331f29f) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 800 Upp::Ctrl::EventLoop(ctrl=3d2331f408) at C:\devel\upp\uppsrc\CtrlCore\Win32Wnd.cpp 832 Upp::TopWindow::Run(appmodal=0) at C:\devel\upp\uppsrc\CtrlCore\TopWindow.cpp 323 GuiMainFn_() at C:\devel\upp\MyApps\DropListBug\main.cpp 18 Upp::AppExecute__(app=7ff702a114f0) at C:\devel\upp\uppsrc\Core\App.cpp 479 WinMain(hInstance=7ff702a10000, lpCmdLine=22e2d2f0678 "", nCmdShow=10) at C:\devel\upp\MyApps\DropListBug\main.cpp 15 main() WinMainCRTStartup() WinMainCRTStartup() BaseThreadInitThunk() RtlUserThreadStart() ``` Test case: ``` #include <CtrlLib/CtrlLib.h> using namespace Upp; struct App : TopWindow { DropList drop; Button button; App() { int h = 12 * StdFont().GetLineHeight() / 10; Add(drop.HSizePos().TopPos(0, h)); Add(button.HSizePos().VSizePos(h)); } }; GUI_APP_MAIN { App app; app.Run(); } ```
Author
Owner

@lindquist commented on GitHub (Feb 4, 2023):

Actually, it does not seem to have anything to do with the list being empty. Add an element, it still crashes when repeatedly clicking the droplist

<!-- gh-comment-id:1416675523 --> @lindquist commented on GitHub (Feb 4, 2023): Actually, it does not seem to have anything to do with the list being empty. Add an element, it still crashes when repeatedly clicking the droplist
Author
Owner

@mirek-fidler commented on GitHub (Feb 4, 2023):

No matter how I click, I am unable to reproduce.

That said, I believe that I have found a possible culprit based on the BT
you have posted. Fix pushed to master, can you please test? (If no luck, I
will be asking for some LOGs/DUMPs).

On Sat, Feb 4, 2023 at 7:19 AM Tomas Lindquist @.***>
wrote:

Actually, it does not seem to have anything to do with the list being
empty. Add an element, it still crashes when repeatedly clicking the
droplist


Reply to this email directly, view it on GitHub
https://github.com/ultimatepp/ultimatepp/issues/144#issuecomment-1416675523,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AARH236ISDSORNARX7FMCCDWVXYIRANCNFSM6AAAAAAUQTG2UA
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

<!-- gh-comment-id:1416708450 --> @mirek-fidler commented on GitHub (Feb 4, 2023): No matter how I click, I am unable to reproduce. That said, I believe that I have found a possible culprit based on the BT you have posted. Fix pushed to master, can you please test? (If no luck, I will be asking for some LOGs/DUMPs). On Sat, Feb 4, 2023 at 7:19 AM Tomas Lindquist ***@***.***> wrote: > Actually, it does not seem to have anything to do with the list being > empty. Add an element, it still crashes when repeatedly clicking the > droplist > > — > Reply to this email directly, view it on GitHub > <https://github.com/ultimatepp/ultimatepp/issues/144#issuecomment-1416675523>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AARH236ISDSORNARX7FMCCDWVXYIRANCNFSM6AAAAAAUQTG2UA> > . > You are receiving this because you are subscribed to this thread.Message > ID: ***@***.***> >
Author
Owner

@lindquist commented on GitHub (Feb 4, 2023):

The fix works, I've gone back and forth a few times and it's 100% reproducible without it for me 👍

<!-- gh-comment-id:1416741867 --> @lindquist commented on GitHub (Feb 4, 2023): The fix works, I've gone back and forth a few times and it's 100% reproducible without it for me 👍
Author
Owner

@lindquist commented on GitHub (Feb 4, 2023):

Can close imo

<!-- gh-comment-id:1416742500 --> @lindquist commented on GitHub (Feb 4, 2023): Can close imo
Author
Owner

@mirek-fidler commented on GitHub (Feb 4, 2023):

Excellent, thank you, a good catch. Please close.

On Sat, Feb 4, 2023 at 1:42 PM Tomas Lindquist @.***>
wrote:

Can close imo


Reply to this email directly, view it on GitHub
https://github.com/ultimatepp/ultimatepp/issues/144#issuecomment-1416742500,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AARH23YY56XNUI67NUIJZB3WVZFCZANCNFSM6AAAAAAUQTG2UA
.
You are receiving this because you commented.Message ID:
@.***>

<!-- gh-comment-id:1416743493 --> @mirek-fidler commented on GitHub (Feb 4, 2023): Excellent, thank you, a good catch. Please close. On Sat, Feb 4, 2023 at 1:42 PM Tomas Lindquist ***@***.***> wrote: > Can close imo > > — > Reply to this email directly, view it on GitHub > <https://github.com/ultimatepp/ultimatepp/issues/144#issuecomment-1416742500>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AARH23YY56XNUI67NUIJZB3WVZFCZANCNFSM6AAAAAAUQTG2UA> > . > You are receiving this because you commented.Message ID: > ***@***.***> >
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/ultimatepp#63
No description provided.