Ion Gaztañaga created ORC-624:
---------------------------------
Summary: Undefined behaviour reports from UBSAN
Key: ORC-624
URL: https://issues.apache.org/jira/browse/ORC-624
Project: ORC
Issue Type: Bug
Components: C++
Affects Versions: 1.6.2
Reporter: Ion Gaztañaga
While compiling the library using using gcc --version: "gcc (Ubuntu
7.4.0-1ubuntu1~18.04.1) 7.4.0"
Undefined defined sanitizer was activated which reported:
* Left-shift into sign-bit.
* Signed integer overflow when modulo behavior is intended
* Use memcpy (which modern compilers should optimize anyway) to avoid
unaligned reads
Those UB can lead to unpredictable errors specially in high optimization modes
as the compiler is allowed to suppose the UB can't occur. Some references:
[https://trust-in-soft.com/blog/2020/04/06/gcc-always-assumes-aligned-pointers/]
[https://kristerw.blogspot.com/2016/02/how-undefined-signed-overflow-enables.html]
A proposed pull request is available in the GitHub issue
([https://github.com/apache/orc/pull/496]).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)