Bug 254450

Summary: Konsole crash upon right click
Product: [Applications] konsole Reporter: p.giarrusso
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED DUPLICATE    
Severity: crash CC: shlomif
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description p.giarrusso 2010-10-17 13:19:58 UTC
Application that crashed: konsole
Version of the application: 2.3.3
KDE Version: 4.3.5 (KDE 4.3.5)
Qt Version: 4.5.2
Operating System: Linux 2.6.31-22-generic-tuxonice x86_64
Distribution: Ubuntu 9.10

What I was doing when the application crashed:
I got my first Konsole crash ever (to my memory) today.
I'm sorry I can't be that helpful, because the system was very slow and I don't remember the details - I do remember right-clicking and the context menu appearing, and that matches the stack trace.
More details below.

I was running a console Java application, with memory already almost fully, so my system was slow, but then I scrolled up in the Konsole, pressed a key (probaly arrow down) to scroll back down, and then (maybe after something more) the computer was not responsive for a while.

After some clicking during this time, in some order, Konsole (very slowly) shifted to another tab, showed a right click menu (both as expected), and then disappeared - I thought I had clicked some "quit" menu item until I saw the crash report dialog.

 -- Backtrace:
Application: Konsole (kdeinit4), signal: Segmentation fault
The current source language is "auto; currently c".
[KCrash Handler]
#5  QList<QWidget*>::detach (this=<value optimized out>, _t=<value optimized out>) at ../../include/QtCore/../../src/corelib/tools/qlist.h:119
#6  QList<QWidget*>::removeAll (this=<value optimized out>, _t=<value optimized out>) at ../../include/QtCore/../../src/corelib/tools/qlist.h:575
#7  0x00000036c1de4a8e in QWidget::removeAction (this=<value optimized out>, action=<value optimized out>) at kernel/qwidget.cpp:2882
#8  0x000000378ae9dd9a in Konsole::SessionController::showDisplayContextMenu(QPoint const&) () from /usr/lib/libkonsoleprivate.so
#9  0x000000378ae9f141 in Konsole::SessionController::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkonsoleprivate.so
#10 0x0000003a93159ddc in QMetaObject::activate (sender=<value optimized out>, from_signal_index=<value optimized out>, to_signal_index=<value optimized out>, argv=<value optimized out>)
    at kernel/qobject.cpp:3113
#11 0x000000378aeac5e5 in Konsole::TerminalDisplay::configureRequest(QPoint const&) () from /usr/lib/libkonsoleprivate.so
#12 0x000000378aeb3142 in Konsole::TerminalDisplay::mousePressEvent(QMouseEvent*) () from /usr/lib/libkonsoleprivate.so
#13 0x00000036c1def9a6 in QWidget::event (this=<value optimized out>, event=<value optimized out>) at kernel/qwidget.cpp:7545
#14 0x00000036c1da0efc in QApplicationPrivate::notify_helper (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:4056
#15 0x00000036c1da8011 in QApplication::notify (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:3758
#16 0x0000003789223f46 in KApplication::notify (this=<value optimized out>, receiver=<value optimized out>, event=<value optimized out>) at ../../kdeui/kernel/kapplication.cpp:302
#17 0x0000003a93144c2c in QCoreApplication::notifyInternal (this=<value optimized out>, receiver=<value optimized out>, event=<value optimized out>) at kernel/qcoreapplication.cpp:610
#18 0x00000036c1da78e0 in QCoreApplication::sendSpontaneousEvent (receiver=<value optimized out>, event=<value optimized out>, alienWidget=<value optimized out>, nativeWidget=<value optimized out>, 
    buttonDown=<value optimized out>, lastMouseReceiver=<value optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:216
#19 QApplicationPrivate::sendMouseEvent (receiver=<value optimized out>, event=<value optimized out>, alienWidget=<value optimized out>, nativeWidget=<value optimized out>, 
    buttonDown=<value optimized out>, lastMouseReceiver=<value optimized out>) at kernel/qapplication.cpp:2924
#20 0x00000036c1e0da0e in QETWidget::translateMouseEvent (this=<value optimized out>, event=<value optimized out>) at kernel/qapplication_x11.cpp:4409
#21 0x00000036c1e0caa9 in QApplication::x11ProcessEvent (this=<value optimized out>, event=<value optimized out>) at kernel/qapplication_x11.cpp:3550
#22 0x00000036c1e35d0c in x11EventSourceDispatch (s=<value optimized out>, callback=<value optimized out>, user_data=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:146
#23 0x0000003a8803bbce in g_main_dispatch (context=<value optimized out>) at /build/buildd/glib2.0-2.22.3/glib/gmain.c:1960
#24 IA__g_main_context_dispatch (context=<value optimized out>) at /build/buildd/glib2.0-2.22.3/glib/gmain.c:2513
#25 0x0000003a8803f598 in g_main_context_iterate (context=<value optimized out>, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>)
    at /build/buildd/glib2.0-2.22.3/glib/gmain.c:2591
#26 0x0000003a8803f6c0 in IA__g_main_context_iteration (context=<value optimized out>, may_block=<value optimized out>) at /build/buildd/glib2.0-2.22.3/glib/gmain.c:2654
#27 0x0000003a9316d1a6 in QEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:327
#28 0x00000036c1e354be in QGuiEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#29 0x0000003a93143532 in QEventLoop::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventloop.cpp:149
#30 0x0000003a93143904 in QEventLoop::exec (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventloop.cpp:201
#31 0x0000003a93145ab9 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#32 0x00007f318c490503 in kdemain () from /usr/lib/libkdeinit4_konsole.so
#33 0x0000000000406da8 in launch (argc=5, _name=<value optimized out>, args=<value optimized out>, cwd=<value optimized out>, envc=40, envs=<value optimized out>, reset_env=false, tty=0x0, 
    avoid_loops=false, startup_id_str=0x40a299 "0") at ../../kinit/kinit.cpp:677
#34 0x0000000000407aa0 in handle_launcher_request (sock=7, who=<value optimized out>) at ../../kinit/kinit.cpp:1169
#35 0x0000000000407f51 in handle_requests (waitForPid=0) at ../../kinit/kinit.cpp:1362
#36 0x0000000000408bb2 in main (argc=2, argv=<value optimized out>, envp=<value optimized out>) at ../../kinit/kinit.cpp:1793

Reported using DrKonqi
Comment 1 Shlomi Fish 2010-11-08 17:23:59 UTC
I don't know if it's a priority for the konsole devs, but many applications will crash if your system runs out of memory. So I suggest that this bug will be closed.
Comment 2 p.giarrusso 2010-11-08 20:21:01 UTC
This bug is not about out-of-memory, it happened in that context, but it's unlikely to be related.

The stack traces does not suggest that a newly allocated pointer was NULL and was not checked, and that's the only obvious way in which an out-of-memory can crash an app. I don't see why detach() should allocate memory - of course, if you looked up in the sources, you can point it out (but then you should write that in the first place).

Moreover, on Linux malloc() doesn't return NULL anyway if the system is low on memory, in most cases.

By default, the memory allocation primitives like brk() (and mmap("/dev/zero") and friends) (on which  always succeeds but memory is not physically allocated; writing to a blank page will look for memory, and if this fails, even after trying very hard, the Linux kernel kills some process using lots of memory - and it still doesn't use SIGSEGV.

This policy can be changed by writing into /proc/sys/kernel/overcommit_memory, but I did not do this; see Documentation/vm/overcommit-accounting in the source tree of the Linux kernel for more info.

I know this because I used to be a kernel hacker.
Comment 3 Christoph Feck 2010-11-09 17:36:35 UTC
Before an application runs out of memory, it will be OOM killed by the kernel. No application "crashes" when there is no memory. I doubt this is the issue.

*** This bug has been marked as a duplicate of bug 233377 ***