Bug 462403 - Possible race condition
Summary: Possible race condition
Status: REPORTED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-29 18:57 UTC by Gergely HORVÁTH
Modified: 2022-11-29 18:57 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gergely HORVÁTH 2022-11-29 18:57:08 UTC
I was looking at the source and I was wondering if these lines introduce some race condition: https://invent.kde.org/network/kdeconnect-kde/-/blob/master/plugins/mprisremote/mprisremoteplayer.cpp#L64-L73

My thought is the following: if newLength differs from m_length, first the SIGNAL is sent out, than later the value of the variable is updated. Isn't it possible, that the SLOT activates before the variable update happens so the function still receives the older version of the variable value?

Disclaimer: Although I have some programming background and experience related to my job, I have no formal training and also I lack experience with multi threaded applications.