Bug 363749 - kscreenlocker_greet will not accept password and taking 4.9 GiB
Summary: kscreenlocker_greet will not accept password and taking 4.9 GiB
Status: RESOLVED NOT A BUG
Alias: None
Product: kscreenlocker
Classification: Unmaintained
Component: greeter (other bugs)
Version First Reported In: 5.5.5
Platform: Kubuntu Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-31 15:55 UTC by Joshua Clayton
Modified: 2018-07-19 10:00 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
valgrind kscreen log for 1 minute (852.66 KB, text/x-log)
2017-01-18 15:39 UTC, s
Details
attachment-21126-0.html (259 bytes, text/html)
2017-01-19 13:17 UTC, Martin Flöser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Clayton 2016-05-31 15:55:39 UTC
After a weekend away, kscreenlocker_greet allows me to type my password, but will not accept the correct password. switching to a console terminal, I notice the process is taking 41% of the systme memory, which is about 4.92 GiB.

When I kill the kscreenlocker_greet process, another is spawned. This new kcscreenlocker_greet process accepts the password and I am able to log in.

Reproducible: Always

Steps to Reproduce:
1. Leave for several days
2. Try to log in
3.

Actual Results:  
Unable to log in

Expected Results:  
Password accepted, process taking very little memory

The first time this happened, I changed my password, thinking that something had happened. I would like to troubleshoot this more, but not sure how to proceed. This has happened for three weeks now, and the process is still running when I come back in to work. Is there a way to run ksceenlocker_greet on valgrind or something?
Comment 1 Martin Flöser 2016-06-01 08:19:08 UTC
you can run the actual binary of kscreenlocker_greet with --testing through gdb or valgrind. Though there is a chance that the actual problem won't be hit when in test mode.
Comment 2 s 2017-01-18 14:42:27 UTC
I can confirm this bug. It's still appear with kscreenlocker versions 5.8.3 - 5.8.5.

Memory leak amount is ~ 250mB per hour. 

In testing mode it produce:

***
QOpenGLShader::link: error: program lacks a fragment shader

shader compilation failed: 
"error: program lacks a fragment shader\n"
QOpenGLShader::link: error: program lacks a fragment shader

QOpenGLShader::compile(Fragment): 0:6(2): error: No precision specified in this scope for type `vec4'
0:7(2): error: No precision specified in this scope for type `float'
0:8(2): error: No precision specified in this scope for type `float'
0:9(2): error: No precision specified in this scope for type `float'
0:9(22): error: initializer of global variable `outerRadius' must be a constant expression
0:10(2): error: No precision specified in this scope for type `vec4'
0:13(2): error: No precision specified in this scope for type `vec4'
0:15(2): error: No precision specified in this scope for type `vec2'
0:16(2): error: No precision specified in this scope for type `float'

*** Problematic Fragment shader source code ***
#ifndef GL_FRAGMENT_PRECISION_HIGH
#define highp mediump
#endif
#line 1

                        varying highp vec2 qt_TexCoord0;
                        uniform highp float qt_Opacity;
                        uniform lowp sampler2D source;

                        uniform vec4 colorBorder;
                        float blend = 0.01;
                        float innerRadius = 0.47;
                        float outerRadius = innerRadius + 0.02;
                        vec4 colorEmpty = vec4(0.0, 0.0, 0.0, 0.0);

                        void main() {
                            vec4 colorSource = texture2D(source, qt_TexCoord0.st);

                            vec2 m = qt_TexCoord0 - vec2(0.5, 0.5);
                            float dist = sqrt(m.x * m.x + m.y * m.y);

                            if (dist < innerRadius)
                                gl_FragColor = colorSource;
                            else if (dist < innerRadius + blend)
                                gl_FragColor = mix(colorSource, colorBorder, ((dist - innerRadius) / blend));
                            else if (dist < outerRadius)
                                gl_FragColor = colorBorder;
                            else if (dist < outerRadius + blend)
                                gl_FragColor = mix(colorBorder, colorEmpty, ((dist - outerRadius) / blend));
                            else
                                gl_FragColor = colorEmpty ;

                            gl_FragColor = gl_FragColor * qt_Opacity;
                    }
        
***
Comment 3 s 2017-01-18 15:39:24 UTC
Created attachment 103490 [details]
valgrind kscreen log for 1 minute

Attaching valgrind log
Comment 4 Martin Flöser 2017-01-18 16:39:07 UTC
Are you using an OpenGL es build of Qt?
Comment 5 s 2017-01-18 17:22:18 UTC
(In reply to Martin Gräßlin from comment #4)
> Are you using an OpenGL es build of Qt?

98% sure that answer is yes. I can check check it tomorrow.

I saw bug somewhere around regarding qt + gles and "error: program lacks a fragment shader", but it seems that there were no information about memory leaks.
Comment 6 Martin Flöser 2017-01-18 17:29:50 UTC
> 98% sure that answer is yes.

If it is: switch to normal OpenGL (in case you are a Gentoo user this requires a full(!) rebuild of everything of Qt and everything depending on Qt). OpenGL ES is not (!) intended to be used on normal desktop systems. The memory leak you are experience might be a side effect of the broken OpenGL setup.
Comment 7 Martin Flöser 2017-01-18 17:31:55 UTC
And yes, the valgrind log shows you are using OpenGL ES and it's full of errors due to that.
Comment 8 s 2017-01-18 17:36:17 UTC
(In reply to Martin Gräßlin from comment #6)
> > 98% sure that answer is yes.
> 
> If it is: switch to normal OpenGL (in case you are a Gentoo user this
> requires a full(!) rebuild of everything of Qt and everything depending on
> Qt). OpenGL ES is not (!) intended to be used on normal desktop systems. The
> memory leak you are experience might be a side effect of the broken OpenGL
> setup.

Thanks, I'll try. But I'm not sure that it will be ok, because sometimes I test wayland and other DEs which require gles. And as far as I remember on some packages emerge requires choosing one of opengl or gles.
Comment 9 s 2017-01-18 17:38:37 UTC
By the way kscreenlocker is only program (installed on my computer) that causing such memory leak.
Comment 10 Martin Flöser 2017-01-18 18:36:30 UTC
> wayland and other DEs which require gles.

Wayland does not (!) require GLES.
Comment 11 s 2017-01-18 21:43:31 UTC
(In reply to Martin Gräßlin from comment #10)
> > wayland and other DEs which require gles.
> 
> Wayland does not (!) require GLES.

Wayland by itself not require gles. But other DEs require gles to run (compile) with wayland support.
Comment 12 Martin Flöser 2017-01-19 05:22:02 UTC
Am 18. Januar 2017 22:43:31 MEZ schrieb bugzilla_noreply@kde.org:
>https://bugs.kde.org/show_bug.cgi?id=363749
>
>--- Comment #11 from s@zxc.pp.ua ---
>(In reply to Martin Gräßlin from comment #10)
>> > wayland and other DEs which require gles.
>> 
>> Wayland does not (!) require GLES.
>
>Wayland by itself not require gles. But other DEs require gles to run
>(compile)
>with wayland support.

No, is an old Linux myth. Just think about it, that wouldn't work anywhere, no distro compiles with gles.

This problem only exists for Gentoo users.
Comment 13 s 2017-01-19 10:31:15 UTC
(In reply to Martin Gräßlin from comment #12)
 
> No, is an old Linux myth. Just think about it, that wouldn't work anywhere,
> no distro compiles with gles.
> 
> This problem only exists for Gentoo users.

It's not true :).

dev-libs/efl:

configure: error: Full OpenGL with EGL is not supported, please add --with-opengl=es to your configure 
options to switch to EGL + OpenGL ES.
Comment 14 Martin Flöser 2017-01-19 13:17:29 UTC
Created attachment 103532 [details]
attachment-21126-0.html

We don't need to discuss this

The problem that users have incorrectly Gles is always gentoo. Guess why I immediately jumped to the conclusion that you use Gentoo.

Gles an gl are not mutual exclusive in the system. But in Qt they are.
Comment 15 Alexander Mentyu 2018-07-19 09:35:27 UTC
Can this issue safely be closed?
Comment 16 David Edmundson 2018-07-19 10:00:54 UTC
Yes, that shader is fixed for GLES. 

But OPs setup is also being weird for no reason.

Though it's weird that stderr allegedly causes memory to go up. That shouldn't happen.