Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

syscall.Mount crashes in Go #998

Closed
fhs opened this issue Sep 11, 2020 · 0 comments · Fixed by #1000
Closed

syscall.Mount crashes in Go #998

fhs opened this issue Sep 11, 2020 · 0 comments · Fixed by #1000
Assignees
Labels

Comments

@fhs
Copy link

fhs commented Sep 11, 2020

Steps to reproduce

Build this program in unix and run in harvey:

package main
import "syscall"
func main() {
	if err := syscall.Mount(0, 0, "", 0, ""); err != nil {
		println(err.Error())
	}
}

To build: GOOS=plan9 go build mount.go

Expected behavior

Program should print an error. On 9front:

cpu% ./mount
inappropriate use of fd

Actual behavior

Program crashes:

cpu% ./mount
mount 1063: suicide: invalid address 0x0/1 in sys call pc=0x25d980
@fhs fhs added the bug label Sep 11, 2020
@fhs fhs self-assigned this Sep 12, 2020
fhs added a commit to fhs/harvey that referenced this issue Sep 12, 2020
When dc is 0, we try to do a bind, but since the `name` argument is nil,
we crash with `invalid address`. The fix falls back to 'M' in this case,
which also helps plan9 programs that doesn't know about dc.

Fixes Harvey-OS#998

Signed-off-by: Fazlul Shahriar <fshahriar@gmail.com>
fhs added a commit to fhs/harvey that referenced this issue Sep 12, 2020
When dc is 0, we try to do a bind, but since the `name` argument is nil,
we crash with `invalid address`. The fix falls back to 'M' in this case.

To fix this for old plan9 programs that doesn't know about dc, create a
backward compatible mount_ syscall.

Fixes Harvey-OS#998

Signed-off-by: Fazlul Shahriar <fshahriar@gmail.com>
fhs added a commit to fhs/harvey that referenced this issue Sep 12, 2020
When dc is 0, we try to do a bind, but since the `name` argument is nil,
we crash with `invalid address`. The fix returns an error instead.

To fix this for old plan9 programs that doesn't know about dc, create a
backward compatible mount_ syscall.

Fixes Harvey-OS#998

Signed-off-by: Fazlul Shahriar <fshahriar@gmail.com>
@fhs fhs closed this as completed in #1000 Sep 13, 2020
fhs added a commit that referenced this issue Sep 13, 2020
When dc is 0, we try to do a bind, but since the `name` argument is nil,
we crash with `invalid address`. The fix returns an error instead.

To fix this for old plan9 programs that doesn't know about dc, create a
backward compatible mount_ syscall.

Fixes #998

Signed-off-by: Fazlul Shahriar <fshahriar@gmail.com>
floren pushed a commit to floren/harvey that referenced this issue Oct 22, 2020
When dc is 0, we try to do a bind, but since the `name` argument is nil,
we crash with `invalid address`. The fix returns an error instead.

To fix this for old plan9 programs that doesn't know about dc, create a
backward compatible mount_ syscall.

Fixes Harvey-OS#998

Signed-off-by: Fazlul Shahriar <fshahriar@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant