https://bugs.kde.org/show_bug.cgi?id=527496

            Bug ID: 527496
           Summary: Crash (null CaptureWindow) in region/GUI mode when the
                    only active output is a replica of a disabled output
    Classification: Applications
           Product: Spectacle
      Version First unspecified
       Reported In:
          Platform: Kubuntu
                OS: Linux
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: General
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

SUMMARY
Spectacle segfaults immediately after receiving the screenshot from KWin when
the only active output is configured as a replica (mirror) of a disabled
output. This happened on a laptop with the lid closed and only an external
monitor in use. Region mode (spectacle -r) and the GUI full-screen mode
(spectacle -f) crash; background mode (spectacle -b -f -o file.png) works.

STEPS TO REPRODUCE
1. Laptop with an external monitor; close the lid so only the external
   monitor is active.
2. KWin ends up with this output configuration (from kscreen-doctor -o):
     eDP-1  disabled, connected, replication source: 0, geometry 0,0 1920x1080
     DP-2   enabled,  connected, replication source: 1, geometry 1920,0
1920x1080
   i.e. the only enabled output (DP-2) is a replica of the disabled eDP-1.
   System Settings > Display Configuration shows
   "All displays are disabled. Enable at least one."
3. Run: spectacle -r

OBSERVED RESULT
Spectacle crashes with SIGSEGV right after startup.

EXPECTED RESULT
Spectacle shows the region-selection overlay on the active monitor, or at
least fails gracefully instead of dereferencing a non-existent capture window.

ADDITIONAL INFORMATION
- Works with the lid open, with or without the external monitor.
- Not related to Tesseract: also crashes with libtesseract removed.
- Same crash with QT_QPA_PLATFORM=xcb.
- Not caused by spectaclerc: also crashes with the config file removed.
- Workaround: choosing "External only" in the display tray applet removes
  the replica relationship, after which Spectacle works normally.

Backtrace (with kde-spectacle-dbgsym):
#6  std::__uniq_ptr_impl<CaptureWindow, void (*)(CaptureWindow*)>::_M_ptr
(this=0x0)
    at /usr/include/c++/15/bits/unique_ptr.h:192
#7  std::unique_ptr<CaptureWindow, void (*)(CaptureWindow*)>::get (this=0x0)
    at /usr/include/c++/15/bits/unique_ptr.h:472
#8  operator() (__closure=<optimised out>, image=<optimised out>)
    at src/SpectacleCore.cpp:213
...
#15 QMetaObject::activate<void, QImage> (sender=0x0, mo=<optimised out>,
    local_signal_index=3, ret=0x0)
#16 ImagePlatform::newCroppableScreenshotTaken (this=0x62ddf082ab90, _t1=...)
    at moc_ImagePlatform.cpp:243
#17 ImagePlatformKWin::trackSource<...>::{lambda(QList<ResultVariant>
const&)#1}::operator()
    at src/Platforms/ImagePlatformKWin.cpp:499

SOFTWARE/OS VERSIONS
Spectacle: 6.6.6 (Ubuntu package 4:6.6.6-0ubuntu0.1); also crashes with 6.6.4
KDE Frameworks: 6.24.0
Qt: 6.10.2
Linux: Ubuntu 26.04, kernel 7.0.0-38, Wayland session
Graphics: Intel (i915), Mesa 26.0.8
Hardware: ASUS ZenBook UX325EA + Acer B246HYL via DisplayPort

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to