Skip to content

Data race in static Kronos.Clock.annotatedNow.getter #85

Description

@Usipov

Screenshot 2021-04-19 at 18 57 52

Screenshot 2021-04-19 at 19 01 41


WARNING: ThreadSanitizer: data race (pid=97366)
  Read of size 8 at 0x0001164e9888 by thread T4:
    #0 static Clock.annotatedNow.getter <null>:2 (Kronos:x86_64+0x26a76ca)
    #1 static Clock.now.getter <null>:2 (Kronos:x86_64+0x26a747d)

  Previous write of size 8 at 0x0001164e9888 by main thread:
    #0 static Clock.stableTime.setter <null>:2 (Kronos:x86_64+0x26a6dcf)
    #1 closure #1 in static Clock.sync(from:samples:first:completion:) <null>:2 (Kronos:x86_64+0x26a827e)
    #2 partial apply for closure #1 in static Clock.sync(from:samples:first:completion:) <null>:2 (Kronos:x86_64+0x26a86b5)
    #3 $defer #1 () in closure #1 in closure #1 in NTPClient.query(pool:version:port:numberOfSamples:maximumServers:timeout:progress:) <null>:2 (Kronos:x86_64+0x26b7cf7)
    #4 closure #1 in closure #1 in NTPClient.query(pool:version:port:numberOfSamples:maximumServers:timeout:progress:) <null>:2 (Kronos:x86_64+0x26b783c)
    #5 partial apply for closure #1 in closure #1 in NTPClient.query(pool:version:port:numberOfSamples:maximumServers:timeout:progress:) <null>:2 (Kronos:x86_64+0x26bd6f8)
    #6 closure #1 in NTPClient.query(ip:port:version:timeout:numberOfSamples:completion:) <null>:2 (Kronos:x86_64+0x26b9af7)
    #7 partial apply for closure #1 in NTPClient.query(ip:port:version:timeout:numberOfSamples:completion:) <null>:2 (Kronos:x86_64+0x26bdb8e)
    #8 thunk for @escaping @callee_guaranteed (@guaranteed Data?, @unowned Double) -> () <null>:2 (Kronos:x86_64+0x26ba39d)
    #9 closure #1 in NTPClient.sendAsyncUDPQuery(to:port:timeout:completion:) <null>:2 (Kronos:x86_64+0x26bd0dd)
    #10 @objc closure #1 in NTPClient.sendAsyncUDPQuery(to:port:timeout:completion:) <null>:2 (Kronos:x86_64+0x26bd1f3)
    #11 __CFSocketPerformV0 <null>:2 (CoreFoundation:x86_64+0x92fd9)
    #12 start <null>:2 (libdyld.dylib:x86_64+0x1408)

  Location is global 'static Clock.stableTime' at 0x0001164e9888 (Kronos+0x000005b96888)

  Thread T4 (tid=1302869, running) is a GCD worker thread

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions