Add sanitizer option and fix ASan-reported use-after-free#125
Add sanitizer option and fix ASan-reported use-after-free#125m7913d merged 8 commits intoxlnt-community:masterfrom
Conversation
…lnt library fix(stylesheet.hpp): add default constructors and destructor to stylesheet class fix(xlsx_producer.cpp): properly delete current_cell_ and current_worksheet_ in destructor chore: add ubsan suppression file for xlnt library
|
Do you think that we should also run asan as part of our CI? |
|
Coverage report is available at: full | review summary |
Yes, I think so. Running the existing unit and feature tests under ASan in CI would help catch memory and undefined-behavior issues earlier. I’ve also had good experience with other projects running ASan on CI + unit and feature tests. |
Feel free to add it to our CI (see |
Thanks! I don’t have much experience with CircleCI config yet, but I can take a look the config file tomorrow and try to add an ASan job, if you don’t mind waiting a bit. |
…d behavior sanitizers fix(CMakeLists.txt): update MSVC sanitizer options for VS 2019 16.9+ fix(ubsan.supp): correct suppression file usage in comments
|
Adjusts on CI: Hm, this doesn't happened here, but happened on the CI. |
…on path to use $PWD for consistency and correctness across different working directories
|
I am not sure what is going on the MSVC workflow, I am analyzing the logs now. |
|
@m7913d can you Rerun the CircleCI with SSH and check if the util "ldd" is available on the CI VM and what are the libs the xlnt.test.exe is using? Maybe trying to run with cmd.exe to see the other error message. I think the ASan Libraries aren't in the Windows CI VM %PATH%. |
Ok, I will have a look at it. |
@Fabio3rs You are right, the asan libraries are not in the %PATH% by default. Adding the following should work (just before executing |
@m7913d thanks, I am going to add this line |
…b to avoid redundancy
…time path setup for CircleCI builds
…o avoid issues with CircleCI's git bash refactor(.circleci/continue_config_in.yml): add set -x for debugging purposes in sanitize step
|
@m7913d the windows CI is using git bash, I add some code to find automatically the MSVC libraries that should continue working after the MSVC update. |
|
Coverage report is available at: full | review summary |
I am glad to help! |
Enable optional Address/Undefined/Leak sanitizer builds via
XLNT_SANITIZE, fix a heap-use-after-free instylesheetdestruction, improvexlsx_producercleanup, and add a UBSan suppression for a benign Expat null-pointer arithmetic warning (details in the ASan/UBSan log below).