Bug 445893

Summary: KDE Plasma segfaults in QSGAreaAllocator::deallocateInNode()
Product: [Frameworks and Libraries] libplasma Reporter: James Beddek <telans>
Component: libplasmaAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: crash CC: account4reg, andysem, aronkvh, bouclier, bryan, charles.christie.ii, d7ghrrkcz, Daniel.Cardenas, Debraym46, devguy.ca, eiskboy, gabriel, jesaenh, johannes.derrer, kde, michaeljensendk, midenok+kdebugs, nate, nicolas.fella, oded, philspam, plasma-bugs, postix, stephen, totok, vkrevs, vladimir.menshakov, zenorbi
Priority: VHI Keywords: drkonqi
Version: 5.88.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=491788
Latest Commit: Version Fixed In: 6.0
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi

Description James Beddek 2021-11-22 05:55:49 UTC
Application: plasmashell (5.23.3)
 (Compiled from sources)
Qt Version: 5.15.2
Frameworks Version: 5.88.0
Operating System: Linux 5.15.3-gentoo-dist x86_64
Windowing System: X11
Distribution: Gentoo Linux
DrKonqi: 5.23.3 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:

Switching tty.

- Unusual behavior I noticed:

Upon switching back to the plasma tty, the primary monitor went to black multiple times, while my secondary monitor remained 'off'.
I seem to have lost my virtual desktops widget on my bottom panel, which is strange.

The crash can be reproduced sometimes.

-- Backtrace (Reduced):
#5  QSGAreaAllocatorNode::isLeaf (this=0x20) at /usr/src/debug/dev-qt/qtdeclarative-5.15.2-r13/qtdeclarative-55324650f9e759a43dce927f823c9858574106c3/src/quick/scenegraph/util/qsgareaallocator.cpp:93
#6  QSGAreaAllocator::deallocateInNode (this=0x56310c40dd40, node=0x20, pos=...) at /usr/src/debug/dev-qt/qtdeclarative-5.15.2-r13/qtdeclarative-55324650f9e759a43dce927f823c9858574106c3/src/quick/scenegraph/util/qsgareaallocator.cpp:170
#7  QSGAreaAllocator::deallocate (this=0x56310c40dd40, rect=...) at /usr/src/debug/dev-qt/qtdeclarative-5.15.2-r13/qtdeclarative-55324650f9e759a43dce927f823c9858574106c3/src/quick/scenegraph/util/qsgareaallocator.cpp:116
#8  0x00007efc660715b4 in QSGOpenGLAtlasTexture::AtlasBase::remove (this=0x56310c40dd30, t=t@entry=0x7efc344e5410) at /usr/src/debug/dev-qt/qtdeclarative-5.15.2-r13/qtdeclarative-55324650f9e759a43dce927f823c9858574106c3/src/quick/scenegraph/util/qsgopenglatlastexture.cpp:286
#9  0x00007efc660728bc in QSGOpenGLAtlasTexture::TextureBase::~TextureBase (this=0x7efc344e5410) at /usr/src/debug/dev-qt/qtdeclarative-5.15.2-r13/qtdeclarative-55324650f9e759a43dce927f823c9858574106c3/src/quick/scenegraph/util/qsgopenglatlastexture.cpp:516


Reported using DrKonqi
Comment 1 James Beddek 2021-11-22 05:55:51 UTC
Created attachment 143821 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 Nate Graham 2021-11-23 17:22:53 UTC
#14 Plasma::WindowTextureProvider::~WindowTextureProvider (this=0x7efc345ac5b0) at src/declarativeimports/core/corebindingsplugin_autogen/EWIEGA46WW/../../../../../../plasma-framework-5.88.0/src/declarativeimports/core/windowthumbnail.h:149
#15 Plasma::WindowTextureProvider::~WindowTextureProvider (this=0x7efc345ac5b0) at src/declarativeimports/core/corebindingsplugin_autogen/EWIEGA46WW/../../../../../../plasma-framework-5.88.0/src/declarativeimports/core/windowthumbnail.h:149
Comment 3 Nate Graham 2022-01-11 23:10:24 UTC
*** Bug 447407 has been marked as a duplicate of this bug. ***
Comment 4 Nicolas Fella 2022-01-18 23:51:09 UTC
*** Bug 447236 has been marked as a duplicate of this bug. ***
Comment 5 Nicolas Fella 2022-01-20 15:36:54 UTC
*** Bug 446822 has been marked as a duplicate of this bug. ***
Comment 6 Nicolas Fella 2022-01-20 15:37:15 UTC
*** Bug 448827 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2022-02-04 18:20:18 UTC
*** Bug 449585 has been marked as a duplicate of this bug. ***
Comment 8 Phil 2022-03-23 11:04:29 UTC
Created attachment 147680 [details]
New crash information added by DrKonqi

plasmashell (5.24.3) using Qt 5.15.2

- What I was doing when the application crashed:
Unlocked a locked session by entering password.

-- Backtrace (Reduced):
#4  QSGAreaAllocatorNode::isLeaf (this=0x20) at scenegraph/util/qsgareaallocator.cpp:93
#5  QSGAreaAllocator::deallocateInNode (this=this@entry=0x7f002c010b10, pos=..., node=0x20) at scenegraph/util/qsgareaallocator.cpp:170
#6  0x00007f0039f93826 in QSGAreaAllocator::deallocate (this=this@entry=0x7f002c010b10, rect=...) at scenegraph/util/qsgareaallocator.cpp:116
#7  0x00007f0039f99d3f in QSGOpenGLAtlasTexture::AtlasBase::remove (this=0x7f002c010b00, t=t@entry=0x7effe0240350) at scenegraph/util/qsgopenglatlastexture.cpp:286
#8  0x00007f0039f99e8d in QSGOpenGLAtlasTexture::TextureBase::~TextureBase (this=0x7effe0240350, __in_chrg=<optimized out>) at scenegraph/util/qsgopenglatlastexture.cpp:516
Comment 9 Nate Graham 2022-03-26 22:26:22 UTC
*** Bug 451880 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2022-04-26 16:35:56 UTC
*** Bug 453059 has been marked as a duplicate of this bug. ***
Comment 11 Vladimir 2022-04-26 21:45:27 UTC
Created attachment 148398 [details]
New crash information added by DrKonqi

plasmashell (5.24.4) using Qt 5.15.3

- What I was doing when the application crashed:
   - Clicked task bar, then plasmashell exited and restarted. I didn't do anything else

-- Backtrace (Reduced):
#4  0x00007f062f64fe90 in QSGAreaAllocator::deallocateInNode(QPoint const&, QSGAreaAllocatorNode*) () at /usr/lib64/libQt5Quick.so.5
#5  0x00007f062f64ff06 in QSGAreaAllocator::deallocate(QRect const&) () at /usr/lib64/libQt5Quick.so.5
#6  0x00007f062f65642f in QSGOpenGLAtlasTexture::AtlasBase::remove(QSGOpenGLAtlasTexture::TextureBase*) () at /usr/lib64/libQt5Quick.so.5
#7  0x00007f062f65657d in QSGOpenGLAtlasTexture::Texture::~Texture() () at /usr/lib64/libQt5Quick.so.5
#8  0x00007f062f656599 in QSGOpenGLAtlasTexture::Texture::~Texture() () at /usr/lib64/libQt5Quick.so.5
Comment 12 Aleksey Midenkov 2022-05-09 15:54:09 UTC
Always crashes after awake from sleep.

Package: plasma-workspace
Version: 4:5.24.4-0ubuntu1

Package: libqt5quick5
Version: 5.15.3+dfsg-1

[KCrash Handler]
#4  0x00007f64366aeb10 in QSGAreaAllocator::deallocateInNode(QPoint const&, QSGAreaAllocatorNode*) () at /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#5  0x00007f64366aeb8a in QSGAreaAllocator::deallocate(QRect const&) () at /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#6  0x00007f64366b5353 in  () at /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#7  0x00007f64366b54a1 in  () at /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#8  0x00007f64366b54bd in  () at /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#9  0x00007f6427f4e3d1 in  () at /usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/core/libcorebindingsplugin.so
#10 0x00007f6436700012 in  () at /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#11 0x00007f64366f996f in  () at /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#12 0x00007f64366fbe49 in  () at /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#13 0x00007f6434b03ca1 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007f6434677b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#15 0x00007f6434709a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Comment 13 Aleksey Midenkov 2022-05-09 15:58:04 UTC
Please change the priority to critical. This is very annoying bug.
Comment 14 Nate Graham 2022-05-09 17:21:10 UTC
"Critical" means 100% easily reproducible with data loss. "Crash" is the correct severity here.

See https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging#Severity if there is any remaining confusion about what the severity levels mean

If we get many more duplicates though, I'll consider raising the priority to HI and making it a 15-minute bug.
Comment 15 Txutxifel 2022-05-09 18:40:59 UTC
(In reply to Nate Graham from comment #14)
> "Critical" means 100% easily reproducible with data loss. "Crash" is the
> correct severity here.
> 
> See https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging#Severity if
> there is any remaining confusion about what the severity levels mean
> 
> If we get many more duplicates though, I'll consider raising the priority to
> HI and making it a 15-minute bug.

Hi,

I think the same than  Aleksey Midenkov  Its very annoying.

I don't know  if this bug is crash or critical,  but I have this bug for a long time (4- 5 years). I decided to disable drkonqi so I was tired to send reports without answering or fixing.

Sometimes plasma restart by itself, other I have to restart with "plasmashell &"

PD. Sorry for my english, It's is not my first language
Comment 16 mjay 2022-05-21 10:55:10 UTC
Created attachment 149062 [details]
New crash information added by DrKonqi

plasmashell (5.24.4) using Qt 5.15.3

- What I was doing when the application crashed:
Waking up from sleep, using nvidia drivers. This happens frequently, the cause is the nullpointer, originating from the ~Texture().

- Unusual behavior I noticed:
Plasmashell behaved erratic, slow window movement, then crash - and plasma, restarted again, launching DrKonqi.

-- Backtrace (Reduced):
#4  QSGAreaAllocatorNode::isLeaf() (this=0x0) at scenegraph/util/qsgareaallocator.cpp:93
#5  QSGAreaAllocator::deallocateInNode(QPoint const&, QSGAreaAllocatorNode*) (this=this@entry=0x55561cda0c20, pos=..., node=0x0) at scenegraph/util/qsgareaallocator.cpp:170
#6  0x00007fecae5dcb8a in QSGAreaAllocator::deallocate(QRect const&) (this=this@entry=0x55561cda0c20, rect=...) at scenegraph/util/qsgareaallocator.cpp:116
#7  0x00007fecae5e3353 in QSGOpenGLAtlasTexture::AtlasBase::remove(QSGOpenGLAtlasTexture::TextureBase*) (this=0x55561cda0c10, t=t@entry=0x7fec601cc710) at scenegraph/util/qsgopenglatlastexture.cpp:286
#8  0x00007fecae5e34a1 in QSGOpenGLAtlasTexture::TextureBase::~TextureBase() (this=0x7fec601cc710, __in_chrg=<optimized out>) at scenegraph/util/qsgopenglatlastexture.cpp:516
Comment 17 mjay 2022-06-15 09:00:27 UTC
Created attachment 149731 [details]
New crash information added by DrKonqi

plasmashell (5.24.4) using Qt 5.15.3

- Unusual behavior I noticed:

Unlocking the screen, this background went black, and plasma restarted.

-- Backtrace (Reduced):
#4  QSGAreaAllocatorNode::isLeaf() (this=0x0) at scenegraph/util/qsgareaallocator.cpp:93
#5  QSGAreaAllocator::deallocateInNode(QPoint const&, QSGAreaAllocatorNode*) (this=this@entry=0x7f337c135c60, pos=..., node=0x0) at scenegraph/util/qsgareaallocator.cpp:170
#6  0x00007f33d4aa4b8a in QSGAreaAllocator::deallocate(QRect const&) (this=this@entry=0x7f337c135c60, rect=...) at scenegraph/util/qsgareaallocator.cpp:116
#7  0x00007f33d4aab353 in QSGOpenGLAtlasTexture::AtlasBase::remove(QSGOpenGLAtlasTexture::TextureBase*) (this=0x7f337c135c50, t=t@entry=0x7f337c26a460) at scenegraph/util/qsgopenglatlastexture.cpp:286
#8  0x00007f33d4aab4a1 in QSGOpenGLAtlasTexture::TextureBase::~TextureBase() (this=0x7f337c26a460, __in_chrg=<optimized out>) at scenegraph/util/qsgopenglatlastexture.cpp:516
Comment 18 mjay 2022-06-15 16:54:49 UTC
Created attachment 149752 [details]
New crash information added by DrKonqi

plasmashell (5.24.4) using Qt 5.15.3

- Unusual behavior I noticed:

Coming out of suspend, using nvidia drivers, the desktop turned black and plasmashell segfaulted. This is a common symptom. That the system comes out of suspend and then plasma segfaults shortly thereafter, using nvidia-drivers.

-- Backtrace (Reduced):
#4  QSGAreaAllocatorNode::isLeaf() (this=0xbec56f0000000000) at scenegraph/util/qsgareaallocator.cpp:93
#5  QSGAreaAllocator::deallocateInNode(QPoint const&, QSGAreaAllocatorNode*) (this=this@entry=0x564bb29f3d50, pos=..., node=0xbec56f0000000000) at scenegraph/util/qsgareaallocator.cpp:170
#6  0x00007f3d99e3cb8a in QSGAreaAllocator::deallocate(QRect const&) (this=this@entry=0x564bb29f3d50, rect=...) at scenegraph/util/qsgareaallocator.cpp:116
#7  0x00007f3d99e43353 in QSGOpenGLAtlasTexture::AtlasBase::remove(QSGOpenGLAtlasTexture::TextureBase*) (this=0x564bb29f3d40, t=t@entry=0x7f3d3416bcc0) at scenegraph/util/qsgopenglatlastexture.cpp:286
#8  0x00007f3d99e434a1 in QSGOpenGLAtlasTexture::TextureBase::~TextureBase() (this=0x7f3d3416bcc0, __in_chrg=<optimized out>) at scenegraph/util/qsgopenglatlastexture.cpp:516
Comment 19 Fushan Wen 2023-04-03 12:46:42 UTC
*** Bug 467575 has been marked as a duplicate of this bug. ***
Comment 20 Fushan Wen 2023-04-03 12:46:49 UTC
*** Bug 467819 has been marked as a duplicate of this bug. ***
Comment 21 PG 2023-04-17 08:27:12 UTC Comment hidden (spam)
Comment 22 PG 2023-04-17 08:33:18 UTC Comment hidden (spam)
Comment 23 Nate Graham 2023-04-17 13:29:12 UTC Comment hidden (spam)
Comment 24 Nicolas Fella 2023-07-24 10:25:56 UTC
*** Bug 470943 has been marked as a duplicate of this bug. ***
Comment 25 Nicolas Fella 2023-07-24 10:27:44 UTC
*** Bug 472396 has been marked as a duplicate of this bug. ***
Comment 26 Nicolas Fella 2023-07-24 10:28:39 UTC
*** Bug 472536 has been marked as a duplicate of this bug. ***
Comment 27 mjay 2023-07-24 10:29:18 UTC
This is clearly related to Nvidia Drivers / Hardware. Having switched to Radeon, i have not seen segfaults for this codepath in approx 6 months.
Comment 28 Bug Janitor Service 2023-08-08 15:47:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/plasma-framework/-/merge_requests/840
Comment 29 David Edmundson 2023-09-01 13:35:42 UTC
Git commit 258cecbf0fab27ee84ad6c43ff3cfe3647215afd by David Edmundson.
Committed on 01/09/2023 at 15:32.
Pushed by davidedmundson into branch 'master'.

windowthumbnail: Cleanup on scene graph invalidation

The documentation
(https://doc.qt.io/qt-6/qquickitem.html#graphics-resource-handling)
states that if we are doing our own low level handling of graphic
resources we need to perform cleanup in 3 places:

 - on item destruction
- when an item is removed from the scene (via the virtual
releaseResources)
- when the scenegraph gets invalidated (via a slot
invalidateSceneGraph)

We only handled the first two.

This would cause a crash if the window thumbnail is showing just an icon
instead of a thumbnail and we hit one of the nvidia context loss resets.
The atlas texture would be deleted, but we would keep a QSGTexture
refernecing something inside that for longer which would linger.

I believe we only need the texture provider to reset, but we may as well
do it all.
BUG:

M  +27   -0    src/declarativeimports/core/windowthumbnail.cpp
M  +3    -0    src/declarativeimports/core/windowthumbnail.h

https://invent.kde.org/frameworks/plasma-framework/-/commit/258cecbf0fab27ee84ad6c43ff3cfe3647215afd
Comment 30 Nate Graham 2023-09-07 18:29:21 UTC
*** Bug 474259 has been marked as a duplicate of this bug. ***
Comment 31 Nicolas Fella 2024-04-05 13:21:24 UTC
*** Bug 485048 has been marked as a duplicate of this bug. ***
Comment 32 Nicolas Fella 2024-04-05 13:21:53 UTC
*** Bug 483024 has been marked as a duplicate of this bug. ***
Comment 33 Nate Graham 2024-07-22 21:06:05 UTC
*** Bug 472616 has been marked as a duplicate of this bug. ***
Comment 34 Nate Graham 2024-07-22 21:06:13 UTC
*** Bug 475384 has been marked as a duplicate of this bug. ***
Comment 35 Nate Graham 2024-07-22 21:06:21 UTC
*** Bug 475778 has been marked as a duplicate of this bug. ***
Comment 36 Nate Graham 2024-07-22 21:06:30 UTC
*** Bug 478510 has been marked as a duplicate of this bug. ***
Comment 37 Nate Graham 2024-07-22 21:06:47 UTC
*** Bug 482188 has been marked as a duplicate of this bug. ***