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: goroutine stack exceeds 1000000000-byte limit in simple task #34251

Closed
Noname-noragami opened this issue Sep 12, 2019 · 2 comments

Comments

@Noname-noragami
Copy link

commented Sep 12, 2019

What version of Go are you using (go version)?

$ go version 1.13

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env 

What did you do?

package main
import "fmt"

type object interface{
have()
}

type person struct{
name string
year int
}
type car struct{
id int
color string
grade float64
}

func (p person) have(){
fmt.Println("My name is:", p.name)
}
func(c car) have(){
fmt.Println("The car id is: ", c.id)
}
type bitch struct{
phoneNum int
r relateF
}
type relateF struct{
handle int
grade float64
name string
}
func(b bitch) Float64() float64{
o := float64(b.phoneNum)+1.25
return o
}

func(b bitch) String() string{
fmt.Println(b)//old
return fmt.Sprintf(b.r.name)
}

func foo(o object){
fmt.Println(o);
}

func main(){
p1 := person{"King" ,99}
p2 := person{name:"Queen",year:100}
c1 := car{1,"White",8.2}
foo(p1)
foo(p2)
foo(c1)
p1.have()
p2.have()
c1.have()
b1:= bitch{456,relateF{5,48.2,"Elsa"}}
fmt.Println(b1.Float64())
fmt.Println(b1)
}

What did you expect to see?

RUN

What did you see instead?

{King 99}
{Queen 100}
{1 White 8.2}
My name is: King
My name is: Queen
The car id is: 1
457.25
runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow
runtime stack:
runtime.throw(0x4d1b20, 0xe)
F:/Go/src/runtime/panic.go:774 +0x79
runtime.newstack()
F:/Go/src/runtime/stack.go:1046 +0x6f7
runtime.morestack()
F:/Go/src/runtime/asm_amd64.s:449 +0x97

goroutine 1 [running]:
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc0200753d8)
D:/go/structAIntefaceExp.go:38 +0x115 fp=0xc020075378 sp=0xc020075370 pc=0x498a75
main.(*bitch).String(0xc00cbc3350, 0x4beb80, 0xc00cbc3350)
:1 +0x77 fp=0xc0200753e8 sp=0xc020075378 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc8410, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc0200755f8 sp=0xc0200753e8 pc=0x493399
fmt.(*pp).printArg(0xc00cbc8410, 0x4beb80, 0xc00cbc3350, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020075690 sp=0xc0200755f8 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc8410, 0xc0200757a8, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020075700 sp=0xc020075690 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc0200757a8, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020075768 sp=0xc020075700 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020075850)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc0200757f0 sp=0xc020075768 pc=0x498a1d
main.(*bitch).String(0xc00cbc3320, 0x4beb80, 0xc00cbc3320)
:1 +0x77 fp=0xc020075860 sp=0xc0200757f0 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc8340, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020075a70 sp=0xc020075860 pc=0x493399
fmt.(*pp).printArg(0xc00cbc8340, 0x4beb80, 0xc00cbc3320, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020075b08 sp=0xc020075a70 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc8340, 0xc020075c20, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020075b78 sp=0xc020075b08 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020075c20, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020075be0 sp=0xc020075b78 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020075cc8)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc020075c68 sp=0xc020075be0 pc=0x498a1d
main.(*bitch).String(0xc00cbc32f0, 0x4beb80, 0xc00cbc32f0)
:1 +0x77 fp=0xc020075cd8 sp=0xc020075c68 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc8270, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020075ee8 sp=0xc020075cd8 pc=0x493399
fmt.(*pp).printArg(0xc00cbc8270, 0x4beb80, 0xc00cbc32f0, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020075f80 sp=0xc020075ee8 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc8270, 0xc020076098, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020075ff0 sp=0xc020075f80 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020076098, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020076058 sp=0xc020075ff0 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020076140)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc0200760e0 sp=0xc020076058 pc=0x498a1d
main.(*bitch).String(0xc00cbc32c0, 0x4beb80, 0xc00cbc32c0)
:1 +0x77 fp=0xc020076150 sp=0xc0200760e0 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc81a0, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020076360 sp=0xc020076150 pc=0x493399
fmt.(*pp).printArg(0xc00cbc81a0, 0x4beb80, 0xc00cbc32c0, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc0200763f8 sp=0xc020076360 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc81a0, 0xc020076510, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020076468 sp=0xc0200763f8 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020076510, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc0200764d0 sp=0xc020076468 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc0200765b8)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc020076558 sp=0xc0200764d0 pc=0x498a1d
main.(*bitch).String(0xc00cbc3290, 0x4beb80, 0xc00cbc3290)
:1 +0x77 fp=0xc0200765c8 sp=0xc020076558 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc80d0, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc0200767d8 sp=0xc0200765c8 pc=0x493399
fmt.(*pp).printArg(0xc00cbc80d0, 0x4beb80, 0xc00cbc3290, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020076870 sp=0xc0200767d8 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc80d0, 0xc020076988, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc0200768e0 sp=0xc020076870 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020076988, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020076948 sp=0xc0200768e0 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020076a30)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc0200769d0 sp=0xc020076948 pc=0x498a1d
main.(*bitch).String(0xc00cbc3260, 0x4beb80, 0xc00cbc3260)
:1 +0x77 fp=0xc020076a40 sp=0xc0200769d0 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc8000, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020076c50 sp=0xc020076a40 pc=0x493399
fmt.(*pp).printArg(0xc00cbc8000, 0x4beb80, 0xc00cbc3260, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020076ce8 sp=0xc020076c50 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc8000, 0xc020076e00, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020076d58 sp=0xc020076ce8 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020076e00, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020076dc0 sp=0xc020076d58 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020076ea8)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc020076e48 sp=0xc020076dc0 pc=0x498a1d
main.(*bitch).String(0xc00cbc3230, 0x4beb80, 0xc00cbc3230)
:1 +0x77 fp=0xc020076eb8 sp=0xc020076e48 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc7ee0, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc0200770c8 sp=0xc020076eb8 pc=0x493399
fmt.(*pp).printArg(0xc00cbc7ee0, 0x4beb80, 0xc00cbc3230, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020077160 sp=0xc0200770c8 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc7ee0, 0xc020077278, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc0200771d0 sp=0xc020077160 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020077278, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020077238 sp=0xc0200771d0 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020077320)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc0200772c0 sp=0xc020077238 pc=0x498a1d
main.(*bitch).String(0xc00cbc3200, 0x4beb80, 0xc00cbc3200)
:1 +0x77 fp=0xc020077330 sp=0xc0200772c0 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc7e10, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020077540 sp=0xc020077330 pc=0x493399
fmt.(*pp).printArg(0xc00cbc7e10, 0x4beb80, 0xc00cbc3200, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc0200775d8 sp=0xc020077540 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc7e10, 0xc0200776f0, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020077648 sp=0xc0200775d8 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc0200776f0, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc0200776b0 sp=0xc020077648 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020077798)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc020077738 sp=0xc0200776b0 pc=0x498a1d
main.(*bitch).String(0xc00cbc31d0, 0x4beb80, 0xc00cbc31d0)
:1 +0x77 fp=0xc0200777a8 sp=0xc020077738 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc7d40, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc0200779b8 sp=0xc0200777a8 pc=0x493399
fmt.(*pp).printArg(0xc00cbc7d40, 0x4beb80, 0xc00cbc31d0, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020077a50 sp=0xc0200779b8 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc7d40, 0xc020077b68, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020077ac0 sp=0xc020077a50 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020077b68, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020077b28 sp=0xc020077ac0 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020077c10)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc020077bb0 sp=0xc020077b28 pc=0x498a1d
main.(*bitch).String(0xc00cbc31a0, 0x4beb80, 0xc00cbc31a0)
:1 +0x77 fp=0xc020077c20 sp=0xc020077bb0 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc7c70, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020077e30 sp=0xc020077c20 pc=0x493399
fmt.(*pp).printArg(0xc00cbc7c70, 0x4beb80, 0xc00cbc31a0, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020077ec8 sp=0xc020077e30 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc7c70, 0xc020077fe0, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020077f38 sp=0xc020077ec8 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020077fe0, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020077fa0 sp=0xc020077f38 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020078088)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc020078028 sp=0xc020077fa0 pc=0x498a1d
main.(*bitch).String(0xc00cbc3170, 0x4beb80, 0xc00cbc3170)
:1 +0x77 fp=0xc020078098 sp=0xc020078028 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc7ba0, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc0200782a8 sp=0xc020078098 pc=0x493399
fmt.(*pp).printArg(0xc00cbc7ba0, 0x4beb80, 0xc00cbc3170, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020078340 sp=0xc0200782a8 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc7ba0, 0xc020078458, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc0200783b0 sp=0xc020078340 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020078458, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020078418 sp=0xc0200783b0 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020078500)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc0200784a0 sp=0xc020078418 pc=0x498a1d
main.(*bitch).String(0xc00cbc3140, 0x4beb80, 0xc00cbc3140)
:1 +0x77 fp=0xc020078510 sp=0xc0200784a0 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc7ad0, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020078720 sp=0xc020078510 pc=0x493399
fmt.(*pp).printArg(0xc00cbc7ad0, 0x4beb80, 0xc00cbc3140, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc0200787b8 sp=0xc020078720 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc7ad0, 0xc0200788d0, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020078828 sp=0xc0200787b8 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc0200788d0, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020078890 sp=0xc020078828 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020078978)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc020078918 sp=0xc020078890 pc=0x498a1d
main.(*bitch).String(0xc00cbc3110, 0x4beb80, 0xc00cbc3110)
:1 +0x77 fp=0xc020078988 sp=0xc020078918 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc7a00, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020078b98 sp=0xc020078988 pc=0x493399
fmt.(*pp).printArg(0xc00cbc7a00, 0x4beb80, 0xc00cbc3110, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020078c30 sp=0xc020078b98 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc7a00, 0xc020078d48, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020078ca0 sp=0xc020078c30 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020078d48, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020078d08 sp=0xc020078ca0 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020078df0)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc020078d90 sp=0xc020078d08 pc=0x498a1d
main.(*bitch).String(0xc00cbc30e0, 0x4beb80, 0xc00cbc30e0)
:1 +0x77 fp=0xc020078e00 sp=0xc020078d90 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc7930, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020079010 sp=0xc020078e00 pc=0x493399
fmt.(*pp).printArg(0xc00cbc7930, 0x4beb80, 0xc00cbc30e0, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc0200790a8 sp=0xc020079010 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc7930, 0xc0200791c0, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020079118 sp=0xc0200790a8 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc0200791c0, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020079180 sp=0xc020079118 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020079268)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc020079208 sp=0xc020079180 pc=0x498a1d
main.(*bitch).String(0xc00cbc30b0, 0x4beb80, 0xc00cbc30b0)
:1 +0x77 fp=0xc020079278 sp=0xc020079208 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc7860, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020079488 sp=0xc020079278 pc=0x493399
fmt.(*pp).printArg(0xc00cbc7860, 0x4beb80, 0xc00cbc30b0, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020079520 sp=0xc020079488 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc7860, 0xc020079638, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020079590 sp=0xc020079520 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020079638, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc0200795f8 sp=0xc020079590 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc0200796e0)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc020079680 sp=0xc0200795f8 pc=0x498a1d
main.(*bitch).String(0xc00cbc3080, 0x4beb80, 0xc00cbc3080)
:1 +0x77 fp=0xc0200796f0 sp=0xc020079680 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc7790, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020079900 sp=0xc0200796f0 pc=0x493399
fmt.(*pp).printArg(0xc00cbc7790, 0x4beb80, 0xc00cbc3080, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020079998 sp=0xc020079900 pc=0x49395d
fmt.(*pp).doPrintln(0xc00cbc7790, 0xc020079ab0, 0x1, 0x1)
F:/Go/src/fmt/print.go:1173 +0xb9 fp=0xc020079a08 sp=0xc020079998 pc=0x498429
fmt.Fprintln(0x4eb7a0, 0xc000006018, 0xc020079ab0, 0x1, 0x1, 0x0, 0x0, 0x0)
F:/Go/src/fmt/print.go:264 +0x5f fp=0xc020079a70 sp=0xc020079a08 pc=0x49053f
fmt.Println(...)
F:/Go/src/fmt/print.go:274
main.bitch.String(0x1c8, 0x5, 0x404819999999999a, 0x4d02ee, 0x4, 0x0, 0xc020079b58)
D:/go/structAIntefaceExp.go:39 +0xbd fp=0xc020079af8 sp=0xc020079a70 pc=0x498a1d
main.(*bitch).String(0xc00cbc3050, 0x4beb80, 0xc00cbc3050)
:1 +0x77 fp=0xc020079b68 sp=0xc020079af8 pc=0x499477
fmt.(*pp).handleMethods(0xc00cbc76c0, 0x76, 0xc000028001)
F:/Go/src/fmt/print.go:630 +0x309 fp=0xc020079d78 sp=0xc020079b68 pc=0x493399
fmt.(*pp).printArg(0xc00cbc76c0, 0x4beb80, 0xc00cbc3050, 0x76)
F:/Go/src/fmt/print.go:713 +0x20d fp=0xc020079e10 sp=0xc020079d78 pc=0x49395d
exit status 2

@bserdar

This comment has been minimized.

Copy link

commented Sep 12, 2019

You have an infinite recursion here. fmt.Println(b) will call b.String(), which will call fmt.Println(b)....

func(b bitch) String() string{
fmt.Println(b)//old
return fmt.Sprintf(b.r.name)
}

@ALTree

This comment has been minimized.

Copy link
Member

commented Sep 12, 2019

What @bserdar said. You cannot call Print on a type that has a String method inside the type's String method.

Closing here, since this is working as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.