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

Segfault when trying to exec a non-existent path #356

Open
shastah opened this issue Aug 12, 2024 · 0 comments
Open

Segfault when trying to exec a non-existent path #356

shastah opened this issue Aug 12, 2024 · 0 comments

Comments

@shastah
Copy link

shastah commented Aug 12, 2024

When using exec <path> otel-cli segfaults if <path> doesn't exist:

$ otel-cli exec /bin/foobar
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x104dfc6f4]

goroutine 1 [running]:
github.com/equinix-labs/otel-cli/otelcli.doExec(0x14000224f00?, {0x140002a6ab0, 0x1, 0x1})
	/home/atobey/src/otel-cli/otelcli/exec.go:149 +0xd54
github.com/spf13/cobra.(*Command).execute(0x140002d2600, {0x140002a6a80, 0x1, 0x1})
	/home/atobey/go/pkg/mod/github.com/spf13/[email protected]/command.go:987 +0x814
github.com/spf13/cobra.(*Command).ExecuteC(0x1400022d500)
	/home/atobey/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	/home/atobey/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/home/atobey/go/pkg/mod/github.com/spf13/[email protected]/command.go:1032
github.com/equinix-labs/otel-cli/otelcli.Execute({0x1400026c2d0, 0x43})
	/home/atobey/src/otel-cli/otelcli/root.go:89 +0x138
main.main()
	/home/atobey/src/otel-cli/main.go:17 +0x50

I'm running 0.4.5.

shastah added a commit to shastah/otel-cli that referenced this issue Aug 12, 2024
This example from README:
```
# otel-cli propagates context via envvars so you can chain it to create child spans
otel-cli exec --kind producer "otel-cli exec --kind consumer sleep 1"
```
doesn't work, because we're running into equinix-labs#356.
It worked until `/bin/sh -c` was removed in equinix-labs#202.
shastah added a commit to shastah/otel-cli that referenced this issue Aug 12, 2024
This example from README:

    # otel-cli propagates context via envvars so you can chain it to create child spans
    otel-cli exec --kind producer "otel-cli exec --kind consumer sleep 1"

doesn't work, because we're running into equinix-labs#356.
It worked until `/bin/sh -c` was removed in equinix-labs#202.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant