You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attaching GammaRay to complex Qt applications (e.g., apps using
Qt Quick, QQuickWindow, QSettings, etc.), the target process crashes
with an access violation in Qt6Core!QSettings::d_func (null this
pointer). Simple applications were unaffected, and Launch mode worked
correctly in all cases.
Root cause: gammaray_probe_attach() was not calling Hooks::installHooks() or Probe::startupHookReceived(), leaving
the probe without real-time object lifecycle tracking during findExistingObjects() traversal. This caused access to freed/invalid
objects in multi-threaded complex applications.
Changes
probe/hooks.cpp
Added Hooks::installHooks() call in gammaray_probe_attach() to
register Qt object creation/destruction hooks, consistent with the
Launch mode flow.
Added Probe::startupHookReceived() call to set trackDestroyed = false, preventing unsafe destruction tracking during initial object
discovery.
core/probe.cpp
Added null checks for child objects in Probe::discoverObject().
Added m_validObjects.contains(child) check to skip already-
discovered objects and prevent redundant recursive traversal.
Replaced foreach with range-based for loop.
plugins/quickinspector/quickinspector.cpp
Added null checks for view->engine(), window->contentItem(),
and children.first() in QuickInspector::objectCreated() to
guard against partially-initialized QQuickWindow states during
attach-time object discovery.
Testing
Scenario
Before
After
Attach + complex Qt application
Crash
✅ OK
Attach + simple application
OK
✅ OK
Launch + complex application
OK
✅ OK
Launch + simple application
OK
✅ OK
Known Remaining Issues
Events view: No upper bound on stored event count; may cause
unresponsiveness over time with high-throughput applications.
Objects view: First load may be slow for applications with a
large number of top-level QObjects.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. 1 out of 2 committers have signed the CLA.
✅ Kevinye0116 ❌ pre-commit-ci[bot] You have signed the CLA already but the status is still pending? Let us recheck it.
I tried attaching GammaRay to Insta360 Studio, and it crashed at first. The issue has been resolved after the modifications. The Quick Scenes interface experiences noticeable lag when loading some QML components, and the issue is still unresolved.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.1 out of 2 committers have signed the CLA.✅ Kevinye0116❌ pre-commit-ci[bot]You have signed the CLA already but the status is still pending? Let us recheck it.
I have already signed the CLA.
It looks like the remaining committer is pre-commit-ci[bot].
Could you please recheck or exclude the bot from CLA validation?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When attaching GammaRay to complex Qt applications (e.g., apps using
Qt Quick, QQuickWindow, QSettings, etc.), the target process crashes
with an access violation in
Qt6Core!QSettings::d_func(nullthispointer). Simple applications were unaffected, and Launch mode worked
correctly in all cases.
Root cause:
gammaray_probe_attach()was not callingHooks::installHooks()orProbe::startupHookReceived(), leavingthe probe without real-time object lifecycle tracking during
findExistingObjects()traversal. This caused access to freed/invalidobjects in multi-threaded complex applications.
Changes
probe/hooks.cpp
Hooks::installHooks()call ingammaray_probe_attach()toregister Qt object creation/destruction hooks, consistent with the
Launch mode flow.
Probe::startupHookReceived()call to settrackDestroyed = false, preventing unsafe destruction tracking during initial objectdiscovery.
core/probe.cpp
Probe::discoverObject().m_validObjects.contains(child)check to skip already-discovered objects and prevent redundant recursive traversal.
foreachwith range-based for loop.plugins/quickinspector/quickinspector.cpp
view->engine(),window->contentItem(),and
children.first()inQuickInspector::objectCreated()toguard against partially-initialized QQuickWindow states during
attach-time object discovery.
Testing
Known Remaining Issues
unresponsiveness over time with high-throughput applications.
large number of top-level QObjects.
These are tracked but not addressed in this PR.