Public bug reported:
== Comment: #0 - Basavaraju G <[email protected]> - 2015-02-27 04:16:11 ==
---Problem Description---
It seems runtime.FuncForPC() does not work for powerpc but
works for intel. this issue is coming because of the stripped version of the
libgo in ubuntu, because of this, several functions that don't work in GO if
libgo has had its debug sections stripped.
root@ubuntu:~# ./test
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x8]
goroutine 16 [running]:
main.GetCallerName
/root/test.go:35
main.TestDirectory
/root/test.go:21
main.main
/root/test.go:49
created by main
../../../src/libgo/runtime/go-main.c:42
goroutine 18 [finalizer wait]:
root@ubuntu:~# gccgo --version
gccgo (Ubuntu 5-20150202-0ubuntu1) 5.0.0 20150202 (experimental) [trunk
revision 220357]
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
---Steps to Reproduce---
root@ubuntu:~# cat test.go
// main
package main
import (
"fmt"
"runtime"
"strings"
)
func TestDirectory() {
name := GetCallerName(2)
fmt.Println("caller name is : ", name)
}
func GetCallerName(depth int) string {
// Use the caller function name as a prefix.
// This helps trace temp directories back to their test.
pc, _, _, _ := runtime.Caller(depth + 1)
callerLongName := runtime.FuncForPC(pc).Name()
parts := strings.Split(callerLongName, ".")
callerShortName := parts[len(parts)-1]
return callerShortName
}
func main() {
TestDirectory()
}
2. build above "test.go" file, and then run the binary file in power machine
The userspace tool has the following bit modes: 64bit
== Comment: #4 - Kalpana Shetty <[email protected]> - 2015-02-27 08:35:17 ==
Based on developer suggestion "libgo" should not be stripped due to this we are
seeing this issue. Please provide us the right "libgo".
** Affects: ubuntu
Importance: Undecided
Status: New
** Tags: architecture-ppc64le bugnameltc-122160 severity-medium
targetmilestone-inin---
** Tags added: architecture-ppc64le bugnameltc-122160 severity-medium
targetmilestone-inin---
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1427074
Title:
Docker: runtime.FuncForPC() does not work for powerpc.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/1427074/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs