-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: reflect units tests trigger SIGSEGV #7159
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
Labels
Milestone
Comments
The lines point to iface/eface scanning. GC is quite vulnerable to heap corruption in that place, because it tries to treat the first word as Type/Itab. I suspect that it has something to do with recent liveness changes. I see that freebsd also uses uintptr's as pointer in syscall package: ../syscall/syscall_freebsd_386.go:func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic ../syscall/syscall_freebsd_amd64.go:func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) ../syscall/syscall_freebsd_arm.go:func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic ../syscall/zsyscall_freebsd_386.go:func bind(s int, addr uintptr, addrlen _Socklen) (err error) { ../syscall/zsyscall_freebsd_386.go:func connect(s int, addr uintptr, addrlen _Socklen) (err error) { ../syscall/zsyscall_freebsd_386.go:func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) { ../syscall/zsyscall_freebsd_386.go:func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) { ../syscall/zsyscall_freebsd_386.go:func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error) { ../syscall/zsyscall_freebsd_386.go:func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, err error) { ../syscall/zsyscall_freebsd_386.go:func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { ../syscall/zsyscall_freebsd_386.go:func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { ../syscall/zsyscall_freebsd_386.go:func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { ../syscall/zsyscall_freebsd_386.go:func munmap(addr uintptr, length uintptr) (err error) { ../syscall/zsyscall_freebsd_amd64.go:func bind(s int, addr uintptr, addrlen _Socklen) (err error) { ../syscall/zsyscall_freebsd_amd64.go:func connect(s int, addr uintptr, addrlen _Socklen) (err error) { ../syscall/zsyscall_freebsd_amd64.go:func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) { ../syscall/zsyscall_freebsd_amd64.go:func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) { ../syscall/zsyscall_freebsd_amd64.go:func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error) { ../syscall/zsyscall_freebsd_amd64.go:func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, err error) { ../syscall/zsyscall_freebsd_amd64.go:func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { ../syscall/zsyscall_freebsd_amd64.go:func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { ../syscall/zsyscall_freebsd_amd64.go:func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { ../syscall/zsyscall_freebsd_amd64.go:func munmap(addr uintptr, length uintptr) (err error) { ../syscall/zsyscall_freebsd_arm.go:func bind(s int, addr uintptr, addrlen _Socklen) (err error) { ../syscall/zsyscall_freebsd_arm.go:func connect(s int, addr uintptr, addrlen _Socklen) (err error) { ../syscall/zsyscall_freebsd_arm.go:func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) { ../syscall/zsyscall_freebsd_arm.go:func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) { ../syscall/zsyscall_freebsd_arm.go:func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error) { ../syscall/zsyscall_freebsd_arm.go:func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, err error) { ../syscall/zsyscall_freebsd_arm.go:func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { ../syscall/zsyscall_freebsd_arm.go:func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { ../syscall/zsyscall_freebsd_arm.go:func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { ../syscall/zsyscall_freebsd_arm.go:func munmap(addr uintptr, length uintptr) (err error) { |
Thanks for looking at the problem Dmitry. When you talk about uintptrs, how is this different from other operating systems like linux ? func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) { func Times(tms *Tms) (ticks uintptr, err error) { func munmap(addr uintptr, length uintptr) (err error) { func bind(s int, addr uintptr, addrlen _Socklen) (err error) { func connect(s int, addr uintptr, addrlen _Socklen) (err error) { func getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) { func setsockopt(s int, level int, name int, val uintptr, vallen uintptr) (err error) { func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (err error) { func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { Are we just lucky ? |
Looking at the dashboard state it does not seem that we are especially lucky :) Russ knows more about liveness. But as far as I understand uintptr parameters do not keep objects alive anymore. Frequently you keep another pointer to the object, e.g. for getsockopt you want to read the returned value. Mmap does not qualify here because it does not operate on Go heap memory. And in the end if GC is not triggered in the small windows, then you are lucky as well. So there are reasons why this can work "reasonably stable". |
> Here you go :) > http://build.golang.org/log/6c7cf21100a770254708b1abb53d860151a52577 Yay, my favorite, a build failure. |
Also previously for another data point: https://groups.google.com/d/topic/golang-dev/clkLoSibF9s/discussion |
WIP CL to address uintptrs that should be unsafe.Pointer: https://golang.org/cl/55410043 If that looks like the right approach, I can finish it and test build on all OS/ARCH combinations. Let me know. |
Issue #7273 has been merged into this issue. |
There was one on linux-race builder: http://build.golang.org/log/370a1f515e9904f35f8b975c85253b0ab9472efa on https://code.google.com/p/go/source/detail?r=fcfdb8a7aa645bcaf86a351326a4a44f4105eeeb this is after all known crasher fixes. |
I have fixed many garbage collection bugs this week, including quite a few about scanning of interface values, so I am closing old bugs about gc crashes without reproduction cases. If this is still happening on Monday, once my various pending CLs are in, then please file a new bug with a new report built from tip. Thanks. Status changed to TimedOut. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: