Skip to content

Instantly share code, notes, and snippets.

@hyangah
Last active August 29, 2015 14:11
Show Gist options
  • Save hyangah/0b1225eb3b164096ef87 to your computer and use it in GitHub Desktop.
Save hyangah/0b1225eb3b164096ef87 to your computer and use it in GitHub Desktop.
example for golang/go issue 9398?
diff --git a/example/libhello/hi/hi.go b/example/libhello/hi/hi.go
index a1e868b..cf3ec23 100644
--- a/example/libhello/hi/hi.go
+++ b/example/libhello/hi/hi.go
@@ -4,5 +4,6 @@ package hi
import "fmt"
func Hello(name string) {
+ panic("End of the World...")
fmt.Printf("Hello, %s!\n", name)
}
@hyangah
Copy link
Author

hyangah commented Dec 23, 2014

adb crash log printed out the panic msg. (nexus 7, android 4.4.4)

adb logcat | grep 30631
V/Zygote (30631): Switching descriptor 33 to /dev/null
V/Zygote (30631): Switching descriptor 10 to /dev/null
D/dalvikvm(30631): Late-enabling CheckJNI
I/ActivityManager( 496): Start proc com.example.hello for activity com.example.hello/.MainActivity: pid=30631 uid=10184 gids={50184, 1028, 1015}
D/ActivityThread(30631): handleBindApplication:com.example.hello
D/ActivityThread(30631): setTargetHeapUtilization:0.75
D/ActivityThread(30631): setTargetHeapMinFree:524288
D/dalvikvm(30631): Trying to load lib /data/app-lib/com.example.hello-1/libgojni.so 0x42549488
D/dalvikvm(30631): Added shared lib /data/app-lib/com.example.hello-1/libgojni.so 0x42549488
I/Go (30631): app.Run
I/go/Seq (30631): loaded go/Seq
I/Go (30631): Runtime started
E/Go (30631): panic: End of the World...
E/Go (30631): goroutine 18 [running, locked to thread]:
E/Go (30631): golang.org/x/mobile/example/libhello/hi.Hello(0x7b3d0028, 0x5)
E/Go (30631): /src/golang.org/x/mobile/example/libhello/hi/hi.go:7 +0x60
E/Go (30631): golang.org/x/mobile/example/libhello/hi/go_hi.proxy_Hello(0x7b3d0040, 0x7b3d0030)
E/Go (30631): /src/golang.org/x/mobile/example/libhello/hi/go_hi/go_hi.go:14 +0x48
E/Go (30631): golang.org/x/mobile/bind/java.Send(0x5a4b3538, 0x2, 0x1, 0x40000120, 0xe, 0x40000168, 0x40000170)
E/Go (30631): /src/golang.org/x/mobile/bind/java/seq_android.go:35 +0x12c
E/Go (30631): goroutine 1 [chan receive, locked to thread]:
E/Go (30631): golang.org/x/mobile/app.run(0x0, 0x0, 0x0, 0x0)
E/Go (30631): /src/golang.org/x/mobile/app/android.go:252 +0x168
E/Go (30631): golang.org/x/mobile/app.Run(0x0, 0x0, 0x0, 0x0)
E/Go (30631): /src/golang.org/x/mobile/app/app.go:18 +0x3c
E/Go (30631): main.main()
E/Go (30631): /src/golang.org/x/mobile/example/libhello/main.go:19 +0x54
E/Go (30631): goroutine 17 [semacquire, locked to thread]:
E/Go (30631): sync.(_Cond).Wait(0x6b19aaf0)
E/Go (30631): /go/src/sync/cond.go:62 +0xcc
E/Go (30631): golang.org/x/mobile/bind/java.Recv(0x672b3c38, 0x672b3c40, 0x687c57b0, 0x62b7c9d8, 0x41d20e10)
E/Go (30631): /src/golang.org/x/mobile/bind/java/seq_android.go:107 +0x68
E/Go (30631): goroutine 5 [syscall]:
E/Go (30631): syscall.Syscall(0x3, 0x2b, 0x7b3fe000, 0x400, 0x0, 0x7b3c6500, 0x400)
E/Go (30631): /go/src/syscall/asm_linux_arm.s:17 +0x8
E/Go (30631): syscall.read(0x2b, 0x7b3fe000, 0x400, 0x400, 0x6883b000, 0x0, 0x0)
E/Go (30631): /go/src/syscall/zsyscall_linux_arm.go:867 +0x80
E/Go (30631): syscall.Read(0x2b, 0x7b3fe000, 0x400, 0x400, 0x7b3c0688, 0x0, 0x0)
E/Go (30631): /go/src/syscall/syscall_unix.go:136 +0x54
E/Go (30631): os.(_File).read(0x7b3b6158, 0x7b3fe000, 0x400, 0x400, 0x1, 0x0, 0x0)
E/Go (30631): /go/src/os/file_unix.go:203 +0x5c
E/Go (30631): os.(_File).Read(0x7b3b6158, 0x7b3fe000, 0x400, 0x400, 0x6b0a544c, 0x0, 0x0)
E/Go (30631): /go/src/os/file.go:95 +0x80
E/Go (30631): bufio.(_Reader).fill(0x7b3d4060)
E/Go (30631): /go/src/bufio/bufio.go:97 +0x1d8
E/Go (30631): bufio.(*Reader).ReadSlice(0x7b3d4060, 0x6884cf0a, 0x0, 0x0, 0x0, 0x0, 0x0)
E/Go (30631): /go/src/bufio/bufio.go:295 +0x2a4
....
E/Go (30631): goroutine 19 [syscall, locked to thread]:
E/Go (30631): runtime.goexit()
E/Go (30631): /go/src/runtime/asm_arm.s:1312 +0x4
I/ActivityManager( 496): Process com.example.hello (pid 30631) has died.
D/Zygote ( 140): Process 30631 exited cleanly (2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment