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

Do not trigger reset on DPI change on macOS platform #795

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

tobiolo
Copy link
Collaborator

@tobiolo tobiolo commented Dec 30, 2024

It is not necessary on macOS and moreover creates a segmentation fault.

AddressSanitizer:DEADLYSIGNAL
================================================================= ==16564==ERROR: AddressSanitizer: SEGV on unknown address 0xffffd847d7d9d7db (pc 0x000104f52700 bp 0x00016af19a50 sp 0x00016af199c0 T0) ==16564==The signal is caused by a READ memory access.
    #0 0x104f52700 in treesheets::Cell::Reset() cell.h:307
    #1 0x104f51ef8 in treesheets::Cell::ResetChildren() cell.h:309
    #2 0x104ee90d8 in treesheets::MyFrame::OnDPIChanged(wxDPIChangedEvent&) myframe.h:1154
    #3 0x105ebd0d4 in wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const appbase.cpp:644
    #4 0x105ebd4a0 in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const appbase.cpp:656
    #5 0x10624324c in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) event.cpp:1456
    #6 0x106242b4c in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) event.cpp:1061

@tobiolo tobiolo requested a review from aardappel December 30, 2024 17:03
It is not necessary on macOS and moreover creates a segmentation fault.

AddressSanitizer:DEADLYSIGNAL
=================================================================
==16564==ERROR: AddressSanitizer: SEGV on unknown address 0xffffd847d7d9d7db (pc 0x000104f52700 bp 0x00016af19a50 sp 0x00016af199c0 T0)
==16564==The signal is caused by a READ memory access.
    #0 0x104f52700 in treesheets::Cell::Reset() cell.h:307
    #1 0x104f51ef8 in treesheets::Cell::ResetChildren() cell.h:309
    aardappel#2 0x104ee90d8 in treesheets::MyFrame::OnDPIChanged(wxDPIChangedEvent&) myframe.h:1154
    aardappel#3 0x105ebd0d4 in wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const appbase.cpp:644
    aardappel#4 0x105ebd4a0 in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const appbase.cpp:656
    aardappel#5 0x10624324c in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) event.cpp:1456
    aardappel#6 0x106242b4c in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) event.cpp:1061
@tobiolo tobiolo force-pushed the no-dpi-change-on-macos branch from 1c2e075 to 7a129c0 Compare December 30, 2024 18:18
@aardappel
Copy link
Owner

It seems like it segfaults in our code though, so would be good to understand why? Even if the code is not necessary.

@tobiolo
Copy link
Collaborator Author

tobiolo commented Dec 31, 2024

To me it seems that the Cell (curdrawroot) gets invalidated but I cannot trace back why. There is no destructor of Cell called and curdrawroot set in Document::Layout(wxDC&) is fine. Trying to debug the code also leads to a crash in the lldb debugger when trying to access p->doc in the debug frame for MyFrame::OnDPIChanged(wxDPIChangedEvent&).
I propose to just pull this PR in order to avoid the issue for now.

@tobiolo
Copy link
Collaborator Author

tobiolo commented Jan 2, 2025

@aardappel

@aardappel aardappel merged commit 4e69099 into aardappel:master Jan 4, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants