Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322042

Summary: uninitialized template member in edc JUnit resource Templates.h can cause HEAP allocation failure
Product: [Tools] CDT Reporter: Kirk Beitz <kirk.beitz>
Component: cdt-debug-edcAssignee: Ken Ryall <ken.ryall>
Status: RESOLVED FIXED QA Contact: Ken Ryall <ken.ryall>
Severity: normal    
Priority: P3 CC: cdtdoug, ed.swartz
Version: 7.0   
Target Milestone: 8.0   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
initializes variable that leads to HEAP allocation failure cdtdoug: iplog+

Description Kirk Beitz CLA 2010-08-07 01:51:54 EDT
in org.eclipse.cdt.debug.edc.tests, resources/Projects/SimpleCpp/inc/Templates.h contains a Template function that has an uninitialized member that can cause a calculation which results in attempting to allocate a *very* large chunk of heap, and will result in a reported HEAP allocation failure.

this probably hasn't been seen previously, because if the memory associated with that variable is 0 (as is probably often the case) or even just small, the failure wouldn't occur, and any testing using this resource would succed.

the attached Templates.h.patch initializes the variable that leads to this problem.
Comment 1 Kirk Beitz CLA 2010-08-07 01:53:00 EDT
Created attachment 176079 [details]
initializes variable that leads to HEAP allocation failure
Comment 2 Ken Ryall CLA 2010-08-09 01:52:56 EDT
Committed patch to HEAD,
Comment 3 CDT Genie CLA 2010-08-09 02:23:02 EDT
*** cdt cvs genie on behalf of kryall ***
Bug 322042 -  uninitialized template member in edc JUnit resource Templates.h can cause HEAP allocation failure

[*] Templates.h 1.2 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/edc/org.eclipse.cdt.debug.edc.tests/resources/Projects/SimpleCpp/inc/Templates.h?root=Tools_Project&r1=1.1&r2=1.2