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

Crash when running external program with new file descriptor #788

Closed
hanche opened this issue Jan 12, 2019 · 1 comment
Closed

Crash when running external program with new file descriptor #788

hanche opened this issue Jan 12, 2019 · 1 comment
Labels

Comments

@hanche
Copy link

@hanche hanche commented Jan 12, 2019

First, version info:

⬥ elvish -buildinfo
Version: 0.12-400-gd939a109
Go version: go1.11.4
GOROOT at build time: /opt/local/lib/go
GOPATH at build time: /opt/pkg/gopkg

This does not seem like desirable behaviour:

⬥ true 5</dev/null
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x13c7631]

goroutine 855 [running]:
github.com/elves/elvish/eval.catch(0xc000594f58, 0xc0002342a0)
	/opt/pkg/gopkg/src/github.com/elves/elvish/eval/frame.go:210 +0x25f
panic(0x14c1520, 0x19403b0)
	/opt/local/lib/go/src/runtime/panic.go:513 +0x1b9
github.com/elves/elvish/eval.ExternalCmd.Call(0xc0000a4300, 0x4, 0xc0002342a0, 0x0, 0x0, 0x0, 0xc000278180, 0x15e3bc0, 0xc0004b73e0)
	/opt/pkg/gopkg/src/github.com/elves/elvish/eval/external_cmd.go:60 +0xd1
github.com/elves/elvish/eval.(*formOp).invoke(0xc0004f80d0, 0xc0002342a0, 0x0, 0x0)
	/opt/pkg/gopkg/src/github.com/elves/elvish/eval/compile_effect.go:346 +0x90f
github.com/elves/elvish/eval.effectOp.exec(0x15df3a0, 0xc0004f80d0, 0x0, 0x10, 0xc0002342a0, 0x10846fb, 0xc00025a9e8)
	/opt/pkg/gopkg/src/github.com/elves/elvish/eval/op.go:26 +0x4d
github.com/elves/elvish/eval.(*Frame).eval(0xc0002342a0, 0x15df3a0, 0xc0004f80d0, 0x0, 0x10, 0x0, 0x0)
	/opt/pkg/gopkg/src/github.com/elves/elvish/eval/frame.go:149 +0xa2
github.com/elves/elvish/eval.(*pipelineOp).invoke.func1(0xc0002342a0, 0x15df3a0, 0xc0004f80d0, 0x0, 0x10, 0xc00014e050, 0xc000024e70, 0x0)
	/opt/pkg/gopkg/src/github.com/elves/elvish/eval/compile_effect.go:101 +0x60
created by github.com/elves/elvish/eval.(*pipelineOp).invoke
	/opt/pkg/gopkg/src/github.com/elves/elvish/eval/compile_effect.go:100 +0x26a
xiaq added a commit that referenced this issue Jan 12, 2020
This fixes #788.
@xiaq xiaq closed this in 5550819 Jan 12, 2020
@zzamboni

This comment has been minimized.

Copy link
Contributor

@zzamboni zzamboni commented Jan 12, 2020

I'm still getting the crash using the example from the bug report:

[~/D/P/d/g/s/g/e/elvish]─[⎇ master]─> elvish -buildinfo
Version: v0.13-60-g5550819a
Go version: go1.13.6
Reproducible build: false
[~/D/P/d/g/s/g/e/elvish]─[⎇ master]─> elvish
[~/D/P/d/g/s/g/e/elvish]─[⎇ master]─> true 5</dev/null
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x142f02d]

goroutine 23037 [running]:
github.com/elves/elvish/pkg/eval.catch(0xc000178f58, 0xc00091d800)
	/Users/taazadi1/Dropbox/Personal/devel/go/src/github.com/elves/elvish/pkg/eval/frame.go:218 +0x29a
panic(0x151aaa0, 0x19f8320)
	/usr/local/Cellar/go/1.13.6/libexec/src/runtime/panic.go:679 +0x1b2
github.com/elves/elvish/pkg/eval.ExternalCmd.Call(0xc00055d2d0, 0x4, 0xc00091d800, 0x0, 0x0, 0x0, 0xc000471a40, 0x1684520, 0xc00093d960)
	/Users/taazadi1/Dropbox/Personal/devel/go/src/github.com/elves/elvish/pkg/eval/external_cmd.go:65 +0xcd
github.com/elves/elvish/pkg/eval.(*formOp).invoke(0xc00028c680, 0xc00091d800, 0x0, 0x0)
	/Users/taazadi1/Dropbox/Personal/devel/go/src/github.com/elves/elvish/pkg/eval/compile_effect.go:345 +0x8ff
github.com/elves/elvish/pkg/eval.effectOp.exec(...)
	/Users/taazadi1/Dropbox/Personal/devel/go/src/github.com/elves/elvish/pkg/eval/op.go:26
github.com/elves/elvish/pkg/eval.(*Frame).eval(0xc00091d800, 0x167a380, 0xc00028c680, 0x0, 0x10, 0x0, 0x0)
	/Users/taazadi1/Dropbox/Personal/devel/go/src/github.com/elves/elvish/pkg/eval/frame.go:151 +0xc1
github.com/elves/elvish/pkg/eval.(*pipelineOp).invoke.func1(0xc00091d800, 0x167a380, 0xc00028c680, 0x0, 0x10, 0xc0009049c8, 0xc000407f10, 0x5851300)
	/Users/taazadi1/Dropbox/Personal/devel/go/src/github.com/elves/elvish/pkg/eval/compile_effect.go:101 +0x60
created by github.com/elves/elvish/pkg/eval.(*pipelineOp).invoke
	/Users/taazadi1/Dropbox/Personal/devel/go/src/github.com/elves/elvish/pkg/eval/compile_effect.go:100 +0x23e
Exception: elvish exited with 2
[tty], line 1: elvish
@xiaq xiaq reopened this Jan 12, 2020
@xiaq xiaq closed this in 6189fd3 Jan 12, 2020
xiaq added a commit that referenced this issue Jan 12, 2020
This fixes #788 (for real; a regression test has been added).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.