Bug 445550 - Frequent SIGSEGV just after rebasing on `master`
Summary: Frequent SIGSEGV just after rebasing on `master`
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-15 20:41 UTC by personalizedrefrigerator
Modified: 2021-11-16 14:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description personalizedrefrigerator 2021-11-15 20:41:02 UTC
SUMMARY

From `gdb`:
```
Reading symbols from konsole...
(gdb) r
Starting program: /usr/bin/konsole 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff08d1640 (LWP 9957)]
[New Thread 0x7fffea36a640 (LWP 9958)]
[Detaching after fork from child process 9959]
qt.qpa.wayland: setGrabPopup called with a parent, QtWaylandClient::QWaylandXdgSurface(0x555555a8d310) which does not match the current topmost grabbing popup, QtWaylandClient::QWaylandXdgSurface(0x555555ed6e10) According to the xdg-shell protocol, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly because xdg-shell mandate that child popups close before parents

[... after about 1 minute, while scrolling down in `vim`]

Thread 1 "konsole" received signal SIGSEGV, Segmentation fault.
0x00007ffff7cff3fc in std::__fill_a1<QTypedArrayData<Konsole::Character>::iterator, Konsole::Character> (__first=..., __last=..., __value=...) at /usr/include/c++/11.1.0/bits/stl_algobase.h:912
912             *__first = __value;
(gdb) bt full
#0  0x00007ffff7cff3fc in std::__fill_a1<QTypedArrayData<Konsole::Character>::iterator, Konsole::Character> (__first=..., __last=..., __value=...)
    at /usr/include/c++/11.1.0/bits/stl_algobase.h:912
No locals.
#1  0x00007ffff7cfd5b3 in std::__fill_a<QTypedArrayData<Konsole::Character>::iterator, Konsole::Character> (__first=..., __last=..., __value=...)
    at /usr/include/c++/11.1.0/bits/stl_algobase.h:969
No locals.
#2  0x00007ffff7cfa65c in std::fill<QTypedArrayData<Konsole::Character>::iterator, Konsole::Character> (__first=..., __last=..., __value=...)
    at /usr/include/c++/11.1.0/bits/stl_algobase.h:999
No locals.
#3  0x00007ffff7cf500c in Konsole::Screen::clearImage (this=0x555555896c30, loca=4302, 
    loce=4319, c=32 ' ', resetLineRendition=false)
    at /home/hematite/Documents/Build/konsole/src/Screen.cpp:1132
        endCol = 89
        startCol = 72
        line = @0x55555592a048: {d = 0x555555d88340}
        y = 47
        scr_TL = 0
        topLine = 47
        bottomLine = 47
        clearCh = {character = 32, rendition = 0, foregroundColor = {
            _colorSpace = 1 '\001', _u = 0 '\000', _v = 0 '\000', _w = 0 '\000'}, 
          backgroundColor = {_colorSpace = 1 '\001', _u = 1 '\001', _v = 0 '\000', 
            _w = 0 '\000'}, isRealCharacter = false}
        isDefaultCh = true
#4  0x00007ffff7cf5781 in Konsole::Screen::clearToEndOfLine (this=0x555555896c30)
    at /home/hematite/Documents/Build/konsole/src/Screen.cpp:1248
No locals.
#5  0x00007ffff7d1d08a in Konsole::Vt102Emulation::processToken (this=0x55555594f6d0, 
    token=19205, p=0, q=0)
    at /home/hematite/Documents/Build/konsole/src/Vt102Emulation.cpp:692
No locals.
#6  0x00007ffff7d1a80f in Konsole::Vt102Emulation::receiveChar (this=0x55555594f6d0, 
    cc=75) at /home/hematite/Documents/Build/konsole/src/Vt102Emulation.cpp:474
        i = 0
        s = 0x55555594f768
        p = 3
#7  0x00007ffff7cd8f04 in Konsole::Emulation::receiveData (this=0x55555594f6d0, 
    text=0x55555609f688 " ", length=332)
    at /home/hematite/Documents/Build/konsole/src/Emulation.cpp:238
        i = 75
        __for_range = @0x7fffffffd520: {d = 0x555556022050}
        __for_begin = {i = 0x55555602250c}
```


STEPS TO REPRODUCE
1. Open `vim`
2. Run `:help`
3. Scroll up and down
4. Open and close the `settings` menu
5. Scroll up and down in `:help`
6. Quit `vim` and open the right-click menu
7. Continue to use `vim`/`konsole` for several minutes

OBSERVED RESULT
Konsole crashes

EXPECTED RESULT
Konsole should not crash

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Manjaro/Plasma (Wayland)
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.87.0 (Konsole built from source)
Qt Version: 5.15.2

ADDITIONAL INFORMATION
The crashing seems random, but I'm getting the same backtrace each time.
Comment 1 personalizedrefrigerator 2021-11-15 20:53:00 UTC
I can reproduce this after building on master (without rebasing). The issue seems to have appeared in the last day or two.
Comment 3 personalizedrefrigerator 2021-11-16 04:58:37 UTC
Here's an easier way to reproduce the bug:
 • Open vim
 • Press `a`
 • Hold down `Enter`

You can find my .vimrc here: https://github.com/personalizedrefrigerator/dotfiles/blob/main/.vimrc
Comment 4 personalizedrefrigerator 2021-11-16 05:00:21 UTC
(In reply to personalizedrefrigerator from comment #3)
> Here's an easier way to reproduce the bug:
>  • Open vim
>  • Press `a`
>  • Hold down `Enter`
> 
> You can find my .vimrc here:
> https://github.com/personalizedrefrigerator/dotfiles/blob/main/.vimrc

I am suspicious of these lines in my .vimrc:
```
" Change cursor when entering insert mode
" Ref: https://stackoverflow.com/questions/6488683/how-do-i-change-the-cursor-between-normal-and-insert-modes-in-vim
let &t_SI = "\e[6 q"
let &t_EI = "\e[2 q"
```
Comment 5 personalizedrefrigerator 2021-11-16 14:18:34 UTC
It looks like https://invent.kde.org/utilities/konsole/-/commit/7bb6e94725c2d5c74fd464a2c120be2a5eb81e15 has fixed thiss!