mattn / go-webkit

webkit widget for go-gtk
http://mattn.kaoriya.net/
293 stars 37 forks source link

Minimal example crashes with Go 1 #4

Open taruti opened 12 years ago

taruti commented 12 years ago
package main

import (
    "github.com/mattn/go-gtk/gtk"
    "github.com/mattn/go-webkit/webkit"
    )

func main() {
    gtk.Init(nil)
    println("Before crash")
    wv := webkit.WebView()
    _ = wv
    gtk.Main()
}

Crashes with Go1. Amd64 Ubuntu 12.04.

Before crash
runtime: signal received on thread not created by Go.
Segmentation fault (core dumped)

Gdb just shows

GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/taruti/go-work/src/bitbucket.org/taruti/webtest/webtest...done.
Loading Go Runtime support.
(gdb) run
Starting program: /home/taruti/go-work/src/bitbucket.org/taruti/webtest/webtest
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffeaba2700 (LWP 30439)]
[New Thread 0x7fffe989c700 (LWP 30440)]
[New Thread 0x7fffe8f9b700 (LWP 30441)]
[New Thread 0x7fffa3ffd700 (LWP 30442)]
[New Thread 0x7fffa37fc700 (LWP 30444)]
[New Thread 0x7fffa2ffb700 (LWP 30445)]
runtime: signal received on thread not created by Go.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffa3ffd700 (LWP 30442)]
runtime.sigtramp () at /build/buildd/golang-1/src/pkg/runtime/sys_linux_amd64.s:168
168 /build/buildd/golang-1/src/pkg/runtime/sys_linux_amd64.s: No such file or directory.
(gdb) bt
#0  runtime.sigtramp () at /build/buildd/golang-1/src/pkg/runtime/sys_linux_amd64.s:168
#1  0x000000000041631c in runtime.sigtramp () at /build/buildd/golang-1/src/pkg/runtime/sys_linux_amd64.s:182
#2  0x0000000000000000 in ?? ()
(gdb) q

http://code.google.com/p/go/issues/detail?id=3250 is probably related.

taruti commented 12 years ago

Debugged this further and something in the code causes dbus-launch to be run.

13972 execve("/usr/bin/dbus-launch", ["dbus-launch", "--autolaunch=787e8c58ef2d648074f"..., "--binary-syntax", "--close-stderr"], [/* 19 vars */]) = 0

which results in SIGCHLD when exiting that is delivered to a non-go-launched thread - and thus the whole runtime aborts.

taruti commented 12 years ago

This seems to be reproducable with remote X (ssh -X somemachine) and occurs because of dbus.

1) Local ./webtest -> works 2) Remote dbus-launch ./webtest -> works 3) Remote ./webtest -> segfaults

mattn commented 12 years ago

This is not issue of go-webkit. I guess. Can I close this?

taruti commented 12 years ago

On Wed, 17 Oct 2012 06:55:36 -0700, mattn notifications@github.com wrote:

This is not issue of go-webkit. I guess. Can I close this?

Yes. Seemed a problem with webkit, but now I know better.

Documenting the dbus-launch workaround might make sense.

mattn commented 12 years ago

@taruti , I'm not native speaker, so I can't add this workaround to docs cleanly. Can you please fork/pull-req?