Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mcap merge fails on missing schema #829

Closed
vivek-rane opened this issue Feb 22, 2023 · 1 comment · Fixed by #830
Closed

mcap merge fails on missing schema #829

vivek-rane opened this issue Feb 22, 2023 · 1 comment · Fixed by #830
Assignees
Labels
bug Something isn't working

Comments

@vivek-rane
Copy link

Description
When merging 2 mcaps with the CLI tool, and one of them has a schema ID of 0 (no schema, just 1 channel with schema ID 0 and 1 message on that channel), the CLI tool crashes with:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1006df838]

goroutine 1 [running]:
github.com/foxglove/mcap/go/cli/mcap/cmd.(*mcapMerger).addSchema(0x14003405d48, 0x0?, 0x1c1, 0x0)
        /private/tmp/mcap-20230216-70145-8qbk2v/mcap-releases-mcap-cli-v0.0.25/go/cli/mcap/cmd/merge.go:109 +0x28
github.com/foxglove/mcap/go/cli/mcap/cmd.(*mcapMerger).mergeInputs(0x14003405d48, {0x100acecc0, 0x14000011908}, {0x140004d0000, 0x1c4, 0x0?})
        /private/tmp/mcap-20230216-70145-8qbk2v/mcap-releases-mcap-cli-v0.0.25/go/cli/mcap/cmd/merge.go:186 +0x6e4
github.com/foxglove/mcap/go/cli/mcap/cmd.glob..func12(0x100ff6060?, {0x140004ae000?, 0x1c4, 0x200?})
        /private/tmp/mcap-20230216-70145-8qbk2v/mcap-releases-mcap-cli-v0.0.25/go/cli/mcap/cmd/merge.go:279 +0x29c
github.com/spf13/cobra.(*Command).execute(0x100ff6060, {0x140004a6000, 0x1c6, 0x200})
        /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876 +0x4b8
github.com/spf13/cobra.(*Command).ExecuteC(0x100ff5de0)
        /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990 +0x354
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/foxglove/mcap/go/cli/mcap/cmd.Execute()
        /private/tmp/mcap-20230216-70145-8qbk2v/mcap-releases-mcap-cli-v0.0.25/go/cli/mcap/cmd/root.go:21 +0x28
main.main()
        /private/tmp/mcap-20230216-70145-8qbk2v/mcap-releases-mcap-cli-v0.0.25/go/cli/mcap/main.go:6 +0x1c
  • Version: mcap version v0.0.25
  • Platform: macOS Monterey 12.5.1

Steps To Reproduce

  • Create an mcap with the python API with 1 channel set to schema ID 0 and 1 or more messages
  • Run the merge command with mcap merge no-schema.mcap regular.mcap
  • Tool crashes with runtime error above

Expected Behavior
Tool should generate merged mcap so that it can be loaded into Foxglove studio (ref: #5351 Support schemaless channels)

@vivek-rane vivek-rane added the bug Something isn't working label Feb 22, 2023
@foxhubber
Copy link

foxhubber bot commented Feb 22, 2023

Linear: FG-2122

@amacneil amacneil transferred this issue from another repository Feb 23, 2023
@james-rms james-rms self-assigned this Feb 23, 2023
jtbandes added a commit that referenced this issue Jul 7, 2023
### Public-Facing Changes

CLI commands `filter`, `compress`, `decompress`, and `recover` no longer fail on schemaless channels (schema id = 0).

### Description

Don't fail when encountering schema ID 0.

Fixes FG-4182

See also:
- #829
- #847
- #579
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants