Skip to content
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

Invalid page index used in wxAuiNotebook #24027

Closed
fcloud2020 opened this issue Nov 2, 2023 · 9 comments
Closed

Invalid page index used in wxAuiNotebook #24027

fcloud2020 opened this issue Nov 2, 2023 · 9 comments
Assignees

Comments

@fcloud2020
Copy link

When I used Code::Blocks to build a demo of wxAuiNotebook, there was an error and the program crashed. As shown below:
001
002
003
004
005

@vadz
Copy link
Contributor

vadz commented Nov 2, 2023

This is definitely a bug but it's going to be difficult to do anything about it without being able to reproduce it -- where is the source code of this demo that you used?

Also, please try running the program under debugger and choosing "Stop" when the assert happens and then copying the stack trace to this issue to help us understand what's going on. TIA!

@vadz vadz changed the title An error of wxAuiNotebook! Invalid page index used in wxAuiNotebook Nov 2, 2023
@fcloud2020
Copy link
Author

development environment: Windows 10 + wxWidgets 3.2.3 + Code::Blocks svn:13373.
callStack

@fcloud2020
Copy link
Author

This error occurs when holding down the left mouse button in the green marker and dragging through the caption of the page.
error-repeat

@fcloud2020
Copy link
Author

I think there might be something wrong with the code.
error-reason

@vadz
Copy link
Contributor

vadz commented Nov 5, 2023

The trouble is that you're reproducing it in the code which I don't have, so it's hard for me to follow. Could you please check if you can reproduce the problem in the AUI sample included in wxWidgets itself (samples/aui) and describe which steps are necessary in order to do it there? TIA!

@fcloud2020
Copy link
Author

wxAui_1
wxAui_2

@vadz
Copy link
Contributor

vadz commented Nov 5, 2023

Thanks for the instructions! I can indeed reproduce this, will debug.

@vadz vadz self-assigned this Nov 5, 2023
@vadz
Copy link
Contributor

vadz commented Nov 5, 2023

I've created #24039 with the fix for this bug. If you can test this PR, or just cherry pick the (small) change from its first commit f1a3816 and confirm that you can't reproduce the problem any longer, it would be appreciated. TIA!

@fcloud2020
Copy link
Author

fcloud2020 commented Nov 7, 2023

Sorry, I was a little busy yesterday.
After many tests today, I think this fix is perfect. This bug is gone with wind. :-)
Thank you for your help and hard work!

However, I found another small bug that does not cause the program to crash.

@vadz vadz closed this as completed in f1a3816 Nov 7, 2023
vadz added a commit that referenced this issue Nov 7, 2023
Fix using outdated click position in wxAuiTabCtrl mouse handlers, which
resulted in an invalid wxEVT_AUINOTEBOOK_DRAG_MOTION event being
generated and a crash while handling it.

Ensure that we reset m_clickPt when resetting m_isDragging too so that
we don't decide that we're dragging if the mouse enters the window with
the left button already pressed after a previous drag.

See #24027, #24039.

(cherry picked from commit f1a3816)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants