Bug 306695 - Crash when changing method signature [makeSignatureString, Cpp::AdaptSignatureAction::execute]
Summary: Crash when changing method signature [makeSignatureString, Cpp::AdaptSignatur...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 4.4.1
Platform: openSUSE Linux
: NOR crash
Target Milestone: 4.4.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 270834 324130 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-12 18:23 UTC by Rolf Eike Beer
Modified: 2013-08-29 17:57 UTC (History)
5 users (show)

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


Attachments
New crash information added by DrKonqi (15.70 KB, text/plain)
2012-11-07 18:16 UTC, Leandro Santiago da Silva
Details
New crash information added by DrKonqi (2.45 KB, text/plain)
2012-12-28 21:48 UTC, Alexander Olofsson
Details
valgrind log (108.11 KB, text/x-log)
2013-03-21 17:14 UTC, Rolf Eike Beer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Eike Beer 2012-09-12 18:23:59 UTC
For this to work you need a header and a source file both belonging to the same class. The source file must _not_ be open. Both must be part of a project (i.e. known to KDevelop) and parsed.

Reproducible: Always

Steps to Reproduce:
1. Go to the constructor of the class in the header file and change it's interface, e.g. remove or add a parameter.
2. When the popup comes asking you to update the implementations signature select "1" (i.e. let KDevelop do the update)
3. Crash



Thread 1 (Thread 0x7f4f464a9760 (LWP 5057)):
[KCrash Handler]
#6  0x00007f4f16e0a6fa in Cpp::AdaptSignatureAction::execute (this=<optimized out>) at /usr/src/debug/kdevelop4-4.3.80git.1345814513/languages/cpp/codegen/adaptsignatureaction.cpp:178
#7  0x00007f4f45be8925 in KDevelop::IAssistantAction::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkdevplatforminterfaces.so.7
#8  0x00007f4f44034e06 in QObject::event (this=0x8922340, e=<optimized out>) at kernel/qobject.cpp:1204
#9  0x00007f4f4339efe4 in notify_helper (e=0x90ffbe0, receiver=0x8922340, this=0x13868f0) at kernel/qapplication.cpp:4551
#10 QApplicationPrivate::notify_helper (this=0x13868f0, receiver=0x8922340, e=0x90ffbe0) at kernel/qapplication.cpp:4523
#11 0x00007f4f433a3db3 in QApplication::notify (this=0x7fff456ea3d0, receiver=0x8922340, e=0x90ffbe0) at kernel/qapplication.cpp:4412
#12 0x00007f4f4483c246 in KApplication::notify (this=0x7fff456ea3d0, receiver=0x8922340, event=0x90ffbe0) at /usr/src/debug/kdelibs-4.9.1/kdeui/kernel/kapplication.cpp:311
#13 0x00007f4f4401bd0c in QCoreApplication::notifyInternal (this=0x7fff456ea3d0, receiver=0x8922340, event=0x90ffbe0) at kernel/qcoreapplication.cpp:915
#14 0x00007f4f4401f5ba in sendEvent (event=0x90ffbe0, receiver=0x8922340) at kernel/qcoreapplication.h:231
#15 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x12dc7a0) at kernel/qcoreapplication.cpp:1539
#16 0x00007f4f4404a9a3 in sendPostedEvents () at kernel/qcoreapplication.h:236
#17 postEventSourceDispatch (s=0x138a540) at kernel/qeventdispatcher_glib.cpp:279
#18 0x00007f4f3ca1b5dd in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#19 0x00007f4f3ca1bdd8 in ?? () from /usr/lib64/libglib-2.0.so.0
#20 0x00007f4f3ca1bfa9 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#21 0x00007f4f4404adcf in QEventDispatcherGlib::processEvents (this=0x12dc060, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#22 0x00007f4f4344269e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#23 0x00007f4f4401a842 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#24 0x00007f4f4401aa97 in QEventLoop::exec (this=0x7fff456ea150, flags=...) at kernel/qeventloop.cpp:204
#25 0x00007f4f4401f8b5 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#26 0x000000000040fb5a in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kdevelop4-4.3.80git.1345814513/app/main.cpp:518

When I hit this the last time I looked in detail after restoring the files. I had changed the type of a constructor argument. The old arguments (2 unchanged ones and one changed) were removed from the implementations, so the constructor had 3 arguments in the header and none in the source file.
Comment 1 Rolf Eike Beer 2012-09-17 20:35:40 UTC
Got another crash:

Thread 1 (Thread 0x7faf2b2b5760 (LWP 16649)):
[KCrash Handler]
#6  0x00007faf27a5d93b in __memcpy_ssse3_back () from /lib64/libc.so.6
#7  0x00007faefb9c873d in appendTo (out=@0x7fff803ed5b8, a=<optimized out>) at 
/usr/include/bits/string3.h:52
#8  appendTo (out=@0x7fff803ed5b8, p=<optimized out>) at 
/usr/include/QtCore/qstringbuilder.h:293
#9  operator QString (this=<optimized out>) at 
/usr/include/QtCore/qstringbuilder.h:108
#10 makeSignatureString (signature=..., visibilityFrom=0xa8230d0) at 
/usr/src/debug/kdevelop4-4.3.80git.1345814513/languages/cpp/codegen/adaptsignatureaction.cpp:59
#11 0x00007faefb9c8cba in Cpp::AdaptSignatureAction::execute (this=0xa97cad0) 
at 
/usr/src/debug/kdevelop4-4.3.80git.1345814513/languages/cpp/codegen/adaptsignatureaction.cpp:137
#12 0x00007faf2a9f4925 in 
KDevelop::IAssistantAction::qt_metacall(QMetaObject::Call, int, void**) () 
from /usr/lib64/libkdevplatforminterfaces.so.7
#13 0x00007faf28e40e06 in QObject::event (this=0xa97cad0, e=<optimized out>) 
at kernel/qobject.cpp:1204
#14 0x00007faf281aafe4 in notify_helper (e=0xa3f5560, receiver=0xa97cad0, 
this=0x20fc620) at kernel/qapplication.cpp:4551
#15 QApplicationPrivate::notify_helper (this=0x20fc620, receiver=0xa97cad0, 
e=0xa3f5560) at kernel/qapplication.cpp:4523
#16 0x00007faf281afdb3 in QApplication::notify (this=0x7fff803ee670, 
receiver=0xa97cad0, e=0xa3f5560) at kernel/qapplication.cpp:4412
#17 0x00007faf29648246 in KApplication::notify (this=0x7fff803ee670, 
receiver=0xa97cad0, event=0xa3f5560) at 
/usr/src/debug/kdelibs-4.9.1/kdeui/kernel/kapplication.cpp:311
#18 0x00007faf28e27d0c in QCoreApplication::notifyInternal 
(this=0x7fff803ee670, receiver=0xa97cad0, event=0xa3f5560) at 
kernel/qcoreapplication.cpp:915
#19 0x00007faf28e2b5ba in sendEvent (event=0xa3f5560, receiver=0xa97cad0) at 
kernel/qcoreapplication.h:231
#20 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, 
data=0x20537a0) at kernel/qcoreapplication.cpp:1539
#21 0x00007faf28e569a3 in sendPostedEvents () at kernel/qcoreapplication.h:236
#22 postEventSourceDispatch (s=0x2100260) at 
kernel/qeventdispatcher_glib.cpp:279
#23 0x00007faf218275dd in g_main_context_dispatch () from 
/usr/lib64/libglib-2.0.so.0
#24 0x00007faf21827dd8 in ?? () from /usr/lib64/libglib-2.0.so.0
#25 0x00007faf21827fa9 in g_main_context_iteration () from 
/usr/lib64/libglib-2.0.so.0
#26 0x00007faf28e56dcf in QEventDispatcherGlib::processEvents (this=0x2053060, 
flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#27 0x00007faf2824e69e in QGuiEventDispatcherGlib::processEvents 
(this=<optimized out>, flags=<optimized out>) at 
kernel/qguieventdispatcher_glib.cpp:204
#28 0x00007faf28e26842 in QEventLoop::processEvents (this=<optimized out>, 
flags=...) at kernel/qeventloop.cpp:149
#29 0x00007faf28e26a97 in QEventLoop::exec (this=0x7fff803ee3f0, flags=...) at 
kernel/qeventloop.cpp:204
#30 0x00007faf28e2b8b5 in QCoreApplication::exec () at 
kernel/qcoreapplication.cpp:1187
#31 0x000000000040fb5a in main (argc=<optimized out>, argv=<optimized out>) at 
/usr/src/debug/kdevelop4-4.3.80git.1345814513/app/main.cpp:518

This time the source file was already opened. I updated the signature, saved the header, then clicked "1" and got the crash.
Comment 2 Milian Wolff 2012-10-04 23:33:14 UTC
works for me, please attach a valgrind log if you can reproduce this:

valgrind --track-origins=yes kdevelop -s ...
Comment 3 Rolf Eike Beer 2012-10-10 06:26:58 UTC
I can still reproduce this, although it is less likely to hit currently. When I hit it and tried to reproduce it using valgrind it worked. Sadly it's not an option to run KDevelop through valgrind all the time as it becomes just too slow.
Comment 4 Leandro Santiago da Silva 2012-11-07 18:16:57 UTC
Created attachment 75081 [details]
New crash information added by DrKonqi

kdevelop (4.4.60) on KDE Platform 4.9.2 using Qt 4.8.2

- What I was doing when the application crashed:
I was editing, in one file, both method declaration and definition. When I changed it's declaration, kdevelop crashed.

-- Backtrace (Reduced):
#6  0x00007f5db871b614 in Cpp::AdaptSignatureAction::execute() () from /usr/lib/kde4/kdevcpplanguagesupport.so
#7  0x00007f5deabde926 in QObject::event (this=0x808cc80, e=<optimized out>) at kernel/qobject.cpp:1195
#8  0x00007f5de9f467b4 in notify_helper (e=0x8adbd20, receiver=0x808cc80, this=0x247dc20) at kernel/qapplication.cpp:4556
#9  QApplicationPrivate::notify_helper (this=0x247dc20, receiver=0x808cc80, e=0x8adbd20) at kernel/qapplication.cpp:4528
#10 0x00007f5de9f4b583 in QApplication::notify (this=0x7fff9f3248b0, receiver=0x808cc80, e=0x8adbd20) at kernel/qapplication.cpp:4417
Comment 5 Kevin Funk 2012-12-01 20:49:33 UTC
*** Bug 270834 has been marked as a duplicate of this bug. ***
Comment 6 Alexander Olofsson 2012-12-28 21:48:01 UTC
Created attachment 76065 [details]
New crash information added by DrKonqi

kdevelop (4.3.1) on KDE Platform 4.9.4 using Qt 4.8.3

- What I was doing when the application crashed:

Edited an inlined method declaration in the header and pressed the "1" button to see what KDevelop would make of it.

-- Backtrace (Reduced):
#6  0x00007f53507e84a0 in makeSignatureString(Cpp::Signature const&, KDevelop::DUContext*) () from /usr/lib64/kde4/kdevcpplanguagesupport.so
#7  0x00007f53507eb182 in AdaptSignatureAction::execute() () from /usr/lib64/kde4/kdevcpplanguagesupport.so
#8  0x00007f536bd79c16 in QObject::event(QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007f536b10bbf4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#10 0x00007f536b1109c3 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
Comment 7 Rolf Eike Beer 2013-03-21 17:14:34 UTC
Created attachment 78272 [details]
valgrind log

I do not get any error messages from valgrind if the header file is open, but if the header file where the interface needs to get updates is closed I get this output.
Comment 8 Kevin Funk 2013-05-22 10:18:21 UTC
I assume this got fixed by:
commit 128b430ebd8fb0430e6a92abd1c73171dd0b11d2
Author: Sven Brauch <svenbrauch@googlemail.com>
Date:   Fri May 3 18:00:28 2013 +0200

    Provide a more obvious way to create assistant actions

Cannot reproduce.
Comment 9 Kevin Funk 2013-08-29 17:57:59 UTC
*** Bug 324130 has been marked as a duplicate of this bug. ***