Skip to content

Fix: crash on Alt+w when closing multiple profiles at once#8301

Merged
vadi2 merged 1 commit intoMudlet:developmentfrom
NicolasKeita:fix-alt-w-crash
Oct 17, 2025
Merged

Fix: crash on Alt+w when closing multiple profiles at once#8301
vadi2 merged 1 commit intoMudlet:developmentfrom
NicolasKeita:fix-alt-w-crash

Conversation

@NicolasKeita
Copy link
Copy Markdown
Contributor

@NicolasKeita NicolasKeita commented Oct 2, 2025

Brief overview of PR changes/additions

Closing a game while it is still loading causes a crash.

Details Closing the MUD would immediately set mpHost to nullptr, while Host::loadingMap() and mudlet::slot_connectionDialogueFinished() are still actively using it.
Steps to reproduce the crash (Linux)
  1. Hold ALT + W.
  2. Select a MUD while keeping ALT + W pressed.

Tests

Manual test :

Automatic tests :

  • Introducing functional tests (or advanced unit tests covering the mudlet and Host classes) to the project would be beneficial for preventing regressions.

/claim #7478
Fixes #7478

Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this still crashes. To test, try it in a Linux VM.

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Oct 11, 2025

This was in the end fixed by #8203, thank you for giving this a go!

@vadi2 vadi2 closed this Oct 11, 2025
@NicolasKeita
Copy link
Copy Markdown
Contributor Author

NicolasKeita commented Oct 17, 2025

@vadi2

There is still a crash when closing a profile, even after PR #8203. The crash produces the same segmentation fault message as reported in the original issue #7478.

Step to reproduce the crash: Hold ALT + W while opening a profile.

Demonstration: video

Analysis:
The crash occurs because the code closes a profile (immediately frees some memory) without checking whether that memory is still being used by another thread.

PS: My work for this issue has always been done on Linux.

@vadi2 vadi2 reopened this Oct 17, 2025
Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it's a different reproduction scenario but a related crash fix nonetheless, thanks for covering it!

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Oct 17, 2025

/tip $100 @NicolasKeita

@algora-pbc
Copy link
Copy Markdown

algora-pbc bot commented Oct 17, 2025

Please visit Algora to complete your tip via Stripe.

@vadi2 vadi2 enabled auto-merge (squash) October 17, 2025 07:28
@algora-pbc
Copy link
Copy Markdown

algora-pbc bot commented Oct 17, 2025

🎉🎈 @NicolasKeita has been awarded $100 by Mudlet! 🎈🎊

@vadi2 vadi2 merged commit c7075d7 into Mudlet:development Oct 17, 2025
28 checks passed
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 on Mudlet exit when closing multiple profiles at once

2 participants