View Issue Details

IDProjectCategoryView StatusLast Update
0000014Campy[All Projects] Generalpublic2018-04-26 11:27
ReporteradministratorAssigned Toadministrator 
PrioritynormalSeverityblockReproducibilityhave not tried
Status assignedResolutionopen 
Summary0000014: BCL meta lookup for nested types, such as closure objects, can pick up wrong typedef.
DescriptionIn the Pre-scan test, there are a number of class definitions defined internally for the lambda functions/kernels. The code that finds the meta is supposed to go through the nested classes, looking for the type. Unfortunately, the type system discovers a type that has zero fields, and zero size (meaning there are no variables captured). Heap_Alloc of zero is valid and returns a zero-length block. When the closure is copied to the allocated buffer, write overrun occurs. Eventunally, the heap allocation routine crashes with segv because of buffer overrun clobbering the data structures.
TagsNo tags attached.



2018-04-26 10:42

administrator   ~0000014

The data type found is correct. The size of the type is zero because it is a computed value. Fixing that, I now notice it's wrong because the size of a pointer should be 8 in the computation.


2018-04-26 11:27

administrator   ~0000015

The size information for basic types is incorrect. See Type_Init() in .../Campy.Runtime/Native/Type.c. tTypeInit has "4" for various pointer types instead of sizeof(void*) in order to make this platform independent. I'll correct for now, but this must be gone through very carefully. I do not understand this code.

Issue History

Date Modified Username Field Change
2018-04-26 02:13 administrator New Issue
2018-04-26 02:13 administrator Status new => assigned
2018-04-26 02:13 administrator Assigned To => administrator
2018-04-26 10:42 administrator Note Added: 0000014
2018-04-26 11:27 administrator Note Added: 0000015