Bug 5157 - shadow notification is race:y and can give false information
Summary: shadow notification is race:y and can give false information
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VNC (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.3.0
Assignee: Aaron Sowry
URL:
Keywords: hean01_tester, prosaic
Depends on:
Blocks:
 
Reported: 2014-05-22 10:56 CEST by Pierre Ossman
Modified: 2014-12-19 09:35 CET (History)
2 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2014-05-22 10:56:58 CEST
There's this FIXME in the code:

    # FIXME: We have a very small window for a race condition here, i.e. if
    #        start_byte happens to be in the middle of either a _CONNECT_STRING
    #        or a _DISCONNECT_STRING. We could seek back to the beginning of
    #        the line before parsing in order to close this window, but
    #        unfortunately this open up another window - two parse_log calls on
    #        the same line containing a _CONNECT_STRING or a _DISCONNECT_STRING.
    #        There is probably a solution to this, however the window is so
    #        small that it's not worth spending time on right now.

Unfortunately it seems it happens in practice now in issue 15241.

The code also has a race between stat():ing the file and actually reading it.

The proper solution is probably to keep the file open and do blocking reads on it. That would also get rid of the polling timer and make it properly event driven.
Comment 1 Aaron Sowry cendio 2014-06-03 14:09:28 CEST
r29041.
Comment 2 Henrik Andersson cendio 2014-10-08 10:07:02 CEST
Verified that the issue can be reproduced using following commands with ThinLinc 4.2.0, eg. no notification popup is show;

  echo -n "tl-shadow-notify: OpenAuthenticatedConnectio" >> xinit.log 
  echo "n" >> xinit.log 

and same test with ThinLinc build 4509 works as expected.

Note You need to log in before you can comment on or make changes to this bug.