https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66303

            Bug ID: 66303
           Summary: runtime.Caller() returns infinitely deep stack frames
                    on s390x
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: go
          Assignee: ian at airs dot com
          Reporter: e29253 at jp dot ibm.com
                CC: cmang at google dot com
  Target Milestone: ---

Created attachment 35633
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35633&action=edit
Sample program

The function runtime.Caller() returns infinitely deep stack frames on s390x
when we increase the argument 'skip'. 

Attached sample program does not terminate when we ran with GCCGO on s390x:
[inagaki@inagaki caller]$ go version
go version go1.4.2 gccgo (GCC) 5.1.1 20150527 linux/s390x
[inagaki@inagaki caller]$ go run caller.go | head
pc=4397991940204, file=../../../src/libgo/runtime/proc.c, line=235, ok=true
pc=4397981455530, file=, line=0, ok=true
pc=4397981455530, file=, line=0, ok=true
pc=4397981455530, file=, line=0, ok=true
pc=4397981455530, file=, line=0, ok=true
pc=4397981455530, file=, line=0, ok=true
pc=4397981455530, file=, line=0, ok=true
pc=4397981455530, file=, line=0, ok=true
pc=4397981455530, file=, line=0, ok=true
pc=4397981455530, file=, line=0, ok=true
^Cexit status 2
[inagaki@inagaki caller]$

The same program terminates with GC on x86_64:
-bash-4.1$ go version
go version go1.4.2 linux/amd64
-bash-4.1$ go run caller.go
pc=4329617, file=/usr/local/go/src/runtime/asm_amd64.s, line=2232, ok=true
pc=0, file=, line=0, ok=false
-bash-4.1$

Is it valid usage to detect a stack bottom by the return value 'ok'?

Reply via email to