Skip to content

Conversation

rojkov
Copy link

@rojkov rojkov commented May 17, 2021

Hyperscan fails to build with Clang with the "sometimes-unitialized" check switched on:

src/fdr/teddy_runtime_common.h:359:13: error: variable 'val' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
        if (avail >= 64) {
            ^~~~~~~~~~~
src/fdr/teddy_runtime_common.h:388:27: note: uninitialized use occurs here
    val = loadu_mask_m512(val, j, ptr);
                          ^~~
src/fdr/teddy_runtime_common.h:359:9: note: remove the 'if' if its condition is always true
        if (avail >= 64) {
        ^~~~~~~~~~~~~~~~~
src/fdr/teddy_runtime_common.h:351:5: note: variable 'val' is declared here
    m512 val;
    ^

Always initialize val to zero upon declaration.

NOTE: this PR fixes the build failure only. I don't know if initializing val to zero is harmless.

Hyperscan fails to build with Clang when the "sometimes-unitialized"
check is switched on:

src/fdr/teddy_runtime_common.h:359:13: error: variable 'val' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        if (avail >= 64) {
            ^~~~~~~~~~~
src/fdr/teddy_runtime_common.h:388:27: note: uninitialized use occurs
here
    val = loadu_mask_m512(val, j, ptr);
                          ^~~
src/fdr/teddy_runtime_common.h:359:9: note: remove the 'if' if its
condition is always true
        if (avail >= 64) {
        ^~~~~~~~~~~~~~~~~
src/fdr/teddy_runtime_common.h:351:5: note: variable 'val' is declared
here
    m512 val;
    ^

Always initialize 'val' to zero upon declaration.

Signed-off-by: Dmitry Rozhkov <[email protected]>
GerHobbelt pushed a commit to GerHobbelt/hyperscan that referenced this pull request Aug 31, 2025
* Revert "Fix noodle SVE2 off by one bug"

This patch was fixing the bug when it happens at the end of the buffer
but it wasn't fixing it when we do scanDoubleOnce before the main loop

The next patch fix this bug for both case instead

This reverts commit 48dd0e5.

* Fix noodle spurious match with \0 chars for SVE2

When sve2's noodle process a non full vector (before the main loop or
at the end of it), a fake \0 was being parsed, trigerring a match for
pattern that ended with \0. This patch fix this.

Signed-off-by: Yoan Picchi <[email protected]>

---------

Signed-off-by: Yoan Picchi <[email protected]>
GerHobbelt pushed a commit to GerHobbelt/hyperscan that referenced this pull request Aug 31, 2025
Multiple changes since last release, this will be the last 100% ABI and
API compatible with Hyperscan release.
Next versions will include major refactors and API extensions, it will
be mostly backwards compatible however.
Without particular order, platform support is now:

* Linux (x86, Arm, Power)
* FreeBSD 14 (x86, Arm, Power)
* MacOS 14+ (x86, Arm)

In total more than 200 configurations in the CI are tested for every PR.

Other features:
- Fat Runtime supported for Arm as well (ASIMD/SVE/SVE2).
- Initial implementations for Arm SVE/SVE2 algorithms added, thanks to
Yoan Picchi from Arm.
- SIMDe support added, used as an alternative backend for existing
platforms, but mostly interesting for allowing Vectorscan to build in
new platforms without a supported SIMD engine.
- Various speedups and optimizations.
- Cppcheck and clang-tidy fixes throughout the code, both have been
added to CI for multiple configurations, but only cppcheck triggers a
build failure for now.

Various bugfixes, most important listed:
- Speed up truffle with 256b TBL instructions (intel#290)
- Fix Clang Tidy warnings (intel#295)
- Clang 17+ is more restrictive on rebind<T> on MacOS/Boost, remove
warning (intel#332)
- partial_load_u64 will fail if buf == NULL/c_len == 0 (intel#331)
- Bugfix/fix avx512vbmi regressions (intel#335)
- fix missing hs_version.h header (closes intel#198)
- hs_valid_platform: Fix check for SSE4.2 (intel#310)
- Fixed out of bounds read in AVX512VBMI version of fdr_exec_fat_teddy …
(intel#333)
- Fix noodle SVE2 off by one bug (intel#313)
- Make vectorscan accept \0 starting pattern (intel#312)
- Fix 5.4.11's config step regression (intel#327)
- Fix double shufti's vector end false positive (intel#325)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant