Frama-C Bug Tracking System - Frama-C
View Issue Details
0001093Frama-CPlug-in > jessiepublic2012-02-13 14:052012-02-14 09:05
Frama-C Nitrogen-20111001 
0001093: Passing multi-dimensional arrays via reference fails
Starting from the simple function #define MAX_SIZE_X 10 typedef int AnArray[MAX_SIZE_X]; void FillArray(AnArray *paTarget, int Value) { int x = 0; for (x = 0; x < MAX_SIZE_X; x++) { (*paTarget)[x] = Value; } } the code above is accepted by Jessie and can be verified (annotations removed for brevity here), but as AnArray is extended to two or more dimensions (typedef int AnArray[MAX_SIZE_X][MAX_SIZE_Y]...) - and the filling loops adapted to match - jessie crashes on loading the source file.
Tested with Frama-C/Nitrogen, why-2.30 and why3-0.71 compiled in cygwin. Loading the code samples in "regular" Frama-C GUI or using WP plug-in does not cause a crash. I actually encountered this when analyzing the tree-dimensional case (parallelized matrix operations); this is the smallest form i found which shows the problem. More variants can be created, e.g. by moving one array dimension from the typedef into the actual argument (AnArray *paTarget[MAX_SIZE_X], int Value). Attached file contains four C sources to demonstrate the problem (to be split at the comment boxes), accompanied by their stacktraces.
No tags attached.
related to 0000032assigned cmarche Internal error with assign specification on bi-dimensional arrays 
txt SamplePrograms.txt (18,509) 2012-02-13 14:05
Issue History
2012-02-13 14:05flecsimNew Issue
2012-02-13 14:05flecsimStatusnew => assigned
2012-02-13 14:05flecsimAssigned To => cmarche
2012-02-13 14:05flecsimFile Added: SamplePrograms.txt
2012-02-14 09:05virgileRelationship addedrelated to 0000032

There are no notes attached to this issue.