Repository navigation
ci: build and test the present configuration at -O2 - #414
Merged
Merged
Conversation
Every CI build was Meson's default type, which does not optimize. A distribution builds a4l optimized (Yocto: -O2, buildtype=plain), and that build crashed in the first app library to call GetEnv until 83beb79. Nothing in CI compiled the code that way. The present job gains a leg that configures the same Skia, Vulkan and wcs configuration with -O2 -fstack-protector-strong and buildtype=plain, holds the compile to the zero-warning gate and runs the tests on it. The runner has no ART and no app, so the JNI wrappers that swap the thread pointer are compiled at -O2 here and not run. This catches a warning or a test failure that only an optimized build shows; it would not have caught that crash. Tested: the workflow parses and the action-pin gate passes. The leg itself first runs in this change's own CI. Signed-off-by: Joel Winarske <joel.winarske@linux.com>
The -O2 leg found 11 warnings in bionic_runtime.cpp that the default build does not give: glibc marks pread and write warn_unused_result only when fortified, and the truncation check needs the optimizer. - pread of an ELF's program headers was unchecked; a short read was used as if whole. It now fails the load. - Nine write(2) calls in the fault and crash paths go through write_stderr(), which writes all it can and has nobody to report a failure to. - The locale variables are copied by length after the fit is checked, in place of an snprintf whose own check was the warning. Tested: - x86-64, GCC 16, this file at -O2 -D_FORTIFY_SOURCE=3: 11 warnings on main, none with this. - x86-64 default build and the arm64 clang release build: no warning. - x86-64, a WebView app: loads its library and draws 588 frames in 22 s. Signed-off-by: Joel Winarske <joel.winarske@linux.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every CI build was Meson's default type, which does not optimize. A distribution builds a4l optimized (Yocto:
-O2,buildtype=plain), and that build crashed in the first app library to callGetEnvuntil #412. Nothing in CI compiled the code that way.Two commits:
-O2 -fstack-protector-strongand--buildtype=plain, holds the compile to the zero-warning gate, and runs the tests on it.src/ndk/bionic_runtime.cpp:preadof an ELF's program headers was unchecked; a short read was used as if whole. It now fails the load.write(2)calls in the fault and crash paths go throughwrite_stderr().snprintfwhose own check was the warning.What it does not cover
The runner has no ART and no app, so the JNI wrappers that swap the thread pointer are compiled at
-O2here and not run. This leg catches a warning or a test failure that only an optimized build shows. It would not have caught the #412 crash; that needs a test that loads an app library, which CI cannot do today.Test status
-O2leg, first commit alone-O2leg, both commits (GCC 13)-O2 -D_FORTIFY_SOURCE=3_FORTIFY_SOURCEis not passed in CI: the image's GCC defines it when optimizing, and a second definition warns in every file.