BaldDemian commented on PR #3458:
URL: https://github.com/apache/fory/pull/3458#issuecomment-4018764900

   Results
   
   Local testing:
   - ASan:
     Run `bazel test --cache_test_results=no --config=x86_64 --config=asan 
$(bazel query //...)`
     All tests passed, and no memory access errors were detected. Logs are 
available in this file: 
[asan_report.txt](https://github.com/user-attachments/files/25822903/asan_report.txt)
   - UBSan:
     Run `bazel test --cache_test_results=no --config=x86_64 --config=ubsan 
$(bazel query //...)`
     Normally, when integrating UBSan, it is necessary to add the following 
line in `.bazelrc`: `build:ubsan --copt=-fsanitize=undefined`.
     However, with gcc, running the above `bazel test` command leads to a 
compilation failure.
     See this file for details: 
[ubsan_compiling_error.txt](https://github.com/user-attachments/files/25822911/ubsan_compiling_error.txt).
     This compilation failure appears to be caused by a known and unresolved 
bug in gcc. See   this discussion for reference: 
https://stackoverflow.com/questions/79775145/adding-fsanitize-undefined-in-gcc-makes-reflect-cpp-header-not-compile-anymore
     `undefined` is an aggregate sanitizer flag, and the list of its 
sub-options can be found here: 
https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#index-fsanitize_003dundefined
     After some investigation, it seems that enabling the sub-options `null`, 
`nonnull-attribute`, and `returns-nonnull-attribute` will all trigger the 
compilation failure. The current workaround is to manually expand the 
sub-options included in `undefined` and exclude the three options above. With 
this configuration, the compilation error no longer occurs.
     Test results: several **misaligned address runtime error** was indeed 
detected.
   However, due to the default behavior of UBSan(continuing execution even when 
errors are reported), the final result still shows that all tests passed. From 
the log file 
   
[ubsan_report.txt](https://github.com/user-attachments/files/25822916/ubsan_report.txt)
   (search for `runtime error`), the error appears to originate mainly from 
`buffer.h`. I will further investigate the code to check whether this is indeed 
a bug.
   
   CI testing:
   Newly added jobs and the existing ones all passed in my local fork: 
https://github.com/BaldDemian/fory/commit/95334b2bcd7ef8361b19398bd74869438a7dc7e8


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to