You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to compile IMB with GCC 11.3 and link it against Intel MPI, however, it failed in the process.
Basically, the issue is with a fixed size string array (aux_string) that is insufficiently long to store a warning.
Ironically, it is supposed to show a message on an overflow, and is too large to fit into the string size.
The array is defined as:
#define out_fields 8;
#define ow_format 13;
extern char aux_string[out_fieldsow_format];
Meaning it is defined as an up to a 104 byte long message.
The message itself is 106 bytes long and needs an extra byte for null termination of a string (107 bytes).
It is guarded with a MPI1 pragma but I don't understand why it actually took that path.
I guess, this should be fixed.
Best regards,
Robert
The text was updated successfully, but these errors were encountered:
../src_c/IMB_output.c:346:152: error: ' int-overflow; The productio...' directive writing 106 bytes into a region of size 104 [-Werror=format-overflow=]
346 | sprintf(aux_string + offset, " int-overflow; The production rank*size caused int overflow for given sample; use flag \"-data_type double\"");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
../src_c/IMB_output.c:346:17: note: 'sprintf' output 107 bytes into a destination of size 104
346 | sprintf(aux_string + offset, " int-overflow; The production rank*size caused int overflow for given sample; use flag \"-data_type double\"");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~```
Hi guys,
I tried to compile IMB with GCC 11.3 and link it against Intel MPI, however, it failed in the process.
Basically, the issue is with a fixed size string array (aux_string) that is insufficiently long to store a warning.
Ironically, it is supposed to show a message on an overflow, and is too large to fit into the string size.
The array is defined as:
#define out_fields 8;
#define ow_format 13;
extern char aux_string[out_fieldsow_format];
Meaning it is defined as an up to a 104 byte long message.
The message itself is 106 bytes long and needs an extra byte for null termination of a string (107 bytes).
It is guarded with a MPI1 pragma but I don't understand why it actually took that path.
I guess, this should be fixed.
Best regards,
Robert
The text was updated successfully, but these errors were encountered: