Commits
cholee committed 423edc838a2
Fix two memory bugs in get_chunking_plistid() 1. h4toh5 sds_attr_test.hdf sds_attr_test.h5 ~ Under kagiso, I got the following error: > *** glibc detected *** corrupted double-linked list: 0x003fb878 *** < It turns out that get_chunking_plistid() function assumes that SDgetchunkinfo() fills comp.comp_type, comp.cinfo, which is not true. Especially, the uninitialized comp.comp_type was used for branch, and it introduced unexpected behavior. In get_chunking_plistid(), one possible path could call free() twice, which makes the heap corrupted, and this is the reason why I got "corrupted double-linked list" error. Now, get_chunking_plistid() calls SDgetcompinfo() to fill comp.comp_type and comp.cinfo. Also, revise the code so that calling free() twice is infeasible. 2. h4toh5 sds_comp_test.hdf sds_comp_test.h5 ~ Under kagiso, I got the following error: > HDF5 internal errors: unable to set up data creation property list for szip < (The error was the same as problem #1, but the message was changed after I fixed the problem #1.) get_chunking_plistid() assumed that "c_info" variable is filled and used it to refer szip information as the following: > 4972 szip_pixels_per_block = c_info.szip.pixels_per_block; 4973 options_mask = c_info.szip.options_mask; < However, "c_info" is intialized only when the following branch is taken. > 4747 if(info_block.key == SPECIAL_COMP) { < The above branch was taken and "c_info" was not initialized because info_block.key was equal to SPECIAL_CHUNKED. Since I already called SDgetcompinfo() to fix problem #1 and this variable is still alive, I replaced "c_info" with "c_def_out.comp.cinfo".