Bug 434892

Summary: Crash when using a color scheme with "random" background colors
Product: [Applications] konsole Reporter: guy <guy.carmin>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: crash CC: a.samirh78, ejuul2, guy.carmin, hughman-drifter, karanjabonface31, m.k.wadee, nate, stillcompiling, yiorgos-lists
Priority: NOR Keywords: drkonqi
Version: 20.12.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 21.08
Sentry Crash Report:
Attachments: attachment-11681-0.html
New crash information added by DrKonqi
New crash information added by DrKonqi

Description guy 2021-03-24 16:18:36 UTC
Application: konsole (20.12.2)

Qt Version: 5.15.2
Frameworks Version: 5.80.0
Operating System: Linux 5.11.8-300.fc34.x86_64 x86_64
Windowing System: X11
Drkonqi Version: 5.21.3
Distribution: Fedora 34 (KDE Plasma Prerelease)

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

After I've upgrade frm F33 to F34 beta consloe crash when try to start it.

The crash can be reproduced every time.

-- Backtrace:
Application: Konsole (konsole), signal: Aborted

[KCrash Handler]
#4  0x00007f12bba2e292 in raise () from /lib64/libc.so.6
#5  0x00007f12bba178a4 in abort () from /lib64/libc.so.6
#6  0x00007f12bb8efc78 in std::__replacement_assert(char const*, int, char const*, char const*) () from /lib64/libkonsoleprivate.so.20
#7  0x00007f12bb99248f in std::piecewise_linear_distribution<double>::param_type::_M_initialize() () from /lib64/libkonsoleprivate.so.20
#8  0x00007f12bb9995af in Konsole::ColorScheme::colorEntry(int, unsigned int) const () from /lib64/libkonsoleprivate.so.20
#9  0x00007f12bb94ba29 in Konsole::TerminalDisplay::applyProfile(QExplicitlySharedDataPointer<Konsole::Profile> const&) () from /lib64/libkonsoleprivate.so.20
#10 0x00007f12bb90333b in Konsole::ViewManager::applyProfileToView(Konsole::TerminalDisplay*, QExplicitlySharedDataPointer<Konsole::Profile> const&) () from /lib64/libkonsoleprivate.so.20
#11 0x00007f12bb90b84b in Konsole::ViewManager::createView(Konsole::Session*) () from /lib64/libkonsoleprivate.so.20
#12 0x00007f12bc1ca82e in Konsole::MainWindow::createSession(QExplicitlySharedDataPointer<Konsole::Profile>, QString const&) () from /lib64/libkdeinit5_konsole.so
#13 0x00007f12bc1d0a64 in Konsole::Application::newInstance() () from /lib64/libkdeinit5_konsole.so
#14 0x00007f12bc1db918 in kdemain () from /lib64/libkdeinit5_konsole.so
#15 0x00007f12bba18b75 in __libc_start_main () from /lib64/libc.so.6
#16 0x000055a270f2936e in _start ()
[Inferior 1 (process 4727) detached]

Possible duplicates by query: bug 399035.

Reported using DrKonqi
Comment 1 tcanabrava 2021-03-24 16:32:45 UTC
Created attachment 137035 [details]
attachment-11681-0.html

we are missing important information from your backtrace, can you install
the debug symbols?


On Wed, Mar 24, 2021 at 4:18 PM guy <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=434892
>
>             Bug ID: 434892
>            Summary: konsole crash when open
>            Product: konsole
>            Version: 20.12.2
>           Platform: Fedora RPMs
>                 OS: Linux
>             Status: REPORTED
>           Keywords: drkonqi
>           Severity: crash
>           Priority: NOR
>          Component: general
>           Assignee: konsole-devel@kde.org
>           Reporter: guy.carmin@gmail.com
>   Target Milestone: ---
>
> Application: konsole (20.12.2)
>
> Qt Version: 5.15.2
> Frameworks Version: 5.80.0
> Operating System: Linux 5.11.8-300.fc34.x86_64 x86_64
> Windowing System: X11
> Drkonqi Version: 5.21.3
> Distribution: Fedora 34 (KDE Plasma Prerelease)
>
> -- Information about the crash:
> - What I was doing when the application crashed:
>
> After I've upgrade frm F33 to F34 beta consloe crash when try to start it.
>
> The crash can be reproduced every time.
>
> -- Backtrace:
> Application: Konsole (konsole), signal: Aborted
>
> [KCrash Handler]
> #4  0x00007f12bba2e292 in raise () from /lib64/libc.so.6
> #5  0x00007f12bba178a4 in abort () from /lib64/libc.so.6
> #6  0x00007f12bb8efc78 in std::__replacement_assert(char const*, int, char
> const*, char const*) () from /lib64/libkonsoleprivate.so.20
> #7  0x00007f12bb99248f in
> std::piecewise_linear_distribution<double>::param_type::_M_initialize() ()
> from
> /lib64/libkonsoleprivate.so.20
> #8  0x00007f12bb9995af in Konsole::ColorScheme::colorEntry(int, unsigned
> int)
> const () from /lib64/libkonsoleprivate.so.20
> #9  0x00007f12bb94ba29 in
>
> Konsole::TerminalDisplay::applyProfile(QExplicitlySharedDataPointer<Konsole::Profile>
> const&) () from /lib64/libkonsoleprivate.so.20
> #10 0x00007f12bb90333b in
> Konsole::ViewManager::applyProfileToView(Konsole::TerminalDisplay*,
> QExplicitlySharedDataPointer<Konsole::Profile> const&) () from
> /lib64/libkonsoleprivate.so.20
> #11 0x00007f12bb90b84b in
> Konsole::ViewManager::createView(Konsole::Session*)
> () from /lib64/libkonsoleprivate.so.20
> #12 0x00007f12bc1ca82e in
>
> Konsole::MainWindow::createSession(QExplicitlySharedDataPointer<Konsole::Profile>,
> QString const&) () from /lib64/libkdeinit5_konsole.so
> #13 0x00007f12bc1d0a64 in Konsole::Application::newInstance() () from
> /lib64/libkdeinit5_konsole.so
> #14 0x00007f12bc1db918 in kdemain () from /lib64/libkdeinit5_konsole.so
> #15 0x00007f12bba18b75 in __libc_start_main () from /lib64/libc.so.6
> #16 0x000055a270f2936e in _start ()
> [Inferior 1 (process 4727) detached]
>
> Possible duplicates by query: bug 399035.
>
> Reported using DrKonqi
>
> --
> You are receiving this mail because:
> You are the assignee for the bug.
Comment 2 guy 2021-03-24 16:44:46 UTC
Application: Konsole (konsole), signal: Aborted

[KCrash Handler]
#4  0x00007f6766bdd292 in raise () from /lib64/libc.so.6
#5  0x00007f6766bc68a4 in abort () from /lib64/libc.so.6
#6  0x00007f6766a9ec78 in std::__replacement_assert (__file=<optimized out>, __line=<optimized out>, __function=<optimized out>, __condition=<optimized out>) at /usr/include/c++/11/x86_64-redhat-linux/bits/c++config.h:2648
#7  0x00007f6766b4148f in std::piecewise_linear_distribution<double>::param_type::_M_initialize (this=0x7ffeb57cf8d0) at /usr/include/c++/11/bits/random.tcc:3055
#8  0x00007f6766b485af in std::piecewise_linear_distribution<double>::piecewise_linear_distribution<Konsole::ColorScheme::colorEntry(int, uint) const::<lambda(double)> > (__fw=..., __bl=..., this=0x7ffeb57cf8d0) at /usr/include/c++/11/bits/random.h:5867
#9  Konsole::ColorScheme::colorEntry (this=0x7ffeb57cf8d0, index=<optimized out>, randomSeed=3044866064) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/colorscheme/ColorScheme.cpp:322
#10 0x00007f6766afaa29 in Konsole::ColorScheme::getColorTable (randomSeed=9989121, table=0x7ffeb57d0d90, this=0x55ad84378d20) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/colorscheme/ColorScheme.cpp:339
#11 Konsole::TerminalDisplay::applyProfile (this=0x55ad84092220, profile=...) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/terminalDisplay/TerminalDisplay.cpp:3118
#12 0x00007f6766ab233b in Konsole::ViewManager::applyProfileToView (this=0x55ad83ff1c90, view=0x55ad84092220, profile=...) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/ViewManager.cpp:832
#13 0x00007f6766aba84b in Konsole::ViewManager::createView (this=0x55ad83ff1c90, session=session@entry=0x55ad83f80130) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/ViewManager.cpp:675
#14 0x00007f676737982e in Konsole::MainWindow::createSession (this=this@entry=0x55ad83f71a60, profile=..., directory=...) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/MainWindow.cpp:512
#15 0x00007f676737fa64 in Konsole::Application::newInstance (this=0x7ffeb57d1370) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/Application.cpp:235
#16 0x00007f676738a918 in kdemain (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/main.cpp:235
#17 0x00007f6766bc7b75 in __libc_start_main () from /lib64/libc.so.6
#18 0x000055ad8234136e in _start ()
[Inferior 1 (process 9755) detached]
Comment 3 eric 2021-04-18 02:04:31 UTC
Created attachment 137676 [details]
New crash information added by DrKonqi

konsole (20.12.2) using Qt 5.15.2

- What I was doing when the application crashed: Tried to open konsole using KDE menu, immediately crashed

-- Backtrace (Reduced):
#6  0x00007fdef2f26c78 in std::__replacement_assert(char const*, int, char const*, char const*) () from /lib64/libkonsoleprivate.so.20
#7  0x00007fdef2fc948f in std::piecewise_linear_distribution<double>::param_type::_M_initialize() () from /lib64/libkonsoleprivate.so.20
#8  0x00007fdef2fd05af in Konsole::ColorScheme::colorEntry(int, unsigned int) const () from /lib64/libkonsoleprivate.so.20
#9  0x00007fdef2f82a29 in Konsole::TerminalDisplay::applyProfile(QExplicitlySharedDataPointer<Konsole::Profile> const&) () from /lib64/libkonsoleprivate.so.20
#10 0x00007fdef2f3a33b in Konsole::ViewManager::applyProfileToView(Konsole::TerminalDisplay*, QExplicitlySharedDataPointer<Konsole::Profile> const&) () from /lib64/libkonsoleprivate.so.20
Comment 4 eric 2021-04-22 00:50:15 UTC
I would like to add that I've now installed the debug symbols for a full report.  Konsole crashes immediately on opening every single time under both xorg and wayland on my Intel Kaby Lake laptop w/ intel graphics:

Application: konsole (20.12.2)

Qt Version: 5.15.2
Frameworks Version: 5.80.0
Operating System: Linux 5.11.12-300.fc34.x86_64 x86_64
Windowing System: Wayland
Drkonqi Version: 5.21.3
Distribution: "Fedora release 34 (Thirty Four)"

-- Backtrace:
Application: Konsole (konsole), signal: Aborted

[KCrash Handler]
#4  0x00007f5b7ffb1292 in raise () from /lib64/libc.so.6
#5  0x00007f5b7ff9a8a4 in abort () from /lib64/libc.so.6
#6  0x00007f5b7fe72c78 in std::__replacement_assert (__file=<optimized out>, __line=<optimized out>, __function=<optimized out>, __condition=<optimized out>) at /usr/include/c++/11/x86_64-redhat-linux/bits/c++config.h:2648
#7  0x00007f5b7ff1548f in std::piecewise_linear_distribution<double>::param_type::_M_initialize (this=0x7ffee1fdec90) at /usr/include/c++/11/bits/random.tcc:3055
#8  0x00007f5b7ff1c5af in std::piecewise_linear_distribution<double>::piecewise_linear_distribution<Konsole::ColorScheme::colorEntry(int, uint) const::<lambda(double)> > (__fw=..., __bl=..., this=0x7ffee1fdec90) at /usr/include/c++/11/bits/random.h:5867
#9  Konsole::ColorScheme::colorEntry (this=0x7ffee1fdec90, index=<optimized out>, randomSeed=3791514576) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/colorscheme/ColorScheme.cpp:322
#10 0x00007f5b7fecea29 in Konsole::ColorScheme::getColorTable (randomSeed=209784833, table=0x7ffee1fe0150, this=0x55f018787b90) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/colorscheme/ColorScheme.cpp:339
#11 Konsole::TerminalDisplay::applyProfile (this=0x55f01871baa0, profile=...) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/terminalDisplay/TerminalDisplay.cpp:3118
#12 0x00007f5b7fe8633b in Konsole::ViewManager::applyProfileToView (this=0x55f01849efb0, view=0x55f01871baa0, profile=...) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/ViewManager.cpp:832
#13 0x00007f5b7fe8e84b in Konsole::ViewManager::createView (this=0x55f01849efb0, session=session@entry=0x55f018521070) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/ViewManager.cpp:675
#14 0x00007f5b8074d82e in Konsole::MainWindow::createSession (this=this@entry=0x55f0184539e0, profile=..., directory=...) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/MainWindow.cpp:512
#15 0x00007f5b80753a64 in Konsole::Application::newInstance (this=0x7ffee1fe0730) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/Application.cpp:235
#16 0x00007f5b8075e918 in kdemain (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/konsole5-20.12.2-1.fc34.x86_64/src/main.cpp:235
#17 0x00007f5b7ff9bb75 in __libc_start_main () from /lib64/libc.so.6
#18 0x000055f017bb136e in _start ()
[Inferior 1 (process 204868) detached]

Report to https://bugs.kde.org/

(In reply to tcanabrava from comment #1)
> Created attachment 137035 [details]
> attachment-11681-0.html
> 
> we are missing important information from your backtrace, can you install
> the debug symbols?
> 
> 
> On Wed, Mar 24, 2021 at 4:18 PM guy <bugzilla_noreply@kde.org> wrote:
> 
> > https://bugs.kde.org/show_bug.cgi?id=434892
> >
> >             Bug ID: 434892
> >            Summary: konsole crash when open
> >            Product: konsole
> >            Version: 20.12.2
> >           Platform: Fedora RPMs
> >                 OS: Linux
> >             Status: REPORTED
> >           Keywords: drkonqi
> >           Severity: crash
> >           Priority: NOR
> >          Component: general
> >           Assignee: konsole-devel@kde.org
> >           Reporter: guy.carmin@gmail.com
> >   Target Milestone: ---
> >
> > Application: konsole (20.12.2)
> >
> > Qt Version: 5.15.2
> > Frameworks Version: 5.80.0
> > Operating System: Linux 5.11.8-300.fc34.x86_64 x86_64
> > Windowing System: X11
> > Drkonqi Version: 5.21.3
> > Distribution: Fedora 34 (KDE Plasma Prerelease)
> >
> > -- Information about the crash:
> > - What I was doing when the application crashed:
> >
> > After I've upgrade frm F33 to F34 beta consloe crash when try to start it.
> >
> > The crash can be reproduced every time.
> >
> > -- Backtrace:
> > Application: Konsole (konsole), signal: Aborted
> >
> > [KCrash Handler]
> > #4  0x00007f12bba2e292 in raise () from /lib64/libc.so.6
> > #5  0x00007f12bba178a4 in abort () from /lib64/libc.so.6
> > #6  0x00007f12bb8efc78 in std::__replacement_assert(char const*, int, char
> > const*, char const*) () from /lib64/libkonsoleprivate.so.20
> > #7  0x00007f12bb99248f in
> > std::piecewise_linear_distribution<double>::param_type::_M_initialize() ()
> > from
> > /lib64/libkonsoleprivate.so.20
> > #8  0x00007f12bb9995af in Konsole::ColorScheme::colorEntry(int, unsigned
> > int)
> > const () from /lib64/libkonsoleprivate.so.20
> > #9  0x00007f12bb94ba29 in
> >
> > Konsole::TerminalDisplay::applyProfile(QExplicitlySharedDataPointer<Konsole::Profile>
> > const&) () from /lib64/libkonsoleprivate.so.20
> > #10 0x00007f12bb90333b in
> > Konsole::ViewManager::applyProfileToView(Konsole::TerminalDisplay*,
> > QExplicitlySharedDataPointer<Konsole::Profile> const&) () from
> > /lib64/libkonsoleprivate.so.20
> > #11 0x00007f12bb90b84b in
> > Konsole::ViewManager::createView(Konsole::Session*)
> > () from /lib64/libkonsoleprivate.so.20
> > #12 0x00007f12bc1ca82e in
> >
> > Konsole::MainWindow::createSession(QExplicitlySharedDataPointer<Konsole::Profile>,
> > QString const&) () from /lib64/libkdeinit5_konsole.so
> > #13 0x00007f12bc1d0a64 in Konsole::Application::newInstance() () from
> > /lib64/libkdeinit5_konsole.so
> > #14 0x00007f12bc1db918 in kdemain () from /lib64/libkdeinit5_konsole.so
> > #15 0x00007f12bba18b75 in __libc_start_main () from /lib64/libc.so.6
> > #16 0x000055a270f2936e in _start ()
> > [Inferior 1 (process 4727) detached]
> >
> > Possible duplicates by query: bug 399035.
> >
> > Reported using DrKonqi
> >
> > --
> > You are receiving this mail because:
> > You are the assignee for the bug.
Comment 5 eric 2021-04-22 01:00:55 UTC
Ok I have tried deleting my ~/.config/konsolerc and now konsole opens just fine.  
I believe the issue was my default konsole profile had the setting to "randomly adjust colors for each session" under Edit Color Scheme. 
If I create a new profile in konsole settings and use "randomly adjust colors" then set it as default it causes the same crash behavior.
Comment 6 Khurram Wadee 2021-05-06 07:47:52 UTC
Created attachment 138184 [details]
New crash information added by DrKonqi

konsole (20.12.2) using Qt 5.15.2

- What I was doing when the application crashed: Just clicked on Konsole icon to start the program.

-- Backtrace (Reduced):
#6  0x00007fd62aeafc78 in std::__replacement_assert(char const*, int, char const*, char const*) () from /lib64/libkonsoleprivate.so.20
#7  0x00007fd62af5248f in std::piecewise_linear_distribution<double>::param_type::_M_initialize() () from /lib64/libkonsoleprivate.so.20
#8  0x00007fd62af595af in Konsole::ColorScheme::colorEntry(int, unsigned int) const () from /lib64/libkonsoleprivate.so.20
#9  0x00007fd62af0ba29 in Konsole::TerminalDisplay::applyProfile(QExplicitlySharedDataPointer<Konsole::Profile> const&) () from /lib64/libkonsoleprivate.so.20
#10 0x00007fd62aec333b in Konsole::ViewManager::applyProfileToView(Konsole::TerminalDisplay*, QExplicitlySharedDataPointer<Konsole::Profile> const&) () from /lib64/libkonsoleprivate.so.20
Comment 7 ninjalj 2021-05-23 18:33:03 UTC
*** Bug 436787 has been marked as a duplicate of this bug. ***
Comment 8 ninjalj 2021-05-23 18:33:56 UTC
*** Bug 437559 has been marked as a duplicate of this bug. ***
Comment 9 ninjalj 2021-05-23 18:35:58 UTC
*** Bug 437070 has been marked as a duplicate of this bug. ***
Comment 10 Ahmad Samir 2021-05-24 10:10:51 UTC
If someone who's hitting the crash could test: https://invent.kde.org/utilities/konsole/-/merge_requests/396
Comment 11 Bug Janitor Service 2021-05-24 12:33:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/397
Comment 12 ninjalj 2021-05-24 18:45:08 UTC
*** Bug 437621 has been marked as a duplicate of this bug. ***
Comment 13 Ahmad Samir 2021-05-24 19:08:34 UTC
Git commit b7f6849d287459ca03f8b0e6ab1c4770a9a9ce28 by Ahmad Samir.
Committed on 24/05/2021 at 10:07.
Pushed by hindenburg into branch 'master'.

Fix type of randomSeed parameter

It should be uint. I am not sure this fixes the mentioned bug, but it's
correct anyway, std::mt19937 and co. unsigned types; and we shouldn't mix
signed with unsigned.

M  +1    -1    src/terminalDisplay/TerminalColor.cpp
M  +1    -1    src/terminalDisplay/TerminalColor.h

https://invent.kde.org/utilities/konsole/commit/b7f6849d287459ca03f8b0e6ab1c4770a9a9ce28
Comment 14 Kurt Hindenburg 2021-05-24 19:09:29 UTC
Git commit 8c24953bdefc28fa7f1db1d0b77f855f3c1ec952 by Kurt Hindenburg, on behalf of Luis Javier Merino Morán.
Committed on 24/05/2021 at 19:08.
Pushed by hindenburg into branch 'master'.

Fix crash when using a color scheme with random colors

A new assert in GCC 11.1.0 std::piecewise_linear_distribution fails in
the case that the lower and upper boundaries are equal.  So, make sure
to not construct a std::piecewise_linear_distribution when minSaturation
equals maxSaturation and when minLightness equals maxLightness.

M  +19   -13   src/colorscheme/ColorScheme.cpp

https://invent.kde.org/utilities/konsole/commit/8c24953bdefc28fa7f1db1d0b77f855f3c1ec952
Comment 15 Kurt Hindenburg 2021-05-24 19:28:55 UTC
Git commit b246ac57ee8000e15e71d833701fbcab0b780f20 by Kurt Hindenburg, on behalf of Luis Javier Merino Morán.
Committed on 24/05/2021 at 19:23.
Pushed by hindenburg into branch 'release/21.04'.

Fix crash when using a color scheme with random colors

A new assert in GCC 11.1.0 std::piecewise_linear_distribution fails in
the case that the lower and upper boundaries are equal.  So, make sure
to not construct a std::piecewise_linear_distribution when minSaturation
equals maxSaturation and when minLightness equals maxLightness.
(cherry picked from commit 8c24953bdefc28fa7f1db1d0b77f855f3c1ec952)

M  +19   -13   src/colorscheme/ColorScheme.cpp

https://invent.kde.org/utilities/konsole/commit/b246ac57ee8000e15e71d833701fbcab0b780f20
Comment 16 Kurt Hindenburg 2021-05-24 19:29:03 UTC
Git commit 4177f5c01568b31f3d5c1ff20cde3841eec97f08 by Kurt Hindenburg, on behalf of Ahmad Samir.
Committed on 24/05/2021 at 19:23.
Pushed by hindenburg into branch 'release/21.04'.

Fix type of randomSeed parameter

It should be uint. I am not sure this fixes the mentioned bug, but it's
correct anyway, std::mt19937 and co. unsigned types; and we shouldn't mix
signed with unsigned.
(cherry picked from commit b7f6849d287459ca03f8b0e6ab1c4770a9a9ce28)

M  +1    -1    src/terminalDisplay/TerminalColor.cpp
M  +1    -1    src/terminalDisplay/TerminalColor.h

https://invent.kde.org/utilities/konsole/commit/4177f5c01568b31f3d5c1ff20cde3841eec97f08