Bug 388726 - kmail crashes for addresses containing unusual characters
Summary: kmail crashes for addresses containing unusual characters
Status: RESOLVED WORKSFORME
Alias: None
Product: kontact
Classification: Applications
Component: mail (show other bugs)
Version: 5.12.3
Platform: Debian testing Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-09 12:13 UTC by stefan.schwarzer
Modified: 2022-10-18 06:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
stack trace of main callected after crash (37.68 KB, text/plain)
2018-01-09 12:13 UTC, stefan.schwarzer
Details
full stack trace, compressed wiht 7z to stay below size lim mit (5.33 KB, application/octet-stream)
2018-01-09 12:16 UTC, stefan.schwarzer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stefan.schwarzer 2018-01-09 12:13:18 UTC
Created attachment 109756 [details]
stack trace of main callected after crash

Application: kontact (5.6.3)

Qt Version: 5.9.2
Frameworks Version: 5.37.0
Operating System: Linux 4.14.0-3-amd64 x86_64
Distribution: Debian GNU/Linux testing (buster)

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

adding the name of a distribution group from my personal address book as recipient of a message

- Unusual behavior I noticed:

the distribution group was expanded to the real underlying addresses, but expansion did not stop (the group has 13 members
), it seems it was repeatedly expanded until an internal limit (300 recipients) was hit. A message window pops up to infor
m about this fact, but expansion seems to still continue somewhere. Starting with the info popup things become sluggish (p
robably allocation of memory somewhere). If I am fast enough, I can close the window with the effect that it re-appears. I
f I let things evolve,
kontact crashes after 3-10 seconds, blocking the desktop before it dies. 

- Custom settings of the application:

it is necessary, but not sufficient to give a contact group as recipient. Another group of 4 recipients (a subset of the l
arger group which causes the issue) expands ok. 

Distribution is debian sid/unstable, I recently upgraded kontact/kdepim to 4:17.08.3 from 4:16.X (testing) which entailed 
an akonadi database migration (My current configuration is not mixed, all from unstable as of 2018-01-09 even though the d
efault install target setting is testing). I checked the group in akonadiconsole where it shows unsuspicious references to
 the member entries in my address book. There is no self-reference (the group has no group type members).

The crash can be reproduced every time.

the attachment is the possibly incomplete stack trace of the main thread which shows the unterminated recursion in probably KPIM::AddresseeLineEdit::groupExpandResult(KJob*), 

I'll add a comment with the compressed complete trace (which is slightly larger than the size limit for attachments)
Comment 1 stefan.schwarzer 2018-01-09 12:16:19 UTC
Created attachment 109757 [details]
full stack trace, compressed wiht 7z to stay below size lim mit
Comment 2 Christoph Feck 2018-01-17 22:33:57 UTC
Looks like KPIM::MultiplyingLineEditor::addData() wants to show a message box which spawns its own nested event loop causing a recursion.
Comment 3 stefan.schwarzer 2018-04-12 05:32:38 UTC
I can reproduce the crash

- if a distribution group that I enter in the To: field contains an address where the optional 'real name' part contains an umlaut (äöü), like 
"Peter Schön <schoen@email.net>"
- if I select such an address from the 'recent addresses' list that opens when typing in the To: field
- if I just entder a string containing an umlaut (schö) in the To: field

kmail says its version is 5.7.3 (which I cannot select from the dropdown menu), the debian package has its version at 4:17.12.3-1 if that helps
Comment 4 stefan.schwarzer 2019-12-20 22:08:22 UTC
still the same state in 5.12.3
Comment 5 stefan.schwarzer 2019-12-20 22:25:51 UTC
sorry, the last comment is incomplete: 
I meant to say that the behavior concerning umlauts is still observable in kontact 5.12.3 (framework 5.62.0, Qt 5.12.5), though it does not crash kmail any longer. Entering, e.g. 'Schön', followed by ENTER, in the To: address field, of an otherwise empty message causes the editor to place an apparently random number of additional addresses from some internal resource (recent addresses? ..) in To: fields. My suspicion is that this has something to do with utf-8 representation of the addressee name not being compatible with some internal calculation (string length, whatever?).
Comment 6 Justin Zobel 2022-10-08 00:38:53 UTC
Thank you for reporting this crash in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the crash with a recent software version?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Comment 7 stefan.schwarzer 2022-10-18 06:25:01 UTC
I tried with the current kde on debian testing. The issue seems to be resolved. Thanks for the follow-up.