|
Status: Draft Weakness ID: 572 (Weakness Variant)Description Summary The program calls a thread's run() method instead of calling start(), which causes the code to run in the thread of the caller instead of the callee. Affected Resources System ProcessPotential Mitigations Use the start() method instead of the run() method. Demonstrative Examples The following excerpt from a Java program mistakenly calls run() instead of start(). Thread thr = new Thread() { public void run() { ... } }; thr.run();
Other Notes In most cases a direct call to a Thread object's run() method is a bug. The programmer intended to begin a new thread of control, but accidentally called run() instead of start(), so the run() method will execute in the caller's thread of control. Relationships
Applicable Platforms Languages Java Time of Introduction ImplementationContent History Modifications Eric Dalci. Cigital. 2008-07-01. (External) updated Potential_Mitigations, Time_of_Introduction CWE Content Team. MITRE. 2008-09-08. (Internal) updated Relationships, Other_Notes Previous Entry Names Call to Thread.run() (changed 2008-04-11) |
|
|
|||