[kmail2] [Bug 355278] New: gmail messages can remain as "ghosts" after deletion

2015-11-13 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=355278

Bug ID: 355278
   Summary: gmail messages can remain as "ghosts" after deletion
   Product: kmail2
   Version: 4.14.7
  Platform: Compiled Sources
OS: All
Status: UNCONFIRMED
  Severity: major
  Priority: NOR
 Component: message list
  Assignee: kdepim-bugs@kde.org
  Reporter: rjvber...@gmail.com

As reported (elsewhere?) already, there are cases where deleted messages from a
GMail account are not actually deleted at all, and remain as "ghosts",
greyed-out entries in kmail's message list that cannot be selected.

I just discovered that this also happens with entries in the Drafts folder,
after sending them.

Reproducible: Always

Steps to Reproduce:
1. configure a gmail account with the corresponding draft and wastebin ("Bin")
folders
2a. write and send a message
3a. delete any message from the active folder *before* having received the
notification that the message from (2) was sent successfully

OR

2b. compose a message, save it to the Drafts folder
3b. double-click to open it, and then send it.

4. select another folder, and then re-select the previous folder (this may need
to be done a few times)


Actual Results:  
The message deleted under 3a. or sent under 3b. will reappear in the list, but
ghosted. It can no longer be selected.

Expected Results:  
The message is supposed to have been deleted, so it should not reappear.

- this also applies to selections of multiple messages, in the 4.13 and 4.14
series on both Linux and OS X
- checking via GMail's web interface or a different client, the ghost messages
are indeed not deleted at all
- The effect of 3a. can be undone (*before* selecting another folder) by
hitting undo (^Z), waiting for the message to reappear as "not deleted", and
then deleting it again. After any message sending has completed of course.
- The effect can also be undone in akonadiconsole:
1. go to the folder in the browser tab
2. select the message: its attributes will show "/DELETED"
3. right-click the message, and *move* it to the account's Bin folder

Cleanup is a major feature IMHO, hence the Major severity I assigned to this
ticket.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Kdepim-bugs mailing list
Kdepim-bugs@kde.org
https://mail.kde.org/mailman/listinfo/kdepim-bugs


[Akonadi] [Bug 344970] Crash because uids.size()==1" in file ../../../resources/imap/retrieveitemtask.cpp, line 101

2016-05-27 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=344970

--- Comment #1 from RJVB  ---
Created attachment 99213
  --> https://bugs.kde.org/attachment.cgi?id=99213=edit
New crash information added by DrKonqi

akonadi_imap_resource (4.13) on KDE Platform 4.14.19 using Qt 4.8.7

- What I was doing when the application crashed:
I opened the Spam folder of a GMail account and selected a message. I think the
crash occurred before selecting the message or as an immediate result of that
action.

The last output from akonadi and kmail:

akonadi_imap_resource_14(5671) ResourceState::item: Called item() while state
holds multiple items! 
 list is empty 
 list is empty 
 There is not valid message 
akonadi_imap_resource_14(5671) ResourceState::item: Called item() while state
holds multiple items! 
akonadi_imap_resource_14(5671) ResourceState::item: Called item() while state
holds multiple items! 
akonadi_imap_resource_14(5671) ResourceState::item: Called item() while state
holds multiple items! 
akonadi_imap_resource_14(5671) ResourceState::item: Called item() while state
holds multiple items! 
ASSERT: "uids.size()==1" in file ../../../resources/imap/retrieveitemtask.cpp,
line 101
KCrash: Application 'akonadi_imap_resource' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
KCrash: Connect sock_file=/home/bertin/.kde/socket-Patux/kdeinit4__0

-- Backtrace (Reduced):
#6  0x7f08f8016c49 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#7  0x7f08f801a058 in __GI_abort () at abort.c:89
[...]
#11 0x004610d1 in RetrieveItemTask::onMessagesReceived (this=0x204f0b0,
mailBox=..., uids=..., messages=...) at
../../../resources/imap/retrieveitemtask.cpp:101
[...]
#13 0x7f08fa76da28 in messagesReceived (this=0x1627, _t1=..., _t2=...,
_t3=...) at ./moc_fetchjob.cpp:121
#14 KIMAP::FetchJobPrivate::emitPendings (this=0x2206ee0) at
../../kimap/fetchjob.cpp:60

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Kdepim-bugs mailing list
Kdepim-bugs@kde.org
https://mail.kde.org/mailman/listinfo/kdepim-bugs


[Akonadi] [Bug 344970] Crash because uids.size()==1" in file ../../../resources/imap/retrieveitemtask.cpp, line 101

2016-05-27 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=344970

RJVB  changed:

   What|Removed |Added

 CC||rjvber...@gmail.com

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Kdepim-bugs mailing list
Kdepim-bugs@kde.org
https://mail.kde.org/mailman/listinfo/kdepim-bugs


[Akonadi] [Bug 344970] Crash because uids.size()==1" in file ../../../resources/imap/retrieveitemtask.cpp, line 101

2016-05-27 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=344970

--- Comment #2 from RJVB  ---
Is there a patch for this in later versions that I could backport?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Kdepim-bugs mailing list
Kdepim-bugs@kde.org
https://mail.kde.org/mailman/listinfo/kdepim-bugs


[Akonadi] [Bug 344970] Crash because uids.size()==1" in file ../../../resources/imap/retrieveitemtask.cpp, line 101

2016-05-27 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=344970

--- Comment #4 from RJVB  ---
Looking at the code it seems that most of those Q_ASSERT statements can be
replaced with a handler similar to the `if (!ok)` on line 120.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Kdepim-bugs mailing list
Kdepim-bugs@kde.org
https://mail.kde.org/mailman/listinfo/kdepim-bugs


[kontact] [Bug 359236] New: kontact crash after disabling the knode (usenet) component

2016-02-10 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=359236

Bug ID: 359236
   Summary: kontact crash after disabling the knode (usenet)
component
   Product: kontact
   Version: unspecified
  Platform: Compiled Sources
OS: Linux
Status: UNCONFIRMED
  Keywords: drkonqi
  Severity: crash
  Priority: NOR
 Component: general
  Assignee: kdepim-bugs@kde.org
  Reporter: rjvber...@gmail.com

Application: kontact (4.13.3)
KDE Platform Version: 4.14.14 (Compiled from sources)
Qt Version: 4.8.7
Operating System: Linux 3.14.59-ck1-mainline-amdf10-rjvb x86_64
Distribution: Ubuntu 14.04.3 LTS

-- Information about the crash:
- What I was doing when the application crashed:

1) started knode --nofork from a terminal
2) started kontact --nofork from a terminal

worked for a while, then quit knode as it became stuck trying to update my
subscribed newsgroups

3) restarted knode --nofork from a terminal

after noticing that opened knode in the running kontact process, I went to the
Kontact settings and deactivated knode.

Some time after that, this crash occurred.

-- Backtrace:
Application: Kontact (kontact), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fdb0be2e800 (LWP 880))]

Thread 5 (Thread 0x7fdaebd25700 (LWP 882)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at
../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x7fdb0697a81d in ?? () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#2  0x7fdb0697a859 in ?? () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#3  0x7fdb030a3182 in start_thread (arg=0x7fdaebd25700) at
pthread_create.c:312
#4  0x7fdb0905347d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 4 (Thread 0x7fdaab40a700 (LWP 883)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at
../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x7fdb066bb20d in ?? () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#2  0x7fdb069a9fd6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#3  0x7fdb030a3182 in start_thread (arg=0x7fdaab40a700) at
pthread_create.c:312
#4  0x7fdb0905347d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 3 (Thread 0x7fda9a9af700 (LWP 907)):
#0  0x7fdb0904482d in read () at ../sysdeps/unix/syscall-template.S:81
#1  0x7fdb02c04c10 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x7fdb02bc3b14 in g_main_context_check () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x7fdb02bc3f7b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x7fdb02bc40ec in g_main_context_iteration () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x7fdb0996828e in
QEventDispatcherGlib::processEvents(QFlags) ()
from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6  0x7fdb09a1eeef in
QEventLoop::processEvents(QFlags) () from
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x7fdb09a20db6 in
QEventLoop::exec(QFlags) () from
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x7fdb09900669 in QThread::exec() () from
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x7fdb09900306 in QThreadPrivate::start(void*) () from
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
#10 0x7fdb030a3182 in start_thread (arg=0x7fda9a9af700) at
pthread_create.c:312
#11 0x7fdb0905347d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7fda88d03700 (LWP 13610)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at
../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x7fda9d72a9a4 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#2  0x7fda9d72a9e9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#3  0x7fdb030a3182 in start_thread (arg=0x7fda88d03700) at
pthread_create.c:312
#4  0x7fdb0905347d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7fdb0be2e800 (LWP 880)):
[KCrash Handler]
#6  0x7fdb0a5dc8e8 in QWidget::window() const () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#7  0x7fda83cf1375 in topLevelWidget (this=, this=) at /usr/include/qt4/QtGui/qwidget.h:328
#8  KNMainWidget::setStatusMsg (this=0xa697600, text=..., id=405) at
../../knode/knmainwidget.cpp:263
#9  0x7fda83c691c6 in KNGroup::scoreArticles (this=0xb4a80d0,
onlynew=) at ../../knode/kngroup.cpp:923
#10 0x7fda83c57881 in KNGroupManager::processJob (this=0xb241a40,
j=0xb3f2a80) at ../../knode/kngroupmanager.cpp:630
#11 0x7fda83c40ddf in KNode::Scheduler::slotJobFinished (this=0x3df8730,
job=0xb3f2a80) at ../../knode/scheduler.cpp:202
#12 0x7fda83d5c91d in KNode::Scheduler::qt_static_metacall (_o=0x3df8730,
_c=, _id=, _a=0x7ffc2e359710) at
./moc_scheduler.cpp:57
#13 0x7fdb09a3c686 in QMetaObject::activate(QObject*, QMetaObject const*,
int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#14 0x7fda83d595ed in 

[kontact] [Bug 359236] kontact crash after disabling the knode (usenet) component

2016-02-10 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=359236

--- Comment #2 from RJVB  ---
No more Usenet reader in KF5 PIM?

If  so, that's a perfect reason not to bother with it ...

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Kdepim-bugs mailing list
Kdepim-bugs@kde.org
https://mail.kde.org/mailman/listinfo/kdepim-bugs


[kmail2] [Bug 359698] Wastebin does not get emptied when config set to empty on exit

2016-02-23 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=359698

--- Comment #4 from RJVB  ---
The venom appears to be here

Thread 1 (Thread 0x7f751218b940 (LWP 26483)):
[KCrash Handler]
#6  QListData::size (this=0x10) at /usr/include/qt5/QtCore/qlist.h:105
#7  QList::count (this=0x10) at
/usr/include/qt5/QtCore/qlist.h:314
#8  KMail::UndoStack::size (this=0x0) at
/usr/src/debug/kdepim-15.12.2/kmail/undostack.cpp:58
#9  0x7f7511a1247c in KMMainWidget::updateMessageActionsDelayed
(this=this@entry=0xddef60) at
/usr/src/debug/kdepim-15.12.2/kmail/kmmainwidget.cpp:3850
#10 0x7f7511a12d23 in KMMainWidget::updateMessageActions
(this=this@entry=0xddef60, fast=fast@entry=false) at
/usr/src/debug/kdepim-15.12.2/kmail/kmmainwidget.cpp:3682
#11 0x7f7511a23331 in KMMainWidget::setupActions (this=this@entry=0xddef60)
at /usr/src/debug/kdepim-15.12.2/kmail/kmmainwidget.cpp:3423
#12 0x7f7511a277db in KMMainWidget::KMMainWidget (this=0xddef60,
parent=, aGUIClient=0xea9ec0, actionCollection=0xce4930,
config=...) at /usr/src/debug/kdepim-15.12.2/kmail/kmmainwidget.cpp:256
#13 0x7f75119d56d2 in KMMainWin::KMMainWin (this=0xea9e50,
__in_chrg=, __vtt_parm=) at
/usr/src/debug/kdepim-15.12.2/kmail/kmmainwin.cpp:61
#14 0x7f75119e6237 in KMKernel::openReader (this=this@entry=0x7ffec338fcc0,
onlyCheck=onlyCheck@entry=false) at
/usr/src/debug/kdepim-15.12.2/kmail/kmkernel.cpp:522

That looks like an attempt to determine the size of a non-existing undo stack
-- maybe KMail detects the presence of messages in the wastebin and presumes
this must mean that an undo stack has been created?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Kdepim-bugs mailing list
Kdepim-bugs@kde.org
https://mail.kde.org/mailman/listinfo/kdepim-bugs


[kmail2] [Bug 359698] Wastebin does not get emptied when config set to empty on exit

2016-02-23 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=359698

RJVB  changed:

   What|Removed |Added

 CC||rjvber...@gmail.com

--- Comment #1 from RJVB  ---
You should upload a backtrace for the crash, either through DrKonqi (which
*should* appear when a KDE application crashes) or else by running kmail from
within a debugger (type `gdb --args /usr/bin/kmail --nofork` or something like
that in a terminal, and then `bt` [without the quotes] when the crash occurs)

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Kdepim-bugs mailing list
Kdepim-bugs@kde.org
https://mail.kde.org/mailman/listinfo/kdepim-bugs


[Akonadi] [Bug 367638] DATABASE ERROR: 1452

2016-10-19 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=367638

RJVB  changed:

   What|Removed |Added

 CC||rjvber...@gmail.com

--- Comment #2 from RJVB  ---
I wouldn't be so sure that this error only occurs when 2 mysql daemons are
running. I've been seeing this for ages with 14.3.3 and 14.4 (git/head) with
the latest akonadi 1.13.1. For a while now my Linux rig (4.13.3) has been
immune to it and only my OS X system gave the errors. They disappeared from
(and now reappeared on) the Linux system after some combination of fsck and
vacuum, and I think the same may have happened on OS X.

just for kicks, this is what I currently see on my akonadi terminal after each
complete sync (Ctrl-L). I must assume there's potentially a single folder in my
list which is the culprit, but I have a bit too many of them to do manual
refreshes one by one to find the trouble folder(s).

DATABASE ERROR:
Error code: 1452
DB error:  "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)"
Error text: "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) QMYSQL3: Unable to
execute statement"
Query: "INSERT INTO CollectionPimItemRelation (Collection_id, PimItem_id)
VALUES (:0, :1)"
DATABASE ERROR:
Error code: 1452
DB error:  "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)"
Error text: "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) QMYSQL3: Unable to
execute statement"
Query: "INSERT INTO CollectionPimItemRelation (Collection_id, PimItem_id)
VALUES (:0, :1)"
DATABASE ERROR:
Error code: 1452
DB error:  "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)"
Error text: "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) QMYSQL3: Unable to
execute statement"
Query: "INSERT INTO CollectionPimItemRelation (Collection_id, PimItem_id)
VALUES (:0, :1)"
DATABASE ERROR:
Error code: 1452
DB error:  "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)"
Error text: "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) QMYSQL3: Unable to
execute statement"
Query: "INSERT INTO CollectionPimItemRelation (Collection_id, PimItem_id)
VALUES (:0, :1)"
DATABASE ERROR:
Error code: 1452
DB error:  "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)"
Error text: "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) QMYSQL3: Unable to
execute statement"
Query: "INSERT INTO CollectionPimItemRelation (Collection_id, PimItem_id)
VALUES (:0, :1)"
DATABASE ERROR:
Error code: 1452
DB error:  "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)"
Error text: "Cannot add or update a child row: a foreign key constraint fails
(`akonadi`.`collectionpimitemrelation`, CONSTRAINT
`collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES
`pimitemtable` (`id`) ON 

[Akonadi] [Bug 340813] sometimes two copies of mysqld are running with Akonadi

2016-10-19 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=340813

RJVB  changed:

   What|Removed |Added

 CC||rjvber...@gmail.com

--- Comment #13 from RJVB  ---
So here's an additional observation, from 4.13.3/ akonadi 1.13.1 but maybe
still useful.
As I just reported in a duplicate (https://bugs.kde.org/show_bug.cgi?id=367638)
I get the 1452 error even when I don't have 2 mysql daemons running. Not
continuously at least.

Looking at it today I first thought that they were generated only after a full
sync (Ctrl-L) but then I noticed the error messages also appeared while I was
browsing an email and no sync activity was occurring.
I then made the link with the search folder I created yesterday, which was
designed to combine the entries from several folders in a virtual folder. For
that, I defined a search working on the folders of interest and returning all
items with a total size >= 0kb. I left the 2nd field empty.

When I deleted that search folder the error messages disappeared, but the
unread email in one of the target folders disappeared too. From kmail; Claws
shows they're still there, fortunately.

-- 
You are receiving this mail because:
You are the assignee for the bug.


[kontact] [Bug 370646] Crash when opening Kontact preferences

2016-10-14 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370646

--- Comment #5 from RJVB  ---
I don't understand how or why dynamically allocated memory can go stale when
the shared library which allocated it is unloaded, but apparently something
like that happens.

When I replace libnoteshared's attributeregistrar's mechanism with one that
create a global class instance when the library is loaded, I can clearly see
that instance being destroyed. I'll have a look at the backtrace leading into
that dtor, but meanwhile, here's a fix. It extends the AttributeFactory with a
method that returns the newly created attribute instance, and (a circuitous)
one that allows to unregister attributes.
The resulting libraries are ABI compatible, and Kontact no longer crashes

Patch for kdepimlibs4:

diff --git akonadi/attributefactory.cpp akonadi/attributefactory.cpp
index 47a8839..51306f0 100644
--- akonadi/attributefactory.cpp
+++ akonadi/attributefactory.cpp
@@ -30,6 +30,7 @@
 #include "entityannotationsattribute.h"

 #include 
+#include 

 #include 

@@ -79,7 +80,18 @@ class StaticAttributeFactory : public AttributeFactory
 public:
 StaticAttributeFactory()
 : AttributeFactory()
-, initialized(false) {}
+, initialized(false)
+, notDeleted(0) {
+skipList << QLatin1String("NoteDisplayAttribute")
+<< QLatin1String("NoteAlarmAttribute")
+<< QLatin1String("KJotsLockAttribute")
+<< QLatin1String("showfoldernotesattribute");
+}
+~StaticAttributeFactory() {
+if (notDeleted > 0) {
+kWarning(5250) << Q_FUNC_INFO << "attributes not deleted:" <<
notDeleted;
+}
+}
 void init() {
 if (initialized) {
 return;
@@ -98,6 +110,8 @@ public:
 AttributeFactory::registerAttribute();
 }
 bool initialized;
+size_t notDeleted;
+QStringList skipList;
 };

 K_GLOBAL_STATIC(StaticAttributeFactory, s_attributeInstance)
@@ -113,6 +127,9 @@ class AttributeFactory::Private
 {
 public:
 QHash attributes;
+Private() {
+attributes.clear();
+}
 };

 AttributeFactory *AttributeFactory::self()
@@ -132,18 +149,35 @@ AttributeFactory::~ AttributeFactory()
 delete d;
 }

+#include 
 void AttributeFactory::registerAttribute(Attribute *attr)
 {
 Q_ASSERT(attr);
 Q_ASSERT(!attr->type().contains(' ') && !attr->type().contains('\'') &&
!attr->type().contains('"'));
 QHash::Iterator it =
d->attributes.find(attr->type());
 if (it != d->attributes.end()) {
-delete *it;
+// if
(!s_attributeInstance->skipList.contains(QLatin1String(attr->type( {
+delete *it;
+// } else {
+// s_attributeInstance->notDeleted += 1;
+// }
 d->attributes.erase(it);
 }
 d->attributes.insert(attr->type(), attr);
 }

+void AttributeFactory::unRegisterAttribute(Attribute *attr)
+{
+Q_ASSERT(attr);
+Q_ASSERT(!attr->type().contains(' ') && !attr->type().contains('\'') &&
!attr->type().contains('"'));
+kDebug(5250) << Q_FUNC_INFO << "deleting entry for type" << attr->type()
<< attr;
+QHash::Iterator it =
d->attributes.find(attr->type());
+if (it != d->attributes.end()) {
+delete *it;
+d->attributes.erase(it);
+}
+}
+
 Attribute *AttributeFactory::createAttribute(const QByteArray )
 {
 Attribute *attr = self()->d->attributes.value(type);
diff --git akonadi/attributefactory.h akonadi/attributefactory.h
index 647b67e..be3b471 100644
--- akonadi/attributefactory.h
+++ akonadi/attributefactory.h
@@ -60,6 +60,16 @@ public:
 {
 AttributeFactory::self()->registerAttribute(new T);
 }
+template  inline static T *getRegisteredAttribute()
+{
+T *attr = new T;
+AttributeFactory::self()->registerAttribute(attr);
+return attr;
+}
+inline static void deRegisterAttribute(Attribute *attr)
+{
+AttributeFactory::self()->unRegisterAttribute(attr);
+}

 /**
  * Creates an entity attribute object of the given type.
@@ -76,6 +86,7 @@ protected:
 private:
 static AttributeFactory *self();
 void registerAttribute(Attribute *attribute);
+void unRegisterAttribute(Attribute *attribute);

 class Private;
 Private *const d;


Patch for kdepim4:

diff --git noteshared/attributes/attributeregistrar.cpp
noteshared/attributes/attributeregistrar.cpp
index cdcc949..56a61c0 100644
--- noteshared/attributes/attributeregistrar.cpp
+++ noteshared/attributes/attributeregistrar.cpp
@@ -22,19 +22,46 @@

 #include 

+#include 
+#include 
+
 namespace {

 // Anonymous namespace; function is invisible outside this file.
+
+class NoteSharedRegistrar {
+public:
+NoteSharedRegistrar()
+{
+  kDebug(5500) << Q_FUNC_INFO << this;
+ 

[kontact] [Bug 370646] Crash when opening Kontact preferences

2016-10-14 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370646

--- Comment #6 from RJVB  ---
#1 (anonymous namespace)::NoteSharedRegistrar::~NoteSharedRegistrar()() at
.../kdepim-4.14.git/noteshared/attributes/attributeregistrar.cpp:44
#2 (anonymous namespace)::NoteSharedRegistrar::~NoteSharedRegistrar()() at
.../kdepim-4.14.git/noteshared/attributes/attributeregistrar.cpp:43
#3 (anonymous namespace)::$_0::destroy()() at
.../kdepim-4.14.git/noteshared/attributes/attributeregistrar.cpp:55
#4 __cxa_finalize() at ??:-1
#5 dyld::garbageCollectImages()() at ??:-1
#6 dlclose() at ??:-1
#7 dlclose() at ??:-1
#8 QLibraryPrivate::unload_sys()() at ??:-1
#9 QLibraryPrivate::unload()() at ??:-1
#10 QPluginLoader::unload()() at ??:-1
#11 KCModuleLoader::loadModule(KCModuleInfo const&,
KCModuleLoader::ErrorReporting, QWidget*, QStringList const&)() at ??:-1
#12 KCModuleProxyPrivate::loadModule()() at ??:-1
#13 KCModuleProxy::realModule() const() at ??:-1
#14 KCMultiDialog::addModule(KCModuleInfo const&, KPageWidgetItem*, QStringList
const&)() at ??:-1
#15 KSettings::DialogPrivate::createDialogFromServices()() at ??:-1
#16 KSettings::Dialog::showEvent(QShowEvent*)() at ??:-1
#17 QWidget::event(QEvent*)() at ??:-1
#18 QApplicationPrivate::notify_helper(QObject*, QEvent*)() at ??:-1
#19 QApplication::notify(QObject*, QEvent*)() at ??:-1
#20 QCoreApplication::notifyInternal(QObject*, QEvent*)() at ??:-1

-- 
You are receiving this mail because:
You are the assignee for the bug.


[kmail2] [Bug 371228] enable remote search on IMAP servers

2016-10-19 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=371228

RJVB  changed:

   What|Removed |Added

 CC||d...@newtech.fi

-- 
You are receiving this mail because:
You are the assignee for the bug.


[kmail2] [Bug 371228] New: enable remote search on IMAP servers

2016-10-19 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=371228

Bug ID: 371228
   Summary: enable remote search on IMAP servers
   Product: kmail2
   Version: unspecified
  Platform: Other
OS: other
Status: UNCONFIRMED
  Severity: wishlist
  Priority: NOR
 Component: message list
  Assignee: kdepim-bugs@kde.org
  Reporter: rjvber...@gmail.com

Dan suggested on the kdepim-users ML that someone might want to submit a
wishticket for a feature to allow remote search on IMAP servers, all the more
since support for the feature is already implemented but dormant.

In his words: 

> maybe we could add a checkbox to the "Quick Search" to enable it and allow 
> full-text search in a specific folder even if the bodies are not available
> locally. Would not work for the "Search" dialog though.

I've taken the bait, so here's the wish ticket :)



Reproducible: Always

Steps to Reproduce:
Do a search in an IMAP folder which isn't configured to download all message
bodies.

Actual Results:  
Messages not available locally are skipped

Expected Results:  
Those messages could be included on user request

I've started to implement the feature. As I'm still using 4.14 that's the code
base I'm using, but I suppose that porting should be relatively
straightforward.

The available support I've been able to find is part of
Akonadi::SearchCreateJob, so that's what I've tried to use. Currently I'm
getting a "cannot create persistent search" error, and I'm still stuck at how
to get the actual results from the returned collection, but I hope it's a
start.

I'm not entirely sure why remote search couldn't be part of the "Search"
dialog, given that the underlying code uses classes that support remote
search??

-- 
You are receiving this mail because:
You are the assignee for the bug.


[kmail2] [Bug 371228] enable remote search on IMAP servers

2016-10-19 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=371228

--- Comment #1 from RJVB  ---
Created attachment 101647
  --> https://bugs.kde.org/attachment.cgi?id=101647=edit
a first draft for enabling remote search in the QuickSearch toolbar. WIP!

-- 
You are receiving this mail because:
You are the assignee for the bug.


[kontact] [Bug 370646] Crash when opening Kontact preferences

2016-10-13 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370646

--- Comment #2 from RJVB  ---
Backtrace below.

Among the things I tried was not deleting only attributes of type
NoteDisplayAttribute. That actually made things worse, somehow, causing crashes
even when the application was starting up.

I do wonder about the delete, which appears to be a recent addition.
QHash::insert doesn't make copies as far as I read its documentation, so why
the delete? To allow the code registering an attribute to forget about it?
Maybe libnoteshared registers attributes it then deletes itself?

Application: Kontact (kontact), signal: Segmentation fault: 11
(lldb) process attach --pid 59010
Process 59010 stopped
Executable module set to "/opt/local/bin/kontact".
Architecture set to: x86_64-apple-macosx.
(lldb) set set term-width 200
(lldb) thread info
thread #1: tid = 0x354337, 0x7fff8f109e20 libsystem_kernel.dylib`__wait4 +
8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP

(lldb) bt all
* thread #1: tid = 0x354337, 0x7fff8f109e20 libsystem_kernel.dylib`__wait4
+ 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x7fff8f109e20 libsystem_kernel.dylib`__wait4 + 8
frame #1: 0x000107fc616e libkdeui.5.dylib`KCrash::startProcess(int,
char const**, bool) + 286
frame #2: 0x000107fc5295
libkdeui.5.dylib`KCrash::defaultCrashHandler(int) + 1189
frame #3: 0x7fff8b6e15aa libsystem_platform.dylib`_sigtramp + 26
frame #4: 0x00010a5249ca
libakonadi-kde.4.dylib`Akonadi::AttributeFactory::registerAttribute(this=0x7f97dbc28870,
attr=0x7f97e1d8b980) + 538 at attributefactory.cpp:141
frame #5: 0x000120e3c2cf libnoteshared.4.dylib`_GLOBAL__I_a [inlined]
void
Akonadi::AttributeFactory::registerAttribute()
+ 47 at attributefactory.h:61
frame #6: 0x000120e3c2a4 libnoteshared.4.dylib`_GLOBAL__I_a [inlined]
(anonymous namespace)::dummy() at attributeregistrar.cpp:30
frame #7: 0x000120e3c2a4 libnoteshared.4.dylib`_GLOBAL__I_a [inlined]
__cxx_global_var_init at attributeregistrar.cpp:38
frame #8: 0x000120e3c2a4 libnoteshared.4.dylib`_GLOBAL__I_a + 4 at
attributeregistrar.cpp:0
frame #9: 0x7fff61468c6e
dyld`ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) +
268
frame #10: 0x7fff61468dfa
dyld`ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
frame #11: 0x7fff61465aa2
dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) + 308
frame #12: 0x7fff61465a2b
dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) + 189
frame #13: 0x7fff61465a2b
dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&,
unsigned int, ImageLoader::InitializerTimingList&) + 189
frame #14: 0x7fff61465936
dyld`ImageLoader::runInitializers(ImageLoader::LinkContext const&,
ImageLoader::InitializerTimingList&) + 54
frame #15: 0x7fff6145bb0e dyld`dyld::runInitializers(ImageLoader*) + 89
frame #16: 0x7fff6146280f dyld`dlopen + 538
frame #17: 0x7fff8eb347ee libdyld.dylib`dlopen + 59
frame #18: 0x00010981aafd QtCore`QLibraryPrivate::load_sys() + 2589
frame #19: 0x000109818000 QtCore`QLibrary::load() + 80
frame #20: 0x0001093b5281
libkdecore.5.dylib`KLibLoader::library(QString const&,
QFlags) + 145
frame #21: 0x00010a0acb73
libkcmutils.4.dylib`KCModuleLoader::loadModule(KCModuleInfo const&,
KCModuleLoader::ErrorReporting, QWidget*, QStringList const&) + 3635
frame #22: 0x00010a0b470c
libkcmutils.4.dylib`KCModuleProxyPrivate::loadModule() + 668
frame #23: 0x00010a0b4432
libkcmutils.4.dylib`KCModuleProxy::realModule() const + 66
frame #24: 0x00010a0b0791
libkcmutils.4.dylib`KCMultiDialog::addModule(KCModuleInfo const&,
KPageWidgetItem*, QStringList const&) + 385
frame #25: 0x00010a0caf6b
libkcmutils.4.dylib`KSettings::DialogPrivate::createDialogFromServices() + 2715
frame #26: 0x00010a0ca053
libkcmutils.4.dylib`KSettings::Dialog::showEvent(QShowEvent*) + 1923
frame #27: 0x0001085ce1f6 QtGui`QWidget::event(QEvent*) + 1334
frame #28: 0x000108574afc
QtGui`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 332
frame #29: 0x000108577e99 QtGui`QApplication::notify(QObject*, QEvent*)
+ 8281
frame #30: 0x000109830126
QtCore`QCoreApplication::notifyInternal(QObject*, QEvent*) + 118
frame #31: 0x0001085ccf0c QtGui`QWidgetPrivate::show_helper() + 668
frame #32: 0x0001085cd9ae QtGui`QWidget::setVisible(bool) + 974
frame #33: 0x000108a314b9 QtGui`QDialog::setVisible(bool) + 169
frame #34: 0x00010732b8fc
libkontactprivate.4.dylib`Kontact::MainWindow::slotPreferences() [inlined]
QWidget::show(this=) + 668 at qwidget.h:497
frame #35: 0x00010732b8f1

[kontact] [Bug 370646] New: Crash when opening Kontact preferences

2016-10-13 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370646

Bug ID: 370646
   Summary: Crash when opening Kontact preferences
   Product: kontact
   Version: GIT (master)
  Platform: Compiled Sources
OS: OS X
Status: UNCONFIRMED
  Severity: crash
  Priority: NOR
 Component: general
  Assignee: kdepim-bugs@kde.org
  Reporter: rjvber...@gmail.com

Kontact built from the latest 4.14 branch sources crashes on OS X whenever I
open the Kontact preferences dialog.

Reproducible: Always

Steps to Reproduce:
1. Start Kontact
2. Select Settings/Configure Kontact


Actual Results:  
DrKonqi appears

Expected Results:  
Kontact preferences dialog appears

The actual crash is in line 141 of attributefactory.cpp
(`AttributeFactory::registerAttribute(Attribute *attr)`):

delete *it;

For now I haven't seen it happen when I comment that line out; I hope this only
leads to a minor memory leak (which I find preferable over a crash).

I hope this info is useful for the KF5 version but would appreciate a
backported fix.

-- 
You are receiving this mail because:
You are the assignee for the bug.


[kontact] [Bug 370646] Crash because of stale (dangling) pointers in the attribute registry

2016-10-16 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370646

RJVB  changed:

   What|Removed |Added

URL||http://arstechnica.com/civi
   ||s/viewtopic.php?p=32070659#
   ||p32070659

-- 
You are receiving this mail because:
You are the assignee for the bug.


[kontact] [Bug 370646] Crash because of stale (dangling) pointers in the attribute registry

2016-10-16 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370646

RJVB  changed:

   What|Removed |Added

Summary|Crash when opening Kontact  |Crash because of stale
   |preferences |(dangling) pointers in the
   ||attribute registry

-- 
You are receiving this mail because:
You are the assignee for the bug.


[kontact] [Bug 370646] Crash because of stale (dangling) pointers in the attribute registry

2016-10-16 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370646

--- Comment #8 from RJVB  ---
This bug has gotten under my skin. Having looked at this a bit more and asking
around a bit, the most likely explanation for the crash is this:

- KCModuleLoader::loadModule() loads the library to get a pointer to the
create_ function. The library registers its attributes.
- libnoteshared (or the kcm depending on it) doesn't have such a function, and
so KCModuleLoader::loadModule() unloads the library again
- somewhat thereafter, the library (and/or the kcm depending on it) is loaded
once more, and again registers its attributes
- the attribute factory finds a previous registration, and attempts to delete
the registered attributes
- since the library was unloaded and reloaded since those attributes were
"new'ed", the dtor lives (potentially) at a different address.
- delete *it invokes the dtor ... which may SEGV if the dtor address has
changed.

I see that `KCModuleLoader::loadModule()` has hardly changed and not at all in
the aspects outlined above. IOW, this bug is likely to occur in KDE PIM5 too if
libnoteshared hasn't obtained a create_ function since.

-- 
You are receiving this mail because:
You are the assignee for the bug.


[kontact] [Bug 370646] Crash when opening Kontact preferences

2016-10-16 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370646

--- Comment #7 from RJVB  ---
I see there's been a chronological glitch in my comments :-/

I wonder: shouldn't it be more elegant to do the actual unregistering
(attributes.erase(x)) in the Attribute dtor? I'll need to check if the
Attribute dtor is actually called when libnoteshared is unloaded and that
apparently leads to freeing memory allocated ("new'ed") by that library. If it
is, a lot of the above patches will be handled automatically.

-- 
You are receiving this mail because:
You are the assignee for the bug.


[kontact] [Bug 370646] Crash when opening Kontact preferences

2016-10-14 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370646

--- Comment #4 from RJVB  ---
Why this happens is unclear to me, but the line

 const bool registered = dummy();

in libnoteshared's attributeregistrar.cpp is executed twice. I think that can
only happen when the library is loaded twice.

I may be saying something stupid here, but if the library gets unloaded without
removing its registered attributes, are their addresses still valid when the
library is loaded next?

-- 
You are receiving this mail because:
You are the assignee for the bug.


[kontact] [Bug 370646] Crash when opening Kontact preferences

2016-10-14 Thread RJVB via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370646

--- Comment #3 from RJVB  ---
I ran kontact through valgrind to get another angle. I think in the end it just
confirms what I already thought:

```
--72548-- run: /usr/bin/dsymutil "/opt/local/lib/kde4/kcm_knote.so"
--72548-- run: /usr/bin/dsymutil
"/opt/local/lib/libknotesprivate.4.14.21.dylib"
--72548-- run: /usr/bin/dsymutil "/opt/local/lib/libnoteshared.4.14.21.dylib"
--72548-- run: /usr/bin/dsymutil "/opt/local/lib/libkdnssd.4.14.21.dylib"
warning: (x86_64) /tmp/lto.o unable to open object file
warning: no debug symbols in executable (-arch x86_64)
==72548== Invalid read of size 8
==72548==at 0xCA796B9:
Akonadi::AttributeFactory::registerAttribute(Akonadi::Attribute*)
(attributefactory.cpp:148)
==72548==by 0x19ED63DE: global constructors keyed to a
(attributefactory.h:61)
==72548==by 0x7FFF5FC11C6D:
ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in
/usr/lib/dyld)
==72548==by 0x7FFF5FC11DF9:
ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in
/usr/lib/dyld)
==72548==by 0x7FFF5FC0EAA1:
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned
int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==72548==by 0x7FFF5FC0EA2A:
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned
int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==72548==by 0x7FFF5FC0EA2A:
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned
int, ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==72548==by 0x7FFF5FC0E935:
ImageLoader::runInitializers(ImageLoader::LinkContext const&,
ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==72548==by 0x7FFF5FC04B0D: dyld::runInitializers(ImageLoader*) (in
/usr/lib/dyld)
==72548==by 0x7FFF5FC0B80E: dlopen (in /usr/lib/dyld)
==72548==by 0x90657ED: dlopen (in /usr/lib/system/libdyld.dylib)
==72548==by 0x38F8AFC: QLibraryPrivate::load_sys() (in
/opt/local/libexec/qt4/Library/Frameworks/QtCore.framework/Versions/4/QtCore)
==72548==  Address 0x1a48cd40 is not stack'd, malloc'd or (recently) free'd
==72548== 
*** KMail got signal 11 (Exiting)
*** Dead letters dumped.
KCrash: Application 'kontact' crashing...
KCrash: Attempting to start
/opt/local/lib/kde4/libexec/drkonqi.app/Contents/MacOS/drkonqi directly
```

-- 
You are receiving this mail because:
You are the assignee for the bug.