Skip to content

runtime: reflect.methodValueCall cannot be unwound #6619

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

Closed
lexprfuncall opened this issue Oct 18, 2013 · 6 comments
Closed

runtime: reflect.methodValueCall cannot be unwound #6619

lexprfuncall opened this issue Oct 18, 2013 · 6 comments
Milestone

Comments

@lexprfuncall
Copy link

I am encountering the following error during continuous loops of all.bash with GOGC set
to either 0 or 1.  This happens on a clean checkout and has been reproduced on Keith's
machine as well.

This might be related to 5954 though the tack trace is always different.  The test that
is failing may have been one that was recently added.

Here is a representative stack trace

runtime: unknown argument frame size for reflect.methodValueCall called from 0x425822
[runtime.call16]
fatal error: invalid stack

runtime stack:
runtime.throw(0x9b03e6)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/panic.c:464 +0x69
runtime.gentraceback(0x41173e, 0x7f8bb3801600, 0x0, 0xc21024e000, 0x0, ...)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/traceback_x86.c:132 +0x71e
addstackroots(0xc21024e000)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/mgc0.c:1775 +0x155
addroots()
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/mgc0.c:1857 +0x204
gc(0x7f8bb3801628)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/mgc0.c:2405 +0x18b
mgc(0xc21024e000)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/mgc0.c:2356 +0x2e
runtime.mcall(0x42543d)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/asm_amd64.s:178 +0x4b

goroutine 40 [garbage collection]:
runtime.gc(0x0)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/mgc0.c:2327 +0x19e fp=0x7f8bb3801638
runtime.mallocgc(0x1000, 0x567961, 0x0)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/malloc.goc:148 +0x2a2 fp=0x7f8bb38016a8
cnew(0x567960, 0x3, 0x1)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/malloc.goc:726 +0xc1 fp=0x7f8bb38016c8
runtime.cnewarray(0x567960, 0x3)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/malloc.goc:739 +0x3a fp=0x7f8bb38016e8
makeslice1(0x55cbe0, 0x3, 0x3, 0x7f8bb3801748)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/slice.c:57 +0x4d fp=0x7f8bb3801700
runtime.makeslice(0x55cbe0, 0x3, 0x3, 0x8, 0x3, ...)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/slice.c:38 +0x98 fp=0x7f8bb3801730
reflect.callMethod(0xc2152a9000, 0x7f8bb38017e8)
        /usr/local/google/home/cshapiro/go/src/pkg/reflect/value.go:670 +0xe0 fp=0x7f8bb38017d0
runtime: unknown argument frame size for reflect.methodValueCall called from 0x425822
[runtime.call16]
reflect.methodValueCall()
        /usr/local/google/home/cshapiro/go/src/pkg/reflect/asm_amd64.s:26 +0x24 fp=0x7f8bb38017e8
runtime.call16(0xc2152a9000, 0xc2152aa000)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/asm_amd64.s:338 +0x32 fp=0x7f8bb3801800
reflect.Value.call(0x57ac40, 0xc2152a9000, 0x130, 0x5c6960, 0x4, ...)
        /usr/local/google/home/cshapiro/go/src/pkg/reflect/value.go:474 +0x113d fp=0x7f8bb3801ab8
reflect.Value.Call(0x57ac40, 0xc2152a9000, 0x130, 0x7f8bb3801d38, 0x1, ...)
        /usr/local/google/home/cshapiro/go/src/pkg/reflect/value.go:345 +0xac fp=0x7f8bb3801b30
reflect_test.TestMethodValue(0xc2152a5000)
        /usr/local/google/home/cshapiro/go/src/pkg/reflect/all_test.go:1592 +0x431 fp=0x7f8bb3801f48
testing.tRunner(0xc2152a5000, 0x9b46e8)
        /usr/local/google/home/cshapiro/go/src/pkg/testing/testing.go:389 +0xa9 fp=0x7f8bb3801f90
runtime.goexit()
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/proc.c:1396 fp=0x7f8bb3801f98
created by testing.RunTests
        /usr/local/google/home/cshapiro/go/src/pkg/testing/testing.go:469 +0x9a2

goroutine 1 [chan receive]:
testing.RunTests(0x61be88, 0x9b43a0, 0x52, 0x52, 0x1)
        /usr/local/google/home/cshapiro/go/src/pkg/testing/testing.go:470 +0x9c5
testing.Main(0x61be88, 0x9b43a0, 0x52, 0x52, 0x9af400, ...)
        /usr/local/google/home/cshapiro/go/src/pkg/testing/testing.go:401 +0x84
main.main()
        reflect/_test/_testmain.go:223 +0x9c

goroutine 35 [sleep]:
time.Sleep(0x3b9aca00)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/time.goc:31 +0x31
reflect_test.selectWatcher()
        /usr/local/google/home/cshapiro/go/src/pkg/reflect/all_test.go:1350 +0x2e
created by reflect_test.func·003
        /usr/local/google/home/cshapiro/go/src/pkg/reflect/all_test.go:1080 +0x21
FAIL    reflect 68.298s
@ianlancetaylor
Copy link
Contributor

Comment 1:

The problem seems to be in here:
runtime: unknown argument frame size for reflect.methodValueCall called from 0x425822
[runtime.call16]
reflect.methodValueCall()
        /usr/local/google/home/cshapiro/go/src/pkg/reflect/asm_amd64.s:26 +0x24 fp=0x7f8bb38017e8
runtime.call16(0xc2152a9000, 0xc2152aa000)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/asm_amd64.s:338 +0x32 fp=0x7f8bb3801800
reflect.Value.call(0x57ac40, 0xc2152a9000, 0x130, 0x5c6960, 0x4, ...)
        /usr/local/google/home/cshapiro/go/src/pkg/reflect/value.go:474 +0x113d fp=0x7f8bb3801ab8
reflect.methodValueCall is an assembly function, and it is varargs.  The compiler is
supposed to record the size of the arguments in the caller using PCDATA_ArgSize.  But in
this case the caller is itself assembly code, runtime.call16, so there is no argument
size data.
I think the fix might be for call16 and friends in runtime/asm_amd64.s to record
argument size data, which they would do using some sort of PCDATA instruction.

@randall77
Copy link
Contributor

Comment 2:

call16 can't record the argument size/types, at least not statically.  It is likely
different on each call.
We could record something at runtime, but then we already do.  The first argument to
call16 is a FuncVal* for which  we can read the function pointer, look up the Func*, and
we have the info.  We'd then just need to special case traceback_*.c to know how to
compute the argument info for the call* routines.

@rsc
Copy link
Contributor

rsc commented Oct 21, 2013

Comment 3:

I don't see how this can happen on a clean checkout:
runtime.gentraceback(0x41173e, 0x7f8bb3801600, 0x0, 0xc21024e000, 0x0, ...)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/traceback_x86.c:132 +0x71e
addstackroots(0xc21024e000)
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/mgc0.c:1775 +0x155
addroots()
        /usr/local/google/home/cshapiro/go/src/pkg/runtime/mgc0.c:1857 +0x204
At tip right now, ScanStacksByFrames = 0, so addstackroots should not be calling
gentraceback.
Can you explain why it is?

@bradfitz
Copy link
Contributor

Comment 4:

I can't reproduce with Go tip.
Changing tag to Go1.3 unless Carl or Keith (who also couldn't reproduce) thinks this is
a Go 1.2 thing.

Labels changed: added go1.3, removed go1.2.

@ianlancetaylor
Copy link
Contributor

Comment 5:

Owner changed to @randall77.

@randall77
Copy link
Contributor

Comment 6:

This issue was closed by revision 85138da.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the 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.
Projects
None yet
Development

No branches or pull requests

6 participants