diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2005-08-17 19:21:36 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2005-08-17 19:21:36 (GMT) |
commit | 7bbea1371134d93939225593a0a730db9b8e9c7b (patch) | |
tree | 1c193c9321b725be95a35f412f4209a3cb0b1da8 /tools/lib/ph5diff.h | |
parent | 918c992dea6a975193f2f3fa1ced9f1f907c4aff (diff) | |
download | hdf5-7bbea1371134d93939225593a0a730db9b8e9c7b.zip hdf5-7bbea1371134d93939225593a0a730db9b8e9c7b.tar.gz hdf5-7bbea1371134d93939225593a0a730db9b8e9c7b.tar.bz2 |
[svn-r11259] Purpose:
Bug fix
Description:
ph5diff had been hanging in Tflops. Found out that vsnprintf ph5diff
uses was a local coded that did not limit printing according to the size
argument. That resulted in buffer overflow and other problems.
Solution:
Added some sort of size checking in the home-grown vsnprintf and
had ph5diff checked for error return of vsnprintf. Leon also
revamped the ph5diff manager's way of handling communications with
the workers. That eliminated all but the last case of hanging.
Platforms tested:
Tflops.
Misc. update:
Diffstat (limited to 'tools/lib/ph5diff.h')
-rw-r--r-- | tools/lib/ph5diff.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/lib/ph5diff.h b/tools/lib/ph5diff.h index 3fcc553..e5df82a 100644 --- a/tools/lib/ph5diff.h +++ b/tools/lib/ph5diff.h @@ -15,8 +15,13 @@ #ifndef _PH5DIFF_H__ #define _PH5DIFF_H__ +/* use a larger output buffer for Tflops which does not support vsnprintf. */ +#ifdef __PUMAGON__ #define PRINT_DATA_MAX_SIZE 512 -#define OUTBUFF_SIZE PRINT_DATA_MAX_SIZE*4 +#else +#define PRINT_DATA_MAX_SIZE 512 +#endif +#define OUTBUFF_SIZE (PRINT_DATA_MAX_SIZE*4) /* Send from manager to workers */ #define MPI_TAG_ARGS 1 #define MPI_TAG_PRINT_TOK 2 @@ -34,7 +39,7 @@ extern int g_nTasks; extern unsigned char g_Parallel; extern char outBuff[]; -extern unsigned int outBuffOffset; +extern int outBuffOffset; extern FILE* overflow_file; struct diff_args |