-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clang warnings and ASan fixes #3
Conversation
Either included missing header or added a prototype.
…inator Found by ASan: ==18515==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200001a791 at pc 0x00010111b47a bp 0x7ffeefbfe8f0 sp 0x7ffeefbfe098 READ of size 2 at 0x60200001a791 thread T0 #0 0x10111b479 in wrap_strlen (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x14479) HDFGroup#1 0x100841c4c in H5T__conv_vlen H5Tconv.c:3193 HDFGroup#2 0x1008113d9 in H5T_convert H5T.c:5024 HDFGroup#3 0x100379fbb in H5D__scatgath_write H5Dscatgath.c:701 HDFGroup#4 0x10032d235 in H5D__contig_write H5Dcontig.c:657 HDFGroup#5 0x10036c768 in H5D__write H5Dio.c:819 HDFGroup#6 0x10036b650 in H5Dwrite H5Dio.c:335 HDFGroup#7 0x100115fa7 in H5::DataSet::write(void const*, H5::DataType const&, H5::DataSpace const&, H5::DataSpace const&, H5::DSetMemXferPropList const&) const H5DataSet.cpp:506 HDFGroup#8 0x100031d9a in test_vlstrings tvlstr.cpp:191 HDFGroup#9 0x1001aec42 in PerformTests testframe.c:323 HDFGroup#10 0x100002ac0 in main testhdf5.cpp:116 HDFGroup#11 0x7fff5eec6014 in start (libdyld.dylib:x86_64+0x1014) 0x60200001a791 is located 0 bytes to the right of 1-byte region [0x60200001a790,0x60200001a791) allocated by thread T0 here: #0 0x10115c547 in wrap_calloc (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x55547) HDFGroup#1 0x100031d70 in test_vlstrings tvlstr.cpp:187 HDFGroup#2 0x1001aec42 in PerformTests testframe.c:323 HDFGroup#3 0x100002ac0 in main testhdf5.cpp:116 HDFGroup#4 0x7fff5eec6014 in start (libdyld.dylib:x86_64+0x1014)
…H5Rdereference2() Found by ASan: ==52756==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffeefbfedc8 at pc 0x000100be250f bp 0x7ffeefbfe890 sp 0x7ffeefbfe888 READ of size 1 at 0x7ffeefbfedc8 thread T0 #0 0x100be250e in H5R__dereference H5Rint.c:416 HDFGroup#1 0x100bddbd1 in H5Rdereference2 H5R.c:185 HDFGroup#2 0x1001c168c in test_reference_region trefer.c:798 HDFGroup#3 0x1001ba134 in test_reference trefer.c:1863 HDFGroup#4 0x100660c42 in PerformTests testframe.c:323 HDFGroup#5 0x100001fdc in main testhdf5.c:77 HDFGroup#6 0x7fff5eec6014 in start (libdyld.dylib:x86_64+0x1014) Address 0x7ffeefbfedc8 is located in stack of thread T0 at offset 616 in frame #0 0x1001be1df in test_reference_region trefer.c:507
… for the actual data Found by ASan: ==19994==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffeefbfe920 at pc 0x0001010b064f bp 0x7ffeefbfc810 sp 0x7ffeefbfbfc0 READ of size 128 at 0x7ffeefbfe920 thread T0 #0 0x1010b064e in __asan_memcpy (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x5264e) HDFGroup#1 0x1002cde61 in H5D__gather_mem H5Dscatgath.c:428 HDFGroup#2 0x1002d0ca4 in H5D__scatgath_write H5Dscatgath.c:663 HDFGroup#3 0x10025c948 in H5D__chunk_write H5Dchunk.c:2470 HDFGroup#4 0x1002c3768 in H5D__write H5Dio.c:819 HDFGroup#5 0x1002c2650 in H5Dwrite H5Dio.c:335 HDFGroup#6 0x1000d4b8a in H5TBwrite_fields_index H5TB.c:729 HDFGroup#7 0x100008c13 in test_table test_table.c:1420 HDFGroup#8 0x1000028ff in main test_table.c:1686 HDFGroup#9 0x7fff5eec6014 in start (libdyld.dylib:x86_64+0x1014) Address 0x7ffeefbfe920 is located in stack of thread T0 at offset 4160 in frame #0 0x1000029cf in test_table test_table.c:211
Sean, Thank you so much for your contribution! This repo is not open for contributions yet. We will be announcing our move from Bitbucket to Github before the end of July. Could you please submit your patch against https://bitbucket.hdfgroup.org/projects/HDFFV/repos/hdf5/browse and we will review and merge, or could you please wait until we make an announcement? Our repo doesn't have standard git organization and all changes should be done to develop branch first and then we will propagate the changes to the other maintenance branches. Thank you! Elena |
The only one I really need ASAP is 29e6401, because it prevents compilation on the beta of macOS 11 Big Sur because the -Wimplicit-function-declaration warning is now treated as an error. Building the 'develop' branch doesn't seem to have those warnings. I guess someone fixed them already. Given that, there's no change to the 'develop' branch I can even submit. How to proceed? Thanks. |
Hi Sean, I checked for the 29e6401 changes in our 1.10 development branch hdf5_1_10, and they are in that branch. I suspect that if the rest of these changes are in develop, they are also in the hdf5_1_10 branch. we currently reserve the 1.x/master branches for committing official releases. The code currently in hdf5_1_10 with another month's work should be posted there sometime in August. If the changes you need are in that branch, can you use the branch? I can also create a snapshot release from that branch this weekend, and if the branch doesn't have all of your changes we can review them and try to get them into the snapshot. Larry |
Is it now? I've just updated myself to c55ac8a on develop branch and 3 tests fail with address sanitizer, specifically:
Probably the same 3 as in my patch... |
I have implemented some of these changes (not the CX includes yet) that are applicable. |
Great, thanks. But where? I don't see it here: https://github.com/HDFGroup/hdf5/commits/develop am I looking in the wrong place? |
Still on my local machine - need to create PRs. |
Ah, I see. Can this PR not be used? |
Right, this PR is against 1.10/master which is "release tagging" branch. The normal process is develop, to 1.12, to 1.10, to 1.8. |
Great thanks! |
So I can confirm that two are fixed, and
Line 12185 in 52ac746
The backtrace is:
I gave up at that point, but hopefully it gives you a head start. |
So I can confirm that two are fixed, and
Line 12185 in 52ac746
The backtrace is:
I gave up at that point, but hopefully it gives you a head start. |
I've just confirmed that my warning fixes in this PR are no longer needed vs current So just the |
Created #444 issue for dsets test failure |
This fixes a few compiler warnings and ASan reports.