By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 1423

Summary: TDMTSAK/TSAK (Secure login dialog support) cause key-presses to be eaten, stuck and modifiers to blocks.
Product: TDE Reporter: Pavel Pisa <ppisa4lists>
Component: tdebaseAssignee: Slávek Banko <slavek.banko>
Status: RESOLVED FIXED    
Severity: blocker CC: bugwatch, kb9vqf, midenok, slavek.banko
Priority: P5    
Version: R14.0.0 [Trinity]   
Hardware: amd64   
OS: Debian Wheezy   
Compiler Version: TDE Version String:
Application Version: Application Name:
Attachments: Fix looping in replication EV_MSC events

Description Pavel Pisa 2013-03-24 03:39:59 CDT
When TDM is used as login manager on Debian Wheezy, it activates secure login dialog by default. The /opt/trinity/bin/tdmtsak and /opt/trinity/bin/tsak programs are running during Xorg session. Xorg do not use /dev/input/eventX and only open event is /dev/input/event0 by /opt/trinity/bin/tsak (it is open three times). Desktop session keyboard is unusable then. Disabling SAK dialog resolves the problem

--- /etc/trinity/tdm/tdmrc
+++ /etc/trinity/tdm/tdmrc
@@ -303,7 +303,7 @@ ClientLogFile=.xsession-errors-%s
 #WindowManager=
 # SAK
 # Default is true
-#UseSAK=false
+UseSAK=false
 # Admin session
 # Default is false
 #UseAdminSession=true

Even when SAK is disable then number of /dev/input/eventX opened by TDM components is suspicious

Xorg      2581             root   11u      CHR              13,66      0t0       4409 /dev/input/event2
Xorg      2581             root   12u      CHR              13,65      0t0       4407 /dev/input/event1
Xorg      2581             root   13u      CHR              13,64      0t0       4406 /dev/input/event0
Xorg      2581             root   14u      CHR              13,68      0t0       5156 /dev/input/event4
tdm_greet 4057             root   15r      CHR              13,66      0t0       4409 /dev/input/event2
tdm_greet 4057             root   16r      CHR              13,65      0t0       4407 /dev/input/event1
tdm_greet 4057             root   18r      CHR              13,69      0t0       4764 /dev/input/event5
tdm_greet 4057             root   19r      CHR              13,74      0t0       5087 /dev/input/event10
tdm_greet 4057             root   20r      CHR              13,75      0t0       5088 /dev/input/event11
tdm_greet 4057             root   21r      CHR              13,76      0t0       5089 /dev/input/event12
tdm_greet 4057             root   22r      CHR              13,70      0t0       5083 /dev/input/event6
tdm_greet 4057             root   23r      CHR              13,71      0t0       5084 /dev/input/event7
tdm_greet 4057             root   24r      CHR              13,72      0t0       5085 /dev/input/event8
tdm_greet 4057             root   25r      CHR              13,73      0t0       5086 /dev/input/event9
tdm_greet 4057             root   26r      CHR              13,64      0t0       4406 /dev/input/event0
tdm_greet 4057             root   27r      CHR              13,68      0t0       5156 /dev/input/event4
tdm_greet 4057             root   28r      CHR              13,67      0t0       4412 /dev/input/event3
krootimag 4058             root   15r      CHR              13,66      0t0       4409 /dev/input/event2
krootimag 4058             root   16r      CHR              13,65      0t0       4407 /dev/input/event1
krootimag 4058             root   18r      CHR              13,69      0t0       4764 /dev/input/event5
krootimag 4058             root   19r      CHR              13,74      0t0       5087 /dev/input/event10
krootimag 4058             root   20r      CHR              13,75      0t0       5088 /dev/input/event11
krootimag 4058             root   21r      CHR              13,76      0t0       5089 /dev/input/event12
krootimag 4058             root   22r      CHR              13,70      0t0       5083 /dev/input/event6
krootimag 4058             root   23r      CHR              13,71      0t0       5084 /dev/input/event7
krootimag 4058             root   24r      CHR              13,72      0t0       5085 /dev/input/event8
krootimag 4058             root   25r      CHR              13,73      0t0       5086 /dev/input/event9
krootimag 4058             root   26r      CHR              13,64      0t0       4406 /dev/input/event0
krootimag 4058             root   27r      CHR              13,68      0t0       5156 /dev/input/event4
krootimag 4058             root   28r      CHR              13,67      0t0       4412 /dev/input/event3
twin      4061             root   15r      CHR              13,66      0t0       4409 /dev/input/event2
twin      4061             root   16r      CHR              13,65      0t0       4407 /dev/input/event1
twin      4061             root   18r      CHR              13,69      0t0       4764 /dev/input/event5
twin      4061             root   19r      CHR              13,74      0t0       5087 /dev/input/event10
twin      4061             root   20r      CHR              13,75      0t0       5088 /dev/input/event11
twin      4061             root   21r      CHR              13,76      0t0       5089 /dev/input/event12
twin      4061             root   22r      CHR              13,70      0t0       5083 /dev/input/event6
twin      4061             root   23r      CHR              13,71      0t0       5084 /dev/input/event7
twin      4061             root   24r      CHR              13,72      0t0       5085 /dev/input/event8
twin      4061             root   25r      CHR              13,73      0t0       5086 /dev/input/event9
twin      4061             root   26r      CHR              13,64      0t0       4406 /dev/input/event0
twin      4061             root   27r      CHR              13,68      0t0       5156 /dev/input/event4
twin      4061             root   28r      CHR              13,67      0t0       4412 /dev/input/event3
dcopserve 4064             root   15r      CHR              13,66      0t0       4409 /dev/input/event2
dcopserve 4064             root   16r      CHR              13,65      0t0       4407 /dev/input/event1
dcopserve 4064             root   18r      CHR              13,69      0t0       4764 /dev/input/event5
dcopserve 4064             root   19r      CHR              13,74      0t0       5087 /dev/input/event10
dcopserve 4064             root   20r      CHR              13,75      0t0       5088 /dev/input/event11
dcopserve 4064             root   21r      CHR              13,76      0t0       5089 /dev/input/event12
dcopserve 4064             root   22r      CHR              13,70      0t0       5083 /dev/input/event6
dcopserve 4064             root   23r      CHR              13,71      0t0       5084 /dev/input/event7
dcopserve 4064             root   24r      CHR              13,72      0t0       5085 /dev/input/event8
dcopserve 4064             root   25r      CHR              13,73      0t0       5086 /dev/input/event9
dcopserve 4064             root   26r      CHR              13,64      0t0       4406 /dev/input/event0
dcopserve 4064             root   27r      CHR              13,68      0t0       5156 /dev/input/event4
dcopserve 4064             root   28r      CHR              13,67      0t0       4412 /dev/input/event3

State after login seems to be normal (When SAK is disabled)

Xorg      2581             root   11u      CHR              13,66      0t0       4409 /dev/input/event2
Xorg      2581             root   12u      CHR              13,65      0t0       4407 /dev/input/event1
Xorg      2581             root   13u      CHR              13,64      0t0       4406 /dev/input/event0
Xorg      2581             root   14u      CHR              13,68      0t0       5156 /dev/input/event4
Comment 1 Slávek Banko 2013-04-02 18:32:46 CDT
Today I tested TDE 3.5.13.2 on Ubuntu Raring and I have observed very similar behavior. I noticed that after login into TDE two processes tsak together produce load on a CPU.

With gdb I found that is constantly replicated events between keyboards, although nobody touches to one present keyboard.

#0  0x00007feb42c77af0 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:81
#1  0x00000000004032de in main (argc=1, argv=0x7fff331219a8)
    at /tmp/buildd/kdebase-trinity-3.5.13/tsak/main.cpp:613

With Ubuntu Quantal and Debian Squeeze (with kernel from backports) on the same machine the problem does not occur.
Comment 2 Timothy Pearson 2013-04-02 22:44:28 CDT
(In reply to comment #1)
> Today I tested TDE 3.5.13.2 on Ubuntu Raring and I have observed very similar
> behavior. I noticed that after login into TDE two processes tsak together
> produce load on a CPU.
> 
> With gdb I found that is constantly replicated events between keyboards,
> although nobody touches to one present keyboard.
> 
> #0  0x00007feb42c77af0 in __read_nocancel () at
> ../sysdeps/unix/syscall-template.S:81
> #1  0x00000000004032de in main (argc=1, argv=0x7fff331219a8)
>     at /tmp/buildd/kdebase-trinity-3.5.13/tsak/main.cpp:613
> 
> With Ubuntu Quantal and Debian Squeeze (with kernel from backports) on the same
> machine the problem does not occur.

Yes, I am noticing the problem myself on Debian Wheezy with some hardware combinations.  Something has definitely changed in the kernel or evdev!

The effect on one Wheezy test system is even worse; pressing a single key, then pressing a second key while the first is still depressed causes both keystrokes to disappear and not be passed on to X11.

I will be looking into this as soon as I have time.

Tim
Comment 3 Slávek Banko 2013-04-03 11:42:54 CDT
Created attachment 1129 [details]
Fix looping in replication EV_MSC events

I noticed that when replicating EV_LED events from virtual to physical keyboards are also replicated EV_MSC events. But when copying events from physical keyboard to virtual, are excluded only EV_LED events == EV_MSC events thus causing an infinite loop.

Please check the attached patch. For me the problem with CPU overhead is solved. And I not observe any regression.
Comment 4 Timothy Pearson 2013-04-03 15:45:56 CDT
(In reply to comment #3)
> Created attachment 1129 [details]
> Fix looping in replication EV_MSC events
> 
> I noticed that when replicating EV_LED events from virtual to physical
> keyboards are also replicated EV_MSC events. But when copying events from
> physical keyboard to virtual, are excluded only EV_LED events == EV_MSC events
> thus causing an infinite loop.
> 
> Please check the attached patch. For me the problem with CPU overhead is
> solved. And I not observe any regression.

This resolves the problems experienced here as well.  Good work!

Slightly modified and pushed to GIT in hash 86cc65c, along with a few other improvements.
Comment 5 Michele Calgaro 2014-05-20 08:11:18 CDT
*** Bug 2053 has been marked as a duplicate of this bug. ***