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

syscall: Exec is broken on solaris #20832

Closed
binarycrusader opened this issue Jun 28, 2017 · 1 comment
Closed

syscall: Exec is broken on solaris #20832

binarycrusader opened this issue Jun 28, 2017 · 1 comment

Comments

@binarycrusader
Copy link
Contributor

binarycrusader commented Jun 28, 2017

The test added for issue #18146 exposed a long-existing bug in the Solaris port; notably, that syscall.Exec uses RawSyscall -- which is not actually functional for the Solaris port (intentionally) and only exists as a placebo to satisfy build requirements.

From syscall_solaris.go:

// This is syscall.RawSyscall, it exists to satisfy some build dependency,
// but it doesn't work correctly.
//
// DO NOT USE!
//
// TODO(aram): make this panic once we stop calling fcntl(2) in net using it.
func syscall_rawsyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) {

From syscall/exec_solaris.go:

// We call hand-crafted syscalls, implemented in
// ../runtime/syscall_solaris.go, rather than generated libc wrappers
// because we need to avoid lazy-loading the functions (might malloc,
// split the stack, or acquire mutexes). We can't call RawSyscall
// because it's not safe even for BSD-subsystem calls.

Currently, the misc/cgo/test/issue18146.go test fails on Solaris as follows:

$ ./test.test -test.v -test.run Test18146
=== RUN   Test18146
--- FAIL: Test18146 (5.99s)
        issue18146.go:121: syscall.Exec failed: exit status 1
                === RUN   Test18146
                --- FAIL: Test18146 (0.00s)
                        issue18146.go:77: invalid argument
                FAIL
        issue18146.go:121: syscall.Exec failed: exit status 1
...

The fix is simple and I will submit a change request soon.

@bradfitz bradfitz added this to the Go1.9Maybe milestone Jun 28, 2017
@gopherbot
Copy link

CL https://golang.org/cl/47032 mentions this issue.

@golang golang locked and limited conversation to collaborators Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants