UBSan error in GLCPP
Running the compiler test suite with UBSan exposes this error:
-../src/compiler/glsl/glcpp/pp.c:198:28: runtime error: applying non-zero offset 1 to null pointer
- #0 0x55c9b323259c in remove_line_continuations /home/truber/src/mesa/build/../src/compiler/glsl/glcpp/pp.c:198:28
- #1 0x55c9b323259c in glcpp_preprocess /home/truber/src/mesa/build/../src/compiler/glsl/glcpp/pp.c:234:13
- #2 0x55c9b320e4b2 in main /home/truber/src/mesa/build/../src/compiler/glsl/glcpp/glcpp.c:174:8
- #3 0x7faf8dd02b24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
- #4 0x55c9b312f30d in _start (/home/truber/src/mesa/build/src/compiler/glsl/glcpp/glcpp+0x9130d)
-
-SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/compiler/glsl/glcpp/pp.c:198:28 in
This also affects Gecko, which uses a fork of glsl-compiler via a Rust wrapper. I'm working on enabling ASan and UBSan for all C/C++ code wrapped by Rust.