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

runtime: invalid heap pointer on Windows #8911

Closed
alexbrainman opened this issue Oct 8, 2014 · 13 comments
Closed

runtime: invalid heap pointer on Windows #8911

alexbrainman opened this issue Oct 8, 2014 · 13 comments
Milestone

Comments

@alexbrainman
Copy link
Member

windows-386 builder failed during CL 153240043 submission:

http://build.golang.org/log/04f483224055ef6972746ab22c53271c05ce85b8


# GOMAXPROCS=2 runtime -cpu=1,2,4
--- FAIL: TestLockedDeadlock-4 (0.03s)
    crash_test.go:72: failed to execute 'go list': exit status 2
        runtime: garbage collector found invalid heap pointer *(0x12454320+0x10)=0x12475fe4 span=0x12470000-0x0-0x12550000 state=2
        runtime: found *(0x12464000+0x14) = 0x12454320+0x0
        runtime: found *(0x12462000+0x4c) = 0x12464000+0x0
        runtime: found *(0x933d00+0x16a4) = 0x12462000+0x0
        fatal error: bad pointer
        
        runtime stack:
        runtime.throw(0x929b90)
            c:/go/src/runtime/panic.go:492 +0x83 fp=0xcfc68 sp=0xcfc50
        scanblock(0x933d00, 0x8fe0, 0x32c5c0)
            c:/go/src/runtime/mgc0.c:410 +0x759 fp=0xcfd08 sp=0xcfc68
        markroot(0x1245a190, 0x1)
            c:/go/src/runtime/mgc0.c:495 +0x139 fp=0xcfd40 sp=0xcfd08
        runtime.parfordo(0x1245a190)
            c:/go/src/runtime/parfor.c:91 +0x115 fp=0xcfd9c sp=0xcfd40
        gc(0xcfed8)
            c:/go/src/runtime/mgc0.c:1438 +0x1fb fp=0xcfec8 sp=0xcfd9c
        runtime.gc_m()
            c:/go/src/runtime/mgc0.c:1372 +0xe7 fp=0xcfee8 sp=0xcfec8
        runtime.onM(0x934d58)
            c:/go/src/runtime/asm_386.s:266 +0x50 fp=0xcfeec sp=0xcfee8
        runtime.mstart()
            c:/go/src/runtime/proc.c:786 fp=0xcfef0 sp=0xcfeec
        
        goroutine 1 [garbage collection, locked to thread]:
        runtime.switchtoM()
            c:/go/src/runtime/asm_386.s:208 fp=0x1246de88 sp=0x1246de84
        runtime.gogc(0x0)
            c:/go/src/runtime/malloc.go:469 +0x1aa fp=0x1246dea8 sp=0x1246de88
        runtime.mallocgc(0x20, 0x71fe00, 0x0, 0x0)
            c:/go/src/runtime/malloc.go:341 +0x2c4 fp=0x1246df00 sp=0x1246dea8
        runtime.newobject(0x71fe00, 0x1)
            c:/go/src/runtime/malloc.go:353 +0x48 fp=0x1246df14 sp=0x1246df00
        runtime.makemap(0x6c4d80, 0x0, 0x0, 0x0)
            c:/go/src/runtime/hashmap.go:220 +0x32e fp=0x1246df4c sp=0x1246df14
        unicode.init()
            c:/go/src/unicode/tables.go:52 +0x5c fp=0x1246df6c sp=0x1246df4c
        go/parser.init()
            c:/go/src/go/parser/parser.go:2462 +0x45 fp=0x1246df78 sp=0x1246df6c
        main.init()
            c:/go/src/cmd/go/zdefaultcc.go:6 +0x45 fp=0x1246dfcc sp=0x1246df78
        runtime.main()
            c:/go/src/runtime/proc.go:58 +0xbd fp=0x1246dff0 sp=0x1246dfcc
        runtime.goexit()
            c:/go/src/runtime/proc.c:1651 fp=0x1246dff4 sp=0x1246dff0
        
        goroutine 2 [runnable]:
        runtime.forcegchelper()
            c:/go/src/runtime/proc.go:90 fp=0x1246aff0 sp=0x1246afec
        runtime.goexit()
            c:/go/src/runtime/proc.c:1651 fp=0x1246aff4 sp=0x1246aff0
        created by runtime.init·4
            c:/go/src/runtime/proc.go:87 +0x25
        
        goroutine 3 [runnable]:
        runtime.bgsweep()
            c:/go/src/runtime/mgc0.go:66 fp=0x1246cff0 sp=0x1246cfec
        runtime.goexit()
            c:/go/src/runtime/proc.c:1651 fp=0x1246cff4 sp=0x1246cff0
        created by gc
            c:/go/src/runtime/mgc0.c:1382
FAIL
FAIL    runtime 37.175s
Build complete, duration 1m41.483389s. Result: error: exit status 1

Alex
@ianlancetaylor
Copy link
Member

Comment 1:

Labels changed: added repo-main, release-go1.4.

@ianlancetaylor
Copy link
Member

Comment 2:

Labels changed: added os-windows.

@rsc
Copy link
Contributor

rsc commented Oct 28, 2014

Comment 3:

It looks to me like the runtime only uses uintptr for handles now, which is the right
fix. If you know of any pointer-typed handles, please send a CL changing them to uintptr.
I will add a GODEBUG=invalidptr=0 setting to disable to check as a temporary workaround
for people, but the right fix is to fix the code. The workaround may not be enough in
future releases.

Status changed to Accepted.

@gopherbot
Copy link
Contributor

Comment 4:

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

@rsc
Copy link
Contributor

rsc commented Oct 28, 2014

Comment 5:

Status changed to Duplicate.

Merged into issue #8961.

@alexbrainman
Copy link
Member Author

Comment 6:

Russ, why did you close this issue as "fixed" ? Your CL 165780043 adds GODEBUG debugptrs
setting. What is this to do with fixing original crash? And why is this issue is dup of
8961? I don't see how is 2 related.
Alex

@alexbrainman
Copy link
Member Author

Comment 7:

Sorry for confusion. This is fixed by revision 98477b56eb36, not by 
https://golang.org/cl/165780043. It, probably, is fixed. Lets leave it closed.
Unless we see it again. I could not reproduce it here anyway.
Alex

@rsc
Copy link
Contributor

rsc commented Oct 29, 2014

Comment 8:

This issue was closed by revision 8fcdc70.

Status changed to Fixed.

@rsc
Copy link
Contributor

rsc commented Oct 29, 2014

Comment 9:

Sorry, in #5 I meant to type 8861 not 8961.

@alexbrainman
Copy link
Member Author

Comment 10:

No problem. All settled now. Thank you.
Alex

@rsc
Copy link
Contributor

rsc commented Oct 29, 2014

Comment 11:

I also thought this was one of the 'handle isn't really a pointer' bugs, hence the
comment in #5 and the intended merging into the 'disable invalid ptr checks' bug. I
don't quite see how the CL that fixed 8911 (camlistore init) could fix this problem. If
it's not a windows handle, then it's probably flakiness that we need to track down.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Oct 29, 2014

Comment 12:

I am going to create a new issue for this, to avoid the confusion of the first 10
comments.

@rsc
Copy link
Contributor

rsc commented Oct 29, 2014

Comment 13:

Status changed to Duplicate.

Merged into issue #9015.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 26, 2018
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 20, 2018
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 30, 2018
This issue was closed.
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

4 participants