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: linux/386 socketcall uintptr #7169

bradfitz opened this issue Jan 22, 2014 · 3 comments

syscall: linux/386 socketcall uintptr #7169

bradfitz opened this issue Jan 22, 2014 · 3 comments


Copy link

This looks suspect for precise GC:

// On x86 Linux, all the socket calls go through an extra indirection,
// I think because the 5-register system call interface can't handle
// the 6-argument calls like sendto and recvfrom.  Instead the
// arguments to the underlying system call are the number below
// and a pointer to an array of uintptr.  We hide the pointer in the
// socketcall assembly to avoid allocation on every system call.

const (
    // see linux/net.h
    _SOCKET      = 1
    _BIND        = 2
    _CONNECT     = 3
    _LISTEN      = 4
    _ACCEPT      = 5
    _SOCKETPAIR  = 8
    _SEND        = 9
    _RECV        = 10
    _SENDTO      = 11
    _RECVFROM    = 12
    _SHUTDOWN    = 13
    _SETSOCKOPT  = 14
    _GETSOCKOPT  = 15
    _SENDMSG     = 16
    _RECVMSG     = 17
    _ACCEPT4     = 18
    _RECVMMSG    = 19
    _SENDMMSG    = 20

func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err Errno)
func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err Errno)
Copy link
Contributor Author

Comment 1:

Related: crash and
email thread [golang-dev] dragonfly-386 broken by runtime: fix specials deadlock

Copy link
Contributor Author

Comment 2:

This issue was updated by revision f00af3d.


Copy link
Contributor Author

Comment 3:

False alarm.  socketcall and rawsocketcall are NOSPLIT:
TEXT ·socketcall(SB),NOSPLIT,$0-40
TEXT ·rawsocketcall(SB),NOSPLIT,$0-40
So there should be no preemptions to do a GC.  I see no callers of socketcall or
rawsocketcall that have a pointer disappear into a uintptr over a pre-emptable function
I think this is now fully fixed by revision 87208c254908.

Owner changed to @bradfitz.

Status changed to Fixed.

@bradfitz bradfitz self-assigned this Jan 22, 2014
@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants