Bug 425446 - currentMode pointer to undefined address after mode.erase()
Summary: currentMode pointer to undefined address after mode.erase()
Status: REPORTED
Alias: None
Product: kwayland
Classification: Frameworks and Libraries
Component: client (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Martin Flöser
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-17 08:19 UTC by GangWu
Modified: 2020-08-17 08:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
simulate the actual switching mode case (1.09 KB, text/x-c++src)
2020-08-17 08:19 UTC, GangWu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description GangWu 2020-08-17 08:19:20 UTC
Created attachment 130927 [details]
simulate the actual switching mode case

SUMMARY
As switch different modes for one output or switch multioutput mode for two outputs.
currentMode may pointer to undefined address after mode.erase() when calling OutputDevice::Private::addMode.

switchmode.cpp is a test case to simulate the actual switching mode case in kde.

STEPS TO REPRODUCE
1. switch different modes
2. call OutputDevice::pixelSize or OutputDevice::refreshRate
3. printf the values return by the api

OBSERVED RESULT
1.sometimes get undefined values
2.sometimes crash

EXPECTED RESULT
get the correct currentMode values


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 GangWu 2020-08-17 08:23:09 UTC
I've submitted a patch here https://invent.kde.org/frameworks/kwayland/-/merge_requests/7