Skip to content

lsp_all.o not rebuilt when cbm.h changes → stale-object ODR mismatch (ASan stack-buffer-underflow in cbm_calls_push) #661

Closed

Description

@KerseyFabrications

Version

codebade-memory-mcp 0.8.1

Platform

Linux (arm64)

Install channel

Built from source

Binary variant

standard

What happened, and what did you expect?

Makefile.cbm builds lsp_all.o (the unity object for all lsp/*.c resolvers) with a rule that depends only on lsp_all.c, not on the headers it transitively includes. Because lsp_all.c pulls in cbm.h, and CBMCall is copied by value across the lsp→pipeline boundary (cbm_calls_push), any change to CBMCall's layout leaves a stale lsp_all.o on incremental builds, an ODR mismatch. ASan flags it as a stack-buffer-underflow.

Reproduction

On a tree where lsp_all.o predates the most recent CBMCall change (i.e., any incremental build spanning #477):

$ make -f Makefile.cbm build/c/test-runner   # incremental; lsp_all.o NOT rebuilt
$ ./build/c/test-runner                       # suite_rust_lsp
==NNNNN==ERROR: AddressSanitizer: stack-buffer-underflow ... in __interceptor_memcpy
    #1 cbm_calls_push            internal/cbm/cbm.c:128
    #2 rust_inject_syn_call      internal/cbm/lsp/rust_lsp.c:3366
    #3 rust_emit_resolved_call   internal/cbm/lsp/rust_lsp.c:3382
    ...
    #19 test_rustlsp_dbg_macro_inner_call  tests/test_rust_lsp.c:861

  This frame has 1 object(s):
    [48, 352) 'call' (line 3363) <== Memory access at offset 0 partially underflows this variable

Confirm it's staleness, not a source bug:
$ ls -l build/c/lsp_all.o internal/cbm/cbm.h   # lsp_all.o older than cbm.h
$ make -f Makefile.cbm clean-c && make ... && ./build/c/test-runner   # clean build → no abort

Logs


Project scale (if relevant)

No response

Confirmations

  • I searched existing issues and this is not a duplicate.
  • My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.

Activity

  1. DeusData commented on Jun 29, 2026

    @DeusData
    Owner

    Thanks for the build-system report. I’ve triaged this under #390. This should become a build dependency regression: changing cbm.h must force lsp_all.o to rebuild so stale object files cannot produce ABI mismatches.

  2. added
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    on Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.stability/performanceServer crashes, OOM, hangs, high CPU/memory

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions