Skip to content

runtime: GOEXPERIMENT=precisestack GOGC=0 ./all.bash fails #7301

Closed
@randall77

Description

@randall77
We're getting occasional failures in the garbage collector when it tries to scan an
interface and gets a bad interface table pointer.

sync to tip
set GOEXPERIMENT=precisestack
set GOGC=0
run all.bash

With GOGC=0 it crashes reliably.

SIGSEGV: segmentation violation
PC=0x46daa4

scaninterfacedata(0x2, 0x7f7c76899290, 0x1, 0x7f7c769b5dc0)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/mgc0.c:1428 +0x84
scanbitvector(0x7f7c76899290, 0x732f0c, 0x4c4501, 0x7f7c769b5dc0)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/mgc0.c:1461 +0x11e
scanframe(0x7f7c769b5c50, 0x7f7c769b5dc0)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/mgc0.c:1525 +0x16e
runtime.gentraceback(0x46eed2, 0x7f7c76899108, 0x0, 0xc20812eb40, 0x0, ...)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/traceback_x86.c:155 +0x3ff
addstackroots(0xc20812eb40, 0x7f7c769b5dc0)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/mgc0.c:1581 +0x168
markroot(0xc20802e000, 0x9)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/mgc0.c:1278 +0xbe
runtime.parfordo(0xc20802e000)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/parfor.c:105 +0xa3
gc(0x7f7c76899130)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/mgc0.c:2170 +0x259
mgc(0xc20812eb40)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/mgc0.c:2111 +0x2e
runtime.mcall(0x47e1f7)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/asm_amd64.s:181 +0x4b

goroutine 21 [garbage collection]:
runtime.gc(0xc200000000)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/mgc0.c:2082 +0x1b2 fp=0x7f7c76899140
runtime.mallocgc(0x8, 0x66df00, 0x0)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/malloc.goc:218 +0x1b8 fp=0x7f7c768991b8
runtime.new(0x66df00, 0x47f6c8)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/runtime/malloc.goc:815 +0x32 fp=0x7f7c768991d8
os/exec.(*Cmd).stdin(0xc208165040, 0xc2080561c8, 0xc208087600, 0x3d)
    /usr/local/google/home/khr/sandbox/go-ro2/src/pkg/os/exec/exec.go:148 +0x40 fp=0x7f7c76899280
...

It is dying here:

            tab = *(Itab**)scanp;
            if(tab->type->size <= sizeof(void*) && (tab->type->kind & KindNoPointers))
                return;

  46da9d:   48 8b 0a                mov    (%rdx),%rcx     ; tab = *(Itab**)scanp;
  46daa0:   48 8b 41 08             mov    0x8(%rcx),%rax  ; tab->type
  46daa4:   48 8b 00                mov    (%rax),%rax     ; tab->type->size --- faults here
  46daa7:   48 83 f8 08             cmp    $0x8,%rax
  46daab:   77 a2                   ja     46da4f <scaninterfacedata+0x2f>

rax is junk (0x672f6c61636f6c2f) at the faulting instruction.  rcx is 0xc208087600,
which is apparently not an *Itab like it should be.

Possibly related to issue #7205.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions