Skip to content

build(msvc): Windows app build stops on C4701/C4703 in obs-scripting-python.c.h:249 (py_s) #3446

Closed

Description

@zackees

The full Windows app build (build-project.yaml, /W4 /WX since #2691) fails on x64 and arm64:

shared\obs-scripting\obs-scripting-python.c.h(249): warning C4701: potentially uninitialized local variable 'py_s' used
shared\obs-scripting\obs-scripting-python.c.h(249): warning C4703: potentially uninitialized local pointer variable 'py_s' used
error C2220: the following warning is treated as an error

Seen in run 41345123078 (job 124966072712), the push run of a release/** branch. PRs never run the full app build, so it went unseen; the scheduled full run and any release branch will stop here. The same class in libobs/obs-video-gpu-encode.c.h (tex_uv) is fixed in #3445. Fix: initialize py_s (check the path that skips its assignment), then look for further C4701s once this one clears.

Activity

  1. zackees commented on Nov 3, 2026

    @zackees
    MemberAuthor

    Claiming: investigation of the Python scripting C4701/C4703 failure.

    1. Confirm the unchecked libobs_to_py failure path on current master and reproduce it with a focused regression harness.
    2. Propose and implement a guarded conversion that keeps failed Python object creation out of Py_BuildValue, then run focused checks and PR CI.
    3. Open a PR this iteration after Ready and claim acceptance; no changes to public headers or existing C tests.
  2. zackees commented on Nov 3, 2026

    @zackees
    MemberAuthor

    Investigation confirmed current master still ignores libobs_to_py() in load_python_script(). SWIG_TypeQuery can return NULL without setting py_s; the subsequent Py_BuildValue and Py_XDECREF therefore use an uninitialized pointer. The adjacent get_defaults() already guards conversion.

    Ready scope: initialize py_s to NULL, call script_load only on successful settings conversion, and release any conversion output (including Py_None on the other failure path). Preserve the existing load/tick registration and successful callback behavior. Add an executable regression that compiles the actual callback block with conversion stubs: unset output failure and assigned output failure skip the callback; success invokes it and releases references. No existing C tests or public headers change.

    /ready

  3. zackees commented on Nov 3, 2026

    @zackees
    MemberAuthor

    /ready

    Investigation and executable regression plan are documented above. Current master still has the unchecked conversion and the compiler failure; no open PR covers it.

  4. added
    readyMeets the definition of Ready; claimable
    and removed
    needs-investigationUnderdefined: research before it can be Ready
    on Nov 3, 2026
  5. zackees commented on Nov 3, 2026

    @zackees
    MemberAuthor

    Claiming: guard script_load settings conversion (#3446).

    1. RED: compile the actual callback block with conversion stubs under -O2 -Wall -Wextra -Werror; current master fails with py_s may be used uninitialized. Exercise missing SWIG type, assigned Py_None failure, successful callback and absent callback.
    2. GREEN: initialize the output, invoke script_load only for a successful conversion, and release conversion output in both cases without changing tick registration.
    3. Run focused regression and lint; open a PR this iteration. This is the focused compiler-warning fix, with local RED and GREEN evidence pushed together.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreadyMeets the definition of Ready; claimable

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions