Repository navigation
build: state the conversions and the prototype the Sanitizers lane reports (#2923) - #2925
Conversation
…2923) `v4l2_query_all_buffers()` prints the buffer count and the loop index with `%" PRIuFAST32`, but both are `uint` (unsigned int), while `uint_fast32_t` is `unsigned long` on 64-bit Linux. The valgrind lane's `-D_DEBUG` build compiles the function and `-Wformat` rejects the mismatch: v4l2-helpers.c.h:20:43: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint' [-Werror=format=] The three call sites now cast to `uint_fast32_t`, which is the widening the format already assumed. Values unchanged.
The debug-output build defines `static void gl_enable_debug()` and the
release build already defines `static void gl_enable_debug(void)`. The
`-Wstrict-prototypes` flag the ratchet turned on rejects the former:
gl-subsystem.c.h:115:13: error: function declaration isn't a prototype
[-Werror=strict-prototypes]
The two definitions now agree.
Four bit-pack expressions and two chroma divisions the asan lane compiles with the conversion groups on. Every cast states the conversion that already happened; no value changes: - rtmp-av1 `get_bit1()` shifts a byte right by 7 and stores it back; - the AV1 sequence header byte and the two HEVC configuration bytes are assembled from fields that each already fit their bit positions; - the VAAPI plane divisors are `1u << log2_chroma`, matching the `unsigned` width and height they divide. Refs #2923.
|
Note on overlap: this PR and #2922 (issue #2921, macOS lane) both state conversions in The one file this PR does not touch but the Sanitizers lane reports is When the second of the two lands, the other one rebases with nothing left to do beyond dropping the |
zackees
left a comment
There was a problem hiding this comment.
Reviewed at c246a2810 (five files, +16/−14). Every hunk states a conversion the compiler already performed; no value, flag, pin or behaviour changes, and nothing here is a merge blocker. Notes, none of them requesting a change:
Verified
plugins/linux-v4l2/v4l2-helpers.c.h:76,83,87—struct v4l2_buffer_data.countisuint(v4l2-helpers.h:49), so(uint_fast32_t)is the typePRIuFAST32names (unsigned longon LP64,unsignedon 32-bit). The three sites were narrowed by #2849, so this restores the format contract rather than papering over it. Only the log line changes;v4l2_query_all_buffers()is#ifdef _DEBUG, which is why the release build never showed it.libobs-opengl/gl-subsystem.c.h:115—(void)matches the release definition at line 128 (static void gl_enable_debug(void) {}), so the two definitions now agree instead of one carrying upstream's empty parameter list.plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c.h:434,435—1u << log2_chroma_wmakes the shiftunsigned int, so/=no longer converts a signed operand; identical value, andlog2_chroma_*is ≤ 1 for the formats reached here, so no shift-width question.plugins/obs-outputs/rtmp-av1.c.h:109,499,500andrtmp-hevc.c.h:827,843— the casts are at the assignment/argument, so the byte written is the byte the old code wrote;result = (uint8_t)(result >> 7)is whatresult >>= 7already did on auint8_t. Lines 837–840 and 853 stay uncast because those fields are already unsigned, which matches the diagnostic list in #2923 exactly (only 827 and 843 are reported).
Nit (wording only)
The body says "Nine diagnostics in three commits"; the table lists 11 line sites (7 asan sites here + 3 v4l2 occurrences + the prototype) while #2923 counts 8 asan sites + 2 valgrind classes. Either reading is defensible, but the sentence and the table should use the same count.
Still open before master's Sanitizers lane is green
plugins/obs-outputs/mp4-mux.c.h:524is #2922's site and #2922 is still a draft. This PR alone leaves the lane red on that one diagnostic, exactly as the body says, so the two need to land together (or #2922 should be marked ready so the queue can take both back to back).- The asan half's GREEN evidence is the dispatched run, not the local replay (the local gcc's range analysis differs, which the body documents). At
c246a2810that is run 40893068597, still in progress; quote its conclusion in the body before queueing so the merge group's evidence is not a promise. - The #2923 acceptance also asks for the mitigation so the next ratchet slice cannot land with a sanitizer-only error. That is a second PR per the body, which is fine, but #2923 stays open for it.
Local check — ./lint's Python lane on this head: all ci/test_*.py ok (an earlier failure in test_websocket_submodule.py was my checkout's plugins/obs-websocket submodule sitting off the pinned gitlink; it passes after git submodule update --init). Format/Fast Gate/Tier 2 are the PR's own lanes and were still running when I looked, so nothing to queue yet.
Coordinator: no changes requested — this is a self-review note on the maintainer's own PR. I will pick the queue step up on a later tick once the lanes and the dispatched Sanitizers run are green.
|
First
Second dispatch on |
The macOS half of the same file, from #2922's dispatch runWhile waiting on the sanitizer lane I read the macOS jobs of #2922's
Local clang replay of the two TUs, compile database + So after this PR and #2922, the three macOS jobs should have nothing left to report from |
Refs #2923.
Makes the
Sanitizerslane green again for everything except the one site #2922 already carries. Nine diagnostics in three commits, no flag, pin or target change:plugins/linux-v4l2/v4l2-helpers.c.h%lufromPRIuFAST32vsuint[-Wformat]uint_fast32_tlibobs-opengl/gl-subsystem.c.hfunction declaration isn't a prototype[-Wstrict-prototypes](void)parameter list, matching the release definition at line 128plugins/obs-outputs/rtmp-av1.c.hinttouint8_tmay change value[-Wconversion]plugins/obs-outputs/rtmp-hevc.c.hinttouint8_tmay change value[-Wconversion]s_w8()argumentplugins/obs-ffmpeg/obs-ffmpeg-vaapi.c.hunsigned intfromintmay change sign[-Wsign-conversion]1u << log2_chromainstead of1 <<plugins/obs-outputs/mp4-mux.c.h:524is the ninth site and is not in this PR: #2922 states that conversion, onfix/2921-mp4-mux-conversions. The two PRs touch disjoint lines, and the lane is green only with both.RED
Lane: run 40884102538 at
32c4bcc19, jobsvalgrind 🧪andasan 🧪. The full diagnostic list is in #2923.Local replay of the two
valgrind 🧪classes, through this checkout's compile database with-D_DEBUG(the-DDEBUGbuild above is Release, wherev4l2_query_all_buffers()is not compiled at all — that is why the diagnostic only appears in the sanitizer lane):The six
asan 🧪conversion diagnostics do not reproduce on this box: the same TUs, the same three warning groups appended, with gcc 13.2, 14.3 and 15.2, stay silent — their range analysis proves those expressions fit, and the asan lane's gcc does not. So for that half the lane log above is the evidence, as #2909 did for the Cocoa seams; the fix is a cast at each site and changes no value.GREEN
Same replay after the change (
-D_DEBUG, three groups +-Werrorappended):./lintis clean (== lane lint: ok (49.7s)). Theasan 🧪half is validated by theSanitizersrun dispatched on this branch; its result is in the comments below.Tiers
No Rust, C-test or protocol change, and no behaviour change to check in the app: every edit either states a conversion the compiler already performed or spells the parameter list. The C tests are untouched.
docs/features.mdis untouched because nothing user-visible changes.The mitigation in #2923
The issue's acceptance asks for a mechanism so the next ratchet slice cannot land with a sanitizer-only error. That is a second PR and a design choice (compile each ratcheted target in the
-DDEBUGasan tree inside the lane'sselect passes, versus a checklist line); this PR only makes the lane green.