SAMATE Logo NIST Logo The SAMATE Project Department of Homeland Security
Downloads:  Download this Test Case #154571

Back to the previous page... Back to the previous page

Test Case IDCandidate154571
Bad / Good / MixedBadBad test case
AuthorIARPA STONESOUP Test and Evaluation team
Test suite: 102  
Application: 11  
Added byCharles Oliveira
Type of test caseSource Code
Input string
Expected Output
See src/build.xml and src/maven-build.xml.
Submission date2015-10-06
DescriptionThis weakness takes an integer, two file names, and an integer "int file1 file2 int" as an input. The first integer is the size of the array to sort for timing in benign cases without FIFO files as inputs. The two files are used for thread "scheduling", if they are FIFO files in the order "fifo1 fifo2" with respect to the input script the weakness will occur, and if they are in reverse order the weakness will not occur. If the files are given as normal files, the weakness is dependent on the quicksort where a low quicksort value is nondeterministic and a larger value will increase the likelihood that the weakness will not occur. The final integer is the number of Fibonacci values to calculate and print. This weakness uses a singleton class to pass the Fibonacci values between the thread calculating them and the thread printing them. The method of instantiating a singleton used contains a race condition that can lead to multiple instances of the class being instantiated, leading to deadlock.
- Base program: Apache Jena
- Data Type: ARRAY
- Control Flow: SEQUENCE

There are no comments
Have any comments on this test case? Please, .

File Contains:
CWE-543: Use of Singleton Pattern Without Synchronization in a Multithreaded Context on line(s): 943, 944, 945






Contact: :: Created: Jan. 2006 :: Updated: Nov. 2017 :: Version: 4.9