Skip to content

[Bug]: LocalFS fallback test leaks its IOVector buffer and fails UT Coverage #33099

Closed

Description

@iamlinjunhong

Is there an existing issue for the same bug?

Branch Name

4.2-dev

Commit ID

Official branch comparison 835b9e4a8974c4313b379f8d295fe545878d287e. Observed in #33094 at e5ab449709cf4f9119ef4db75cccbc22a78dd86a.

Other Environment Information

  • CI runner: Linux/x86, Go 1.26.4, CGO enabled, matrixone_test tag, -short, -covermode=set.
  • Focused comparison: Darwin/arm64 with the same Go version, CGO, build tag, and coverage mode. Debug allocator sampling and more frequent GC expose the leaked buffer with a narrow test selection.

Actual Behavior

Run 45163821269, attempt 1, failed in UT Coverage on Ubuntu/x86 when the tagged go test coverage command exited 1. The reporting step attributed the failure to package pkg/fileservice. The allocation stack identifies TestLocalFSFallsBackAfterInvalidRemoteCacheHit even though the asynchronous finalizer raised the panic during TestS3FS/default_policy/file_service/basic. Workflow run · UT Coverage job 137656203402

panic: missing free: address <address>, size 3
(*IOEntry).prepareData           pkg/fileservice/io_entry.go:119
(*LocalFS).read                 pkg/fileservice/local_fs.go:800
(*LocalFS).Read                 pkg/fileservice/local_fs.go:615
TestLocalFSFallsBackAfterInvalidRemoteCacheHit
                                pkg/fileservice/remote_cache_test.go:370

The Coverage merge failed at Verify coverage prerequisites because UT Coverage published no complete profile. It did not calculate a coverage verdict. Coverage job 137678059763

Expected Behavior

The regression test releases the successful fallback read's owned IOVector buffer after asserting the returned bytes. The fileservice package then exits normally and can publish its coverage profile.

Steps to Reproduce

  1. Run the existing regression at official 4.2-dev commit 835b9e4a8974c4313b379f8d295fe545878d287e.
  2. Enable checked allocation for every allocation and run the exact test repeatedly to make its finalizer observable.
GOTOOLCHAIN=go1.26.4 GOWORK=off CGO_ENABLED=1 GOGC=10 MO_MALLOC_DEBUG=1 \
  go test -mod=readonly -count=32 -json -short -v -tags matrixone_test \
  -timeout 120s -p 8 -covermode=set -coverprofile=/tmp/mo-fs-fallback-cover.out \
  -coverpkg=./pkg/fileservice,./pkg/common/malloc \
  -run '^TestLocalFSFallsBackAfterInvalidRemoteCacheHit$' ./pkg/fileservice

Additional information

  • Official 4.2-dev and the PR head both exited 1 with the same 3-byte missing free stack. The test's successful LocalFS.Read assigns an owned buffer through IOEntry.prepareData. The test reads the bytes and returns without releasing the vector. Adding only defer vector.Release() immediately after a successful read in a temporary official-source test overlay yielded 32/32 passes with the same allocator and test flags.
  • The PR's complete diff has no intersection with the failing test's Go dependency closure and does not change the workflow. The exact Linux CI JSON records TestPointIndexSelectionAfterAnalyze and the focused cache and planner regressions as passed.
  • Planned CI action for Improve point-index selection for skewed equality predicates (4.2-dev backport) #33094 is one failed-jobs rerun of the linked run after attempt 1 reaches a terminal state.

Activity

  1. self-assigned this
    on Nov 23, 2026
  2. added a commit that references this issue on Nov 23, 2026
    b757475
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugneeds-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions