Bug 436031

Summary: Issue with crashed when Maximize Konsole
Product: [Applications] konsole Reporter: chance <changze>
Component: historyAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: normal CC: cbc.alves, kde, nate
Priority: NOR    
Version: 21.03.80   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 21.04.01
Attachments: There is just one line, but more than 60000 characters in tmp.log.

Description chance 2021-04-22 02:16:37 UTC
Created attachment 137778 [details]
There is just one line, but more than 60000 characters in tmp.log.

SUMMARY
Recently I find a situation will cause a crash. There is just one line, but more than 60000 characters in tmp.log.

STEPS TO REPRODUCE
1. input "cat tmp.log" in Konsole
2. maximize Konsole

OBSERVED RESULT
Konsole crash

EXPECTED RESULT
maximize normally

SOFTWARE/OS VERSIONS
Konsole 21.03.80

ADDITIONAL INFORMATION
In src/history/compact/CompactHistoryBlock.cpp:13, changed "_blockLength(4096 * 64)" to "_blockLength(4096 * 64 * 2)" can fix this bug.
Comment 1 Kurt Hindenburg 2021-04-26 13:46:48 UTC
ASSERT: "_text != nullptr" in file /Volumes/Devel/KDE/src/kde/applications/konsole/src/history/compact/CompactHistoryLine.cpp, line 130

set the scrollback to the default 1000 lines to trigger
Comment 2 Kurt Hindenburg 2021-04-28 02:00:24 UTC
This is the commit that causes this 

https://invent.kde.org/utilities/konsole/-/commit/4f1864abf2bad81925540c6c3b24e6058af2a4fd
Comment 3 Kurt Hindenburg 2021-04-28 02:40:03 UTC
Yea, _blockLength isn't big enough to handle it.

262400 (new_length*sizeof(unit)) is bigger than 262144  (4096*64)
Comment 4 Bug Janitor Service 2021-04-28 11:00:14 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/382
Comment 5 Carlos Alves 2021-04-28 13:45:39 UTC
Git commit 1684952d3441b270386f6c2b7be2f711769aa2e6 by Carlos Alves.
Committed on 28/04/2021 at 12:34.
Pushed by hindenburg into branch 'master'.

Make CompactHistoryBlock size variable

When needed CompactHistoryBlock can now increase from 256kb to a bigger
size.

M  +9    -3    src/history/compact/CompactHistoryBlock.cpp
M  +1    -1    src/history/compact/CompactHistoryBlock.h
M  +1    -1    src/history/compact/CompactHistoryBlockList.cpp
M  +2    -2    src/history/compact/CompactHistoryLine.h

https://invent.kde.org/utilities/konsole/commit/1684952d3441b270386f6c2b7be2f711769aa2e6
Comment 6 Kurt Hindenburg 2021-04-30 01:54:54 UTC
Git commit ed2a9a9e3c3e69f4611c61716f51bb7dc3f5e11f by Kurt Hindenburg, on behalf of Carlos Alves.
Committed on 30/04/2021 at 01:54.
Pushed by hindenburg into branch 'release/21.04'.

Make CompactHistoryBlock size variable (v21.04.0)

When needed CompactHistoryBlock can now increase from 256kb to a bigger
size.

M  +9    -3    src/history/compact/CompactHistoryBlock.cpp
M  +1    -1    src/history/compact/CompactHistoryBlock.h
M  +1    -1    src/history/compact/CompactHistoryBlockList.cpp
M  +2    -2    src/history/compact/CompactHistoryLine.h

https://invent.kde.org/utilities/konsole/commit/ed2a9a9e3c3e69f4611c61716f51bb7dc3f5e11f
Comment 7 ninjalj 2021-05-01 15:56:31 UTC
*** Bug 436351 has been marked as a duplicate of this bug. ***