Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QTerminal crashes when try to split V o H on kwin_wayland #1031

Closed
stefonarch opened this issue Feb 8, 2023 · 4 comments · Fixed by lxqt/qtermwidget#500
Closed

QTerminal crashes when try to split V o H on kwin_wayland #1031

stefonarch opened this issue Feb 8, 2023 · 4 comments · Fixed by lxqt/qtermwidget#500
Labels

Comments

@stefonarch
Copy link
Member

stefonarch commented Feb 8, 2023

Both in plasma-session and lxqt-wayland session with kwin_wayland.

Steps to Reproduce (for bugs)
  1. Open QTerminal
  2. Click Action > "split horizontally|vertically" or press the shortcut for it
  3. watch it crashing

(for testing from tty:kwin_wayland application qterminal)

Program terminated with signal SIGABRT, Aborted.
#0  0x00007f3614ca08ec in ?? () from /usr/lib/libc.so.6
[Current thread is 1 (Thread 0x7f3615041840 (LWP 1946818))]
(gdb) where
#0  0x00007f3614ca08ec in ?? () from /usr/lib/libc.so.6
#1  0x00007f3614c51ea8 in raise () from /usr/lib/libc.so.6
#2  0x00007f3614c3b53d in abort () from /usr/lib/libc.so.6
#3  0x00007f361529fede in QMessageLogger::fatal(char const*, ...) const () from /usr/lib/libQt5Core.so.5
#4  0x00007f361529ff9d in qt_assert_x(char const*, char const*, char const*, int) () from /usr/lib/libQt5Core.so.5
#5  0x00007f3616a0f34c in QVector<unsigned char>::operator[] (this=0x5562c5578658, i=0) at /usr/include/qt/QtCore/qvector.h:453
#6  0x00007f3616a0afa2 in Konsole::TerminalDisplay::inputMethodQuery (this=0x5562c55785a0, query=Qt::ImSurroundingText)
    at /home/stef/git/lxqt/qtermwidget/lib/TerminalDisplay.cpp:2923
#7  0x00007f36161af92f in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#8  0x00007f3616a0b25d in Konsole::TerminalDisplay::event (this=0x5562c55785a0, event=0x7ffda65e0150)
    at /home/stef/git/lxqt/qtermwidget/lib/TerminalDisplay.cpp:3003
#9  0x00007f3616178b5c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#10 0x00007f361548df48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#11 0x00007f3611d3ae53 in ?? () from /usr/lib/libQt5WaylandClient.so.5
#12 0x00007f3615941a5e in QGuiApplicationPrivate::_q_updateFocusObject(QObject*) () from /usr/lib/libQt5Gui.so.5
#13 0x00007f36154bec20 in ?? () from /usr/lib/libQt5Core.so.5
#14 0x00007f361594e6c7 in QWindow::focusObjectChanged(QObject*) () from /usr/lib/libQt5Gui.so.5
#15 0x00007f36161a97eb in QWidget::setFocus(Qt::FocusReason) () from /usr/lib/libQt5Widgets.so.5
#16 0x00007f36169ea2ea in QTermWidget::init (this=0x7f35fc004ea0, startnow=0) at /home/stef/git/lxqt/qtermwidget/lib/qtermwidget.cpp:320
#17 0x00007f36169e9044 in QTermWidget::QTermWidget (this=0x7f35fc004ea0, startnow=0, parent=0x5562c59f5720)
    at /home/stef/git/lxqt/qtermwidget/lib/qtermwidget.cpp:124
#18 0x00005562c4bad239 in TermWidgetImpl::TermWidgetImpl (this=0x7f35fc004ea0, cfg=..., parent=0x5562c59f5720)
    at /home/stef/git/lxqt/qterminal/src/termwidget.cpp:45
#19 0x00005562c4bae910 in TermWidget::TermWidget (this=0x5562c59f5720, cfg=..., parent=0x5562c5782240) at /home/stef/git/lxqt/qterminal/src/termwidget.cpp:212
#20 0x00005562c4bb1ddf in TermWidgetHolder::newTerm (this=0x5562c5782240, cfg=...) at /home/stef/git/lxqt/qterminal/src/termwidgetholder.cpp:362
#21 0x00005562c4bb1cf5 in TermWidgetHolder::split (this=0x5562c5782240, term=0x5562c5756090, orientation=Qt::Vertical, cfg=...)
    at /home/stef/git/lxqt/qterminal/src/termwidgetholder.cpp:349
#22 0x00005562c4bb1870 in TermWidgetHolder::splitHorizontal (this=0x5562c5782240, term=0x5562c5756090)
    at /home/stef/git/lxqt/qterminal/src/termwidgetholder.cpp:274
#23 0x00005562c4ba928d in TabWidget::splitHorizontally (this=0x5562c5695930) at /home/stef/git/lxqt/qterminal/src/tabwidget.cpp:126
#24 0x00005562c4bd9c8e in TabWidget::qt_static_metacall (_o=0x5562c5695930, _c=QMetaObject::InvokeMetaMethod, _id=22, _a=0x7ffda65e0ad0)
    at /home/stef/git/lxqt/qterminal/build/src/moc_tabwidget.cpp:257
#25 0x00007f36154bec20 in ?? () from /usr/lib/libQt5Core.so.5
#26 0x00007f361616bec7 in QAction::triggered(bool) () from /usr/lib/libQt5Widgets.so.5
#27 0x00007f36161718c7 in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQt5Widgets.so.5
#28 0x00007f361617198e in QAction::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#29 0x00007f3616178b5c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#30 0x00007f361548df48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#31 0x00007f3615973fad in QShortcutMap::dispatchEvent(QKeyEvent*) () from /usr/lib/libQt5Gui.so.5
#32 0x00007f361596a817 in QShortcutMap::tryShortcut(QKeyEvent*) () from /usr/lib/libQt5Gui.so.5
#33 0x00007f361592a038 in QWindowSystemInterface::handleShortcutEvent(QWindow*, unsigned long, int, QFlags<Qt::KeyboardModifier>, unsigned int, unsigned int, unsigned int, QString const&, bool, unsigned short) () from /usr/lib/libQt5Gui.so.5                                                                                 
#34 0x00007f361593f972 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () from /usr/lib/libQt5Gui.so.5
--Type <RET> for more, q to quit, c to continue without paging--c
#35 0x00007f3615928885 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Gui.so.5
#36 0x00007f3611d5ea75 in ?? () from /usr/lib/libQt5WaylandClient.so.5
#37 0x00007f361471682b in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#38 0x00007f361476dcc9 in ?? () from /usr/lib/libglib-2.0.so.0
#39 0x00007f36147150e2 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#40 0x00007f36154d8c6c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#41 0x00007f36154866ec in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#42 0x00007f3615491219 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#43 0x00005562c4b93d9b in main (argc=1, argv=0x7ffda65e1328) at /home/stef/git/lxqt/qterminal/src/main.cpp:206
Context

Testing LXQt-session with kwin_wayland

System Information
  • QTerminal version: 1.2 git
  • Distribution & Version:arch
@tsujan
Copy link
Member

tsujan commented Feb 8, 2023

We had #806 two years ago, fixed in lxqt/qtermwidget#424. This one seems related (because of Konsole::TerminalDisplay::inputMethodQuery), although different.

@tsujan
Copy link
Member

tsujan commented Feb 9, 2023

Apparently the size of _lineProperties isn't enough at first. However, it isn't used in PlainTextDecoder::decodeLine.

@stefonarch
Could you please test after changing this line:

                decoder.decodeLine(&_image[loc(0,cursorPos.y())],_usedColumns,_lineProperties[cursorPos.y()]);

to

                decoder.decodeLine(&_image[loc(0,cursorPos.y())],_usedColumns,0);

@stefonarch
Copy link
Member Author

It works.

@tsujan
Copy link
Member

tsujan commented Feb 9, 2023

I don't know why these things happen only with kwin_wayland. Will make a PR.

@yan12125 yan12125 added the bug label Feb 20, 2023
tsujan added a commit to lxqt/qtermwidget that referenced this issue Apr 13, 2023
On the one hand, `PlainTextDecoder::decodeLine()` doesn't use its last argument.

On the other hand, there is something wrong with handling of the private variable `_lineProperties` in `TerminalDisplay` because it may be used outside its range and cause a crash in `TerminalDisplay::inputMethodQuery()` under Wayland (see lxqt/qterminal#1031).

Therefore, this patch removes it from `TerminalDisplay::inputMethodQuery()`.

Fixes lxqt/qterminal#1031
yan12125 pushed a commit to lxqt/qtermwidget that referenced this issue Apr 14, 2023
On the one hand, `PlainTextDecoder::decodeLine()` doesn't use its last argument.

On the other hand, there is something wrong with handling of the private variable `_lineProperties` in `TerminalDisplay` because it may be used outside its range and cause a crash in `TerminalDisplay::inputMethodQuery()` under Wayland (see lxqt/qterminal#1031).

Therefore, this patch removes it from `TerminalDisplay::inputMethodQuery()`.

Fixes lxqt/qterminal#1031
@yan12125 yan12125 moved this to Done in Wayland Support Jul 26, 2023
inventor2525 pushed a commit to inventor2525/qtermwidget that referenced this issue May 14, 2024
On the one hand, `PlainTextDecoder::decodeLine()` doesn't use its last argument.

On the other hand, there is something wrong with handling of the private variable `_lineProperties` in `TerminalDisplay` because it may be used outside its range and cause a crash in `TerminalDisplay::inputMethodQuery()` under Wayland (see lxqt/qterminal#1031).

Therefore, this patch removes it from `TerminalDisplay::inputMethodQuery()`.

Fixes lxqt/qterminal#1031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants