Skip to content

bug: libobs: LeakSanitizer reports the context control of scenes alive at obs_shutdown (follow-up to #2038) #3364

Closed

Description

@vpacher

What happens

The asan pass reports a direct leak in test_shutdown_canvas_weak_ref and test_shutdown_type_lifetime in every run:

Direct leak of 56 byte(s) in 1 object(s) allocated from:
    #2 bzalloc                    libobs/util/bmem.h:46
    #3 obs_context_init_control   libobs/obs.c.h:2795
    #4 obs_source_init            libobs/obs-source.c.h:244
    #5 obs_source_create_internal libobs/obs-source.c.h:496
    #6 obs_source_create_canvas   libobs/obs-source.c.h:552
    #8 obs_scene_create           libobs/obs-scene.c.h:1546

Both tests keep a scene alive across obs_shutdown() on purpose. #2038 fixed the weak canvas refs in this case; the context control of the scene is still not freed.

What to do

Find who should free the control when a source outlives the core, and free it there. Then the two tests pass the leak check.

The sanitizer harness's known list (rust/tools/sanitize/triage.py, #3290) has this as kind bug: the asan job does not count it, but fails once the test runs clean. So the fix PR also drops the entry.

Activity

  1. added
    bug
    P2
    size:S
    on Nov 1, 2026
  2. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    /ready

  3. added
    ready
    on Nov 1, 2026
  4. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    Claiming: free the context control of a scene alive at obs_shutdown

    Plan (one PR, after #3290):

    1. RED: the asan pass reports the leak in both test_shutdown_* tests.
    2. GREEN: free the control where a source that outlives the core is released (after obs_shutdown leaks the weak canvas refs of sources left alive #2038).
    3. Drop the two bug entries from the known list.

    First PR: after #3290 merges.

  5. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    Blocked: waiting on #3290

  6. added
    claim-blocked
    on Nov 1, 2026
  7. removed
    claim-blocked
    on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2bugreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions