Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Parasoft Jtest 2021.1

...

Starting and using background threads during class initialization can result in deadlock.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

TSM02-J

Low

Probable

High

P2

L3

Automated Detection

ToolVersionCheckerDescription
CodeSonar
Parasoft Jtest
Include Page
CodeSonar
Parasoft_V
CodeSonar
Parasoft_V
FB
CERT.
MT_CORRECTNESS.SC_START_IN_CTOR
TSM02.CSTARTDo not call the "start" method of threads from inside a constructor
SonarQube
Constructor invokes Thread.start()Parasoft Jtest9.5TRS.CSTARTImplementedSonarQube Java Plugin
Include Page
SonarQube
Java Plugin
_V
SonarQube
Java Plugin
_V
S2693
 
Threads should not be started in constructors

Bibliography

[Bloch 2005b]

Chapter 8, "Lazy Initialization"

[Grand 2002]

Chapter 5, "Creational Patterns, Singleton"

Issue Tracking

Tasklist
Review List
Review List
||Completed||Priority||Locked||CreatedDate||CompletedDate||Assignee||Name||
|T|M|F|1269649993019|1269700561582|rcs_mgr|"Starting and using background threads during class initialization can result in class initialization cycles and deadlock. *For instance,* the main thread responsible for performing class initialization *may* block waiting for the background thread, which in turn will wait for the main thread to finish class initialization." ... see suggested words in bold...I am also generally unsure about the use of "can" vs. "may" because deadlocks are a "possibility" so perhaps "may" should be used?|

...


...