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

fix(layertreeview): add checks on selectedModel to avoid segfault #59337

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Djedouas
Copy link
Member

@Djedouas Djedouas commented Nov 5, 2024

Description

Fixes #59329

QGIS crashes when executing this line (and other from the same family) in the Python console:

QgsLayerTreeView().selectedLayers()

Fixes qgis#59329

QGIS crashes when executing this line (and other from the same family)
in the Python console:

QgsLayerTreeView().selectedLayers()
Copy link

github-actions bot commented Nov 5, 2024

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 7fb21ec)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 7fb21ec)

@rouault
Copy link
Contributor

rouault commented Nov 5, 2024

@Djedouas
Copy link
Member Author

Djedouas commented Nov 6, 2024

@nyalldawson @rouault do you have an idea why the Qt6 test has a segfault? I can run the test in both Qt5 and Qt6 on my machine and it is fine...

Is seems as if the Qt6 test uses the code without my modifications...

@rouault
Copy link
Contributor

rouault commented Nov 6, 2024

I can run the test in both Qt5 and Qt6 on my machine and it is fine...

did you try running under Valgrind, just in case this might be something subtle... Or maybe it is due to a difference of Qt6 versions between your machine and the CI one ?

@nyalldawson
Copy link
Collaborator

@Djedouas looks like the test is actually hanging and timing out and being forcefully closed. But I can't see anything here that would lead to a hang... 🤔

I'd check if it's the new test causing this (as opposed to an existing test impacted by these changes) by temporarily removing it...

Copy link

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible
    In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request.
    If there is no further activity on this pull request, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Nov 23, 2024
@Djedouas Djedouas removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Nov 25, 2024
@Djedouas Djedouas force-pushed the fix-segfault-layertreeview-without-model branch from ae7ac0e to 7fb21ec Compare November 25, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash after enter a python line
3 participants