Skip to content

Commit

Permalink
desauto: initialize the comment array to a sensible value
Browse files Browse the repository at this point in the history
If left uninitialized, the comment array is passed down to client code
without being even written to, which means it contains whatever happens
to be on the stack whenever the frame for `main` is created. Recent
changes to glibc start code have changed said content, and the new one
happens to break the test suite when propagated into some temporary
files that are then fed to the main leonconv binary.

That explains why using ThreadSanitizer "fixes" the test suite:
presumably, the runtime initialization code happens to write in that
aread of the stack and changes yet again the contents of the comment
array, which happens to suit whatever expectations are in leonconv.

Fixes #98
  • Loading branch information
schopin-pro committed Aug 21, 2024
1 parent 6824a6b commit 3d6cdfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/leon/src/desauto.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ int main( int argc, char *argv[])
char tempArg[8];
enum { DESIGN_AUTO, DESIGN_ISO, MATRIX_AUTO, MATRIX_ISO, CODE_AUTO,
CODE_ISO} computationType = DESIGN_AUTO;
char comment[1024];
char comment[1024] = "";

/* Check whether the first parameters are iso, code, or matrix.
Set the computation type. */
Expand Down

0 comments on commit 3d6cdfd

Please sign in to comment.