laconicd v2 throws segv on init command #4

Open
opened 2024-07-28 03:29:01 +00:00 by dboreham · 3 comments
Owner

Seems to be something to do with file permissions because this works (well, doesn't work but doesn't crash):

$ docker run --entrypoint sh --volume /home/david/projects/cerc/branches/mainline/stack-orchestrator/laconic-network-dir1:/laconicd-home cerc/laconicd:local -c laconicd init node1 --home /laconicd-home --chain-id laconic_81337-6

Laconic Daemon

Usage:
  laconicd [command]

Available Commands:
  comet       CometBFT subcommands

While this throws the segv:

$ docker run --entrypoint sh --user 1000:1000 --volume /home/david/projects/cerc/branches/mainline/stack-orchestrator/laconic-network-dir1:/laconicd-home cerc/laconicd:local -c laconicd init node1 --home /laconicd-home --chain-id laconic_81337-6
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x211372d]

goroutine 1 [running]:
git.vdb.to/cerc-io/laconicd/cmd/laconicd/cmd.ProvideKeyring({{0x0, 0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, 0x0}, {0x31a88e0, 0xc000c3c8e0}, ...}, ...)
        /go/src/git.vdb.to/cerc-io/laconicd/cmd/laconicd/cmd/root.go:153 +0x2d
reflect.Value.call({0x22f4340?, 0x2ecc738?, 0x4fe07a?}, {0x2712b07, 0x4}, {0xc000c41860, 0x2, 0x1?})
        /usr/local/go/src/reflect/value.go:596 +0xce7
reflect.Value.Call({0x22f4340?, 0x2ecc738?, 0xc000156bf8?}, {0xc000c41860?, 0x87?, 0x5900000000000000?})
        /usr/local/go/src/reflect/value.go:380 +0xb9
cosmossdk.io/depinject.doExtractProviderDescriptor.func1({0xc000c41860?, 0xc000be29c0?, 0x1?})
        /go/pkg/mod/cosmossdk.io/depinject@v1.0.0-alpha.4/provider_desc.go:123 +0x45
cosmossdk.io/depinject.(*container).call(0xc0004259d0, 0xc000695630, 0xc000187f80?)
        /go/pkg/mod/cosmossdk.io/depinject@v1.0.0-alpha.4/container.go:88 +0x63e
cosmossdk.io/depinject.(*simpleProvider).resolveValues(0xc000c20420, 0x1?)
Seems to be something to do with file permissions because this works (well, doesn't work but doesn't crash): ``` $ docker run --entrypoint sh --volume /home/david/projects/cerc/branches/mainline/stack-orchestrator/laconic-network-dir1:/laconicd-home cerc/laconicd:local -c laconicd init node1 --home /laconicd-home --chain-id laconic_81337-6 Laconic Daemon Usage: laconicd [command] Available Commands: comet CometBFT subcommands ``` While this throws the segv: ``` $ docker run --entrypoint sh --user 1000:1000 --volume /home/david/projects/cerc/branches/mainline/stack-orchestrator/laconic-network-dir1:/laconicd-home cerc/laconicd:local -c laconicd init node1 --home /laconicd-home --chain-id laconic_81337-6 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x211372d] goroutine 1 [running]: git.vdb.to/cerc-io/laconicd/cmd/laconicd/cmd.ProvideKeyring({{0x0, 0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, 0x0}, {0x31a88e0, 0xc000c3c8e0}, ...}, ...) /go/src/git.vdb.to/cerc-io/laconicd/cmd/laconicd/cmd/root.go:153 +0x2d reflect.Value.call({0x22f4340?, 0x2ecc738?, 0x4fe07a?}, {0x2712b07, 0x4}, {0xc000c41860, 0x2, 0x1?}) /usr/local/go/src/reflect/value.go:596 +0xce7 reflect.Value.Call({0x22f4340?, 0x2ecc738?, 0xc000156bf8?}, {0xc000c41860?, 0x87?, 0x5900000000000000?}) /usr/local/go/src/reflect/value.go:380 +0xb9 cosmossdk.io/depinject.doExtractProviderDescriptor.func1({0xc000c41860?, 0xc000be29c0?, 0x1?}) /go/pkg/mod/cosmossdk.io/depinject@v1.0.0-alpha.4/provider_desc.go:123 +0x45 cosmossdk.io/depinject.(*container).call(0xc0004259d0, 0xc000695630, 0xc000187f80?) /go/pkg/mod/cosmossdk.io/depinject@v1.0.0-alpha.4/container.go:88 +0x63e cosmossdk.io/depinject.(*simpleProvider).resolveValues(0xc000c20420, 0x1?) ```
Author
Owner

This looks to be some bug in Cosmos. It's calling pretty simple looking code via their injection framework but objects passed in and up null if the UID of the process is not zero. This is nothing to do with the command we're trying to run - it happens even with laconicd --help.

This looks to be some bug in Cosmos. It's calling pretty simple looking code via their injection framework but objects passed in and up null if the UID of the process is not zero. This is nothing to do with the command we're trying to run - it happens even with `laconicd --help`.
Author
Owner

The workaround of not setting the process UID inside the container works in that the init command now runs, but our scripts later fail because now the config files are owned by root.

The workaround of not setting the process UID inside the container works in that the init command now runs, but our scripts later fail because now the config files are owned by root.
Author
Owner

I was able to work around that by changing the file ownership in the calling script after the container exits.

I was able to work around that by changing the file ownership in the calling script after the container exits.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/laconic-network-bootstrap#4
No description provided.