Project

General

Profile

Actions

Bug #1281

closed

Data Races

Added by Jin Huang over 3 years ago. Updated over 3 years ago.

Status:
Invalid
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
08/14/2020
Due date:
% Done:

0%

Estimated time:

Description

Data Race 1: WW

Variable: crdp, defined at src/urcu-call-rcu-impl.h:424

Thread1: userspace-rcu/src/urcu-call-rcu-impl.h:211, inside function set_thread_cpu_affinity:

if (++crdp->gp_count & SET_AFFINITY_CHECK_PERIOD_MASK)

Call order:

(1)pthread_create [src/urcu-call-rcu-impl.h:437]
(2)call_rcu_thread [src/urcu-call-rcu-impl.h:437]
(3)set_thread_cpu_affinity [src/urcu-call-rcu-impl.h:318]

Thread2: userspace-rcu/src/urcu-call-rcu-impl.h:211, inside function set_thread_cpu_affinity:

if (++crdp->gp_count & SET_AFFINITY_CHECK_PERIOD_MASK)

Call order:

(1)pthread_create [src/urcu-call-rcu-impl.h:437]
(2)call_rcu_thread [src/urcu-call-rcu-impl.h:437]
(3)set_thread_cpu_affinity [src/urcu-call-rcu-impl.h:318]

Data Race 2: RW

Variable: crdp, defined at src/urcu-call-rcu-impl.h:424

Thread1: userspace-rcu/src/urcu-call-rcu-impl.h:433, inside function call_rcu_data_init:

crdp->cpu_affinity = cpu_affinity;

Call order:

(1)perftest [src/rcutorture.h:590]
(2)perftestrun [src/rcutorture.h:244]
(3)urcu_signal_free_all_cpu_call_rcu_data [src/rcutorture.h:227]
(4)urcu_signal_get_default_call_rcu_data [src/urcu-call-rcu-impl.h:777]
(5)call_rcu_data_init [src/urcu-call-rcu-impl.h:572]

Thread2: userspace-rcu/src/urcu-call-rcu-impl.h:209, inside function set_thread_cpu_affinity:

if (crdp->cpu_affinity < 0)

Call order:

(1)pthread_create [src/urcu-call-rcu-impl.h:437]
(2)call_rcu_thread [src/urcu-call-rcu-impl.h:437]
(3)set_thread_cpu_affinity [src/urcu-call-rcu-impl.h:318]

Actions #1

Updated by Jonathan Rajotte Julien over 3 years ago

  • Description updated (diff)

Hi Jin,

Thanks for reporting this.

Would you be able to give more context? is this output from a tool? If so, which is it? Could you provide a reproducer or at least explain a bit how you found this?

Normally the more information and context you provide the faster it is for us to understand the issue and fix it. While the information you provided is a good start, it is a bit dry.

Cheers

Actions #2

Updated by Jin Huang over 3 years ago

Jonathan Rajotte Julien wrote in #note-1:

Hi Jin,

Thanks for reporting this.

Would you be able to give more context? is this output from a tool? If so, which is it? Could you provide a reproducer or at least explain a bit how you found this?

Normally the more information and context you provide the faster it is for us to understand the issue and fix it. While the information you provided is a good start, it is a bit dry.

Cheers

No, I did not reproduce it, because data races can be just detected through static analysis.
The tool I use is https://coderrect.com/

Actions #3

Updated by Jonathan Rajotte Julien over 3 years ago

Hi Jin,

No, I did not reproduce it, because data races can be just detected through static analysis.

Well they can also be "observed" otherwise, I think you will agree with me, they would not be relevant at all. :)

The tool I use is https://coderrect.com/

We will look into this.

Cheers

Actions #4

Updated by Jin Huang over 3 years ago

Jonathan Rajotte Julien wrote in #note-3:

Hi Jin,

No, I did not reproduce it, because data races can be just detected through static analysis.

Well they can also be "observed" otherwise, I think you will agree with me, they would not be relevant at all. :)

The tool I use is https://coderrect.com/

We will look into this.

Cheers

Hi, Jonathan
Did you look into the issue?
Thank you

Actions #5

Updated by Mathieu Desnoyers over 3 years ago

Data race 1 is impossible to trigger, because crdp->gp_count is always accessed from a single thread.

Actions #6

Updated by Mathieu Desnoyers over 3 years ago

Data race 2 is impossible to trigger, because crdp->cpu_affinity is initialized within call_rcu_data_init before the worker thread which invokes set_thread_cpu_affinity() is even created.

Actions #7

Updated by Mathieu Desnoyers over 3 years ago

  • Status changed from New to Invalid

Please validate that the scenarios presented by static analysis tools are possible by looking at the code before filing a bug.

Actions

Also available in: Atom PDF