Bug 374517

Summary: Enormous clipboard data causes crash
Product: [Unmaintained] klipper Reporter: James Ring <sjr>
Component: generalAssignee: Martin Flöser <mgraesslin>
Status: RESOLVED UNMAINTAINED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description James Ring 2017-01-03 23:57:18 UTC
To reproduce:

Step 1: dd if=/dev/urandom of=/dev/stdout count=1 bs=500M | base64 | xclip -selection clipboard

Step 2: right-click on Klipper

I think this is different to https://bugs.kde.org/show_bug.cgi?id=33747, as the crash seems to be in computing the QFontMetrics::boundingRect for a 500Mb string. I'd think it would be easy enough to simply truncate the displayed text to a reasonable amount (e.g. first and last 100 bytes or something).

Application: Klipper (klipper), signal: Segmentation fault
Using host libthread_db library "/usr/grte/v4/lib64/libthread_db.so.1".
[KCrash Handler]
#5  memset () at ../sysdeps/x86_64/memset.S:80
#6  0x00007fc76123a0f8 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#7  0x00007fc76123a36f in QTextEngine::LayoutData::reallocate(int) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#8  0x00007fc76123fcd6 in QTextEngine::attributes() const () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#9  0x00007fc76124dde2 in QTextLine::layout_helper(int) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007fc761139c06 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x00007fc76113a701 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x00007fc76121a5c3 in QFontMetrics::boundingRect(QRect const&, int, QString const&, int, int*) const () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#13 0x00007fc76141c143 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#14 0x00007fc76141c3a5 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#15 0x00007fc76141d14d in QMenu::popup(QPoint const&, QAction*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
Comment 1 Martin Flöser 2017-01-04 05:56:07 UTC
Which version are you using?
Comment 2 James Ring 2017-01-04 06:39:18 UTC
Ubuntu 14.04 LTS with klipper package version 4:4.11.11-0ubuntu0.2. I haven't tried it on a later version.
Comment 3 Martin Flöser 2017-01-04 07:22:28 UTC
Unfortunately we no longer maintain this version of Klipper. Too many 
things have changed and this makes it difficult to investigate the bug. 
It is also quite likely that the bug has already been resolved. Please 
consider upgrading to our latest version.

@STATUS RESOLVED
@RESOLUTION UNMAINTAINED
Comment 4 Martin Flöser 2017-01-04 15:49:55 UTC
Somehow my email templates don't work...