Skip to content

Hang on Arch Linux #6

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

Closed
zachlatta opened this issue Dec 9, 2013 · 26 comments
Closed

Hang on Arch Linux #6

zachlatta opened this issue Dec 9, 2013 · 26 comments

Comments

@zachlatta
Copy link
Contributor

The headless example program in the README silently hangs on Arch Linux 64bit.

Repro steps:

  1. Make sure you are running
  2. Install https://www.archlinux.org/packages/extra/x86_64/webkitgtk/
  3. Run the headless example program from the README (https://github.com/sourcegraph/webloop#operating-a-headless-webkit-and-running-arbitrary-javascript-in-the-page)
  4. Notice that the program silently hangs

System dump: https://gist.github.com/zachlatta/2fe43a3044c5dfbdb8dd

@sqs
Copy link
Member

sqs commented Dec 9, 2013

Hmm. I actually developed and tested it on Arch Linux 64-bit using that webkitgtk package, so I'm not sure what the issue is. Do you have any clues as to what it's waiting for?

@zachlatta
Copy link
Contributor Author

After some research, it looks like it's getting stuck on line 48 of webloop.go. Looking further into it now.

@zachlatta
Copy link
Contributor Author

Alright, so I haven't played too much with channels, but I think it's waiting for the view channel to finish executing before returning, but it never finishes. Any ideas what might be causing this?

@sqs
Copy link
Member

sqs commented Dec 9, 2013

Hmm. Do you have $DISPLAY set? That view channel just blocks until it has set up the GTK callbacks--it doesn't actually do much work. I believe (but I'm not 100% sure) I have seen it hang here when I didn't set $DISPLAY (and therefore GTK was unable to do any work).

@zachlatta
Copy link
Contributor Author

Yeah, $DISPLAY is currently set to :0.

@sqs
Copy link
Member

sqs commented Dec 9, 2013

Do other GTK programs, or other WebKit2 programs, such as webkit-eval-js or the tests in https://github.com/sourcegraph/go-webkit2, run for you?

@zachlatta
Copy link
Contributor Author

The tests in go-webkit2 seem to pass.

=== RUN TestSettings_EnableWriteConsoleMessagesToStdout
--- PASS: TestSettings_EnableWriteConsoleMessagesToStdout (0.01 seconds)
=== RUN TestSettings_AutoLoadImages
--- PASS: TestSettings_AutoLoadImages (0.00 seconds)
=== RUN TestSettings_SetUserAgentWithApplicationDetails
--- PASS: TestSettings_SetUserAgentWithApplicationDetails (0.00 seconds)
=== RUN TestDefaultWebContext
--- PASS: TestDefaultWebContext (0.00 seconds)
=== RUN TestWebContext_CacheModel
--- PASS: TestWebContext_CacheModel (0.00 seconds)
=== RUN TestWebContext_ClearCache
--- PASS: TestWebContext_ClearCache (0.00 seconds)
=== RUN TestNewWebView
--- PASS: TestNewWebView (0.00 seconds)
=== RUN TestNewWebViewWithContext
--- PASS: TestNewWebViewWithContext (0.00 seconds)
=== RUN TestWebView_Context
--- PASS: TestWebView_Context (0.00 seconds)
=== RUN TestWebView_LoadURI
--- PASS: TestWebView_LoadURI (1.06 seconds)
=== RUN TestWebView_LoadURI_load_failed
--- PASS: TestWebView_LoadURI_load_failed (0.00 seconds)
=== RUN TestWebView_LoadHTML
--- PASS: TestWebView_LoadHTML (0.00 seconds)
=== RUN TestWebView_Title
--- PASS: TestWebView_Title (0.00 seconds)
=== RUN TestWebView_URI
--- PASS: TestWebView_URI (0.00 seconds)
=== RUN TestWebView_Settings
--- PASS: TestWebView_Settings (0.00 seconds)
=== RUN TestWebView_JavaScriptGlobalContext
--- PASS: TestWebView_JavaScriptGlobalContext (0.00 seconds)
=== RUN TestWebView_RunJavaScript
--- PASS: TestWebView_RunJavaScript (0.00 seconds)
=== RUN TestWebView_RunJavaScript_exception
--- PASS: TestWebView_RunJavaScript_exception (0.00 seconds)
=== RUN TestWebView_GetSnapshot
--- PASS: TestWebView_GetSnapshot (0.00 seconds)
=== RUN: Example
--- PASS: Example (1.6421456s)
PASS
ok      github.com/sourcegraph/go-webkit2/webkit2   2.842s

@sqs
Copy link
Member

sqs commented Dec 9, 2013

What if you set up printlns or breakpoints in the various blocks in https://github.com/sourcegraph/webloop/blob/master/webloop.go#L25-L45? What, if anything, gets executed? And are there other goroutines blocking anything else (perhaps another goroutine is blocking the IdleAdd fn from running?)?

Thanks for your patience 😃

@zachlatta
Copy link
Contributor Author

I was playing around with that earlier. Nothing in the passed function is executed. Could this be an issue with glib?

@sqs
Copy link
Member

sqs commented Dec 9, 2013

It could be, but I'm inclined to blame my code here (since other glib consumers seem to work).

@zachlatta
Copy link
Contributor Author

Hmm, how can I check if other goroutines are blocking anything else?

@sqs
Copy link
Member

sqs commented Dec 9, 2013

Run it in gdb and then ctrl-C while it's hanging, or periodically call and print http://golang.org/pkg/runtime/#Stack (there are libs that do this for you but I forget which ones right now).

@zachlatta
Copy link
Contributor Author

GNU gdb (GDB) 7.6.1
Copyright (C) 2013 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-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/file...done.
warning: File "/home/zach/dev/go/src/pkg/runtime/runtime-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
    add-auto-load-safe-path /home/zach/dev/go/src/pkg/runtime/runtime-gdb.py
line to your configuration file "/home/zach/.gdbinit".
To completely disable this security protection add
    set auto-load safe-path /
line to your configuration file "/home/zach/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
    info "(gdb)Auto-loading safe path"
(gdb) run
Starting program: /tmp/file 
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe367d700 (LWP 8069)]
[New Thread 0x7fffe2e7c700 (LWP 8070)]
[New Thread 0x7fffe267b700 (LWP 8071)]
[New Thread 0x7fffe1e7a700 (LWP 8072)]
^C
Program received signal SIGINT, Interrupt.
runtime.futex () at /home/zach/dev/go/src/pkg/runtime/sys_linux_amd64.s:269
269     RET

I really appreciate you going out of your way to get this resolved :-).

@sqs
Copy link
Member

sqs commented Dec 9, 2013

Happy to help! 😄

When you hit ctrl-C and get to the gdb> prompt, type "bt" or "thread apply all bt" (I think the latter) and that should print the goroutine stack traces.

@zachlatta
Copy link
Contributor Author

(gdb) thread apply all bt

Thread 5 (Thread 0x7fffe1e7a700 (LWP 8072)):
#0  0x00007ffff312603f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007ffff3811e04 in WTF::TCMalloc_PageHeap::scavengerThread() () from /usr/lib/libjavascriptcoregtk-3.0.so.0
#2  0x00007ffff3811e29 in WTF::TCMalloc_PageHeap::runScavengerThread(void*) ()
   from /usr/lib/libjavascriptcoregtk-3.0.so.0
#3  0x00007ffff31220a2 in start_thread () from /usr/lib/libpthread.so.0
#4  0x00007ffff2e5449d in clone () from /usr/lib/libc.so.6

Thread 4 (Thread 0x7fffe267b700 (LWP 8071)):
#0  runtime.futex () at /home/zach/dev/go/src/pkg/runtime/sys_linux_amd64.s:269
#1  0x000000000042cee7 in runtime.futexsleep (addr=void, val=void, ns=void)
    at /home/zach/dev/go/src/pkg/runtime/os_linux.c:49
#2  0x0000000000425916 in runtime.notesleep (n=void) at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:134
#3  0x0000000000430fb1 in stopm () at /home/zach/dev/go/src/pkg/runtime/proc.c:932
#4  0x0000000000431b6d in findrunnable () at /home/zach/dev/go/src/pkg/runtime/proc.c:1237
#5  0x0000000000431e43 in schedule () at /home/zach/dev/go/src/pkg/runtime/proc.c:1320
#6  0x00000000004308f6 in runtime.mstart () at /home/zach/dev/go/src/pkg/runtime/proc.c:606
#7  0x000000000041b3f4 in crosscall_amd64 () at /home/zach/dev/go/src/pkg/runtime/cgo/gcc_amd64.S:35
#8  0x00007fffe267b700 in ?? ()
#9  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fffe2e7c700 (LWP 8070)):
#0  runtime.futex () at /home/zach/dev/go/src/pkg/runtime/sys_linux_amd64.s:269
#1  0x000000000042cf52 in runtime.futexsleep (addr=void, val=void, ns=void)
    at /home/zach/dev/go/src/pkg/runtime/os_linux.c:55
#2  0x00000000004259ba in notetsleep (n=void, ns=void, deadline=void)
    at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:156
#3  0x0000000000425b10 in runtime.notetsleepg (n=void, ns=void)
    at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:190
#4  0x000000000042c6c3 in runtime.MHeap_Scavenger () at /home/zach/dev/go/src/pkg/runtime/mheap.c:463
#5  0x0000000000432130 in ?? () at /home/zach/dev/go/src/pkg/runtime/proc.c:1385
#6  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fffe367d700 (LWP 8069)):
#0  runtime.futex () at /home/zach/dev/go/src/pkg/runtime/sys_linux_amd64.s:269
#1  0x000000000042cee7 in runtime.futexsleep (addr=void, val=void, ns=void)
    at /home/zach/dev/go/src/pkg/runtime/os_linux.c:49
#2  0x0000000000425916 in runtime.notesleep (n=void) at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:134
#3  0x0000000000433ff0 in sysmon () at /home/zach/dev/go/src/pkg/runtime/proc.c:2373
#4  0x00000000004308c5 in runtime.mstart () at /home/zach/dev/go/src/pkg/runtime/proc.c:597
#5  0x000000000041b3f4 in crosscall_amd64 () at /home/zach/dev/go/src/pkg/runtime/cgo/gcc_amd64.S:35
#6  0x00007fffe367d700 in ?? ()
#7  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ffff7f90980 (LWP 8065)):
#0  runtime.futex () at /home/zach/dev/go/src/pkg/runtime/sys_linux_amd64.s:269
#1  0x000000000042cee7 in runtime.futexsleep (addr=void, val=void, ns=void)
    at /home/zach/dev/go/src/pkg/runtime/os_linux.c:49
#2  0x0000000000425916 in runtime.notesleep (n=void) at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:134
#3  0x0000000000430fb1 in stopm () at /home/zach/dev/go/src/pkg/runtime/proc.c:932
#4  0x0000000000431b6d in findrunnable () at /home/zach/dev/go/src/pkg/runtime/proc.c:1237
#5  0x0000000000431e43 in schedule () at /home/zach/dev/go/src/pkg/runtime/proc.c:1320
#6  0x0000000000432048 in park0 (gp=void) at /home/zach/dev/go/src/pkg/runtime/proc.c:1361
#7  0x000000000043e5fb in runtime.mcall (fn=void) at /home/zach/dev/go/src/pkg/runtime/asm_amd64.s:178
#8  0x0000000000b99248 in runtime.g0 ()
#9  0x000000000043e50d in _rt0_go () at /home/zach/dev/go/src/pkg/runtime/asm_amd64.s:100
#10 0x0000000000000001 in ?? ()
#11 0x00007fffffffe1d8 in ?? ()
#12 0x0000000000000001 in ?? ()
#13 0x00007fffffffe1d8 in ?? ()
#14 0x0000000000000000 in ?? ()

Sorry, not too familiar with gdb.

@sqs
Copy link
Member

sqs commented Dec 9, 2013

Hmm, I am a bit fuzzy too, but I think I was wrong...these are just the
runtime lib backtraces because they are for the system threads. Try
"goroutine apply all bt" or if that doesn't work, goroutine 0 bt,
goroutine 1 bt, and so on until there are no more goroutines to get the
backtrace for.

http://golang.org/doc/gdb

On Mon, Dec 9, 2013 at 2:02 PM, Zach Latta [email protected] wrote:

(gdb) thread apply all bt

Thread 5 (Thread 0x7fffe1e7a700 (LWP 8072)):
#0 0x00007ffff312603f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007ffff3811e04 in WTF::TCMalloc_PageHeap::scavengerThread() () from /usr/lib/libjavascriptcoregtk-3.0.so.0
#2 0x00007ffff3811e29 in WTF::TCMalloc_PageHeap::runScavengerThread(void*) ()
from /usr/lib/libjavascriptcoregtk-3.0.so.0
#3 0x00007ffff31220a2 in start_thread () from /usr/lib/libpthread.so.0
#4 0x00007ffff2e5449d in clone () from /usr/lib/libc.so.6

Thread 4 (Thread 0x7fffe267b700 (LWP 8071)):
#0 runtime.futex () at /home/zach/dev/go/src/pkg/runtime/sys_linux_amd64.s:269
#1 0x000000000042cee7 in runtime.futexsleep (addr=void, val=void, ns=void)
at /home/zach/dev/go/src/pkg/runtime/os_linux.c:49
#2 0x0000000000425916 in runtime.notesleep (n=void) at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:134
#3 0x0000000000430fb1 in stopm () at /home/zach/dev/go/src/pkg/runtime/proc.c:932
#4 0x0000000000431b6d in findrunnable () at /home/zach/dev/go/src/pkg/runtime/proc.c:1237
#5 0x0000000000431e43 in schedule () at /home/zach/dev/go/src/pkg/runtime/proc.c:1320
#6 0x00000000004308f6 in runtime.mstart () at /home/zach/dev/go/src/pkg/runtime/proc.c:606
#7 0x000000000041b3f4 in crosscall_amd64 () at /home/zach/dev/go/src/pkg/runtime/cgo/gcc_amd64.S:35
#8 0x00007fffe267b700 in ?? ()
#9 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fffe2e7c700 (LWP 8070)):
#0 runtime.futex () at /home/zach/dev/go/src/pkg/runtime/sys_linux_amd64.s:269
#1 0x000000000042cf52 in runtime.futexsleep (addr=void, val=void, ns=void)
at /home/zach/dev/go/src/pkg/runtime/os_linux.c:55
#2 0x00000000004259ba in notetsleep (n=void, ns=void, deadline=void)
at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:156
#3 0x0000000000425b10 in runtime.notetsleepg (n=void, ns=void)
at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:190
#4 0x000000000042c6c3 in runtime.MHeap_Scavenger () at /home/zach/dev/go/src/pkg/runtime/mheap.c:463
#5 0x0000000000432130 in ?? () at /home/zach/dev/go/src/pkg/runtime/proc.c:1385
#6 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fffe367d700 (LWP 8069)):
#0 runtime.futex () at /home/zach/dev/go/src/pkg/runtime/sys_linux_amd64.s:269
#1 0x000000000042cee7 in runtime.futexsleep (addr=void, val=void, ns=void)
at /home/zach/dev/go/src/pkg/runtime/os_linux.c:49
#2 0x0000000000425916 in runtime.notesleep (n=void) at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:134
#3 0x0000000000433ff0 in sysmon () at /home/zach/dev/go/src/pkg/runtime/proc.c:2373
#4 0x00000000004308c5 in runtime.mstart () at /home/zach/dev/go/src/pkg/runtime/proc.c:597
#5 0x000000000041b3f4 in crosscall_amd64 () at /home/zach/dev/go/src/pkg/runtime/cgo/gcc_amd64.S:35
#6 0x00007fffe367d700 in ?? ()
#7 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ffff7f90980 (LWP 8065)):
#0 runtime.futex () at /home/zach/dev/go/src/pkg/runtime/sys_linux_amd64.s:269
#1 0x000000000042cee7 in runtime.futexsleep (addr=void, val=void, ns=void)
at /home/zach/dev/go/src/pkg/runtime/os_linux.c:49
#2 0x0000000000425916 in runtime.notesleep (n=void) at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:134
#3 0x0000000000430fb1 in stopm () at /home/zach/dev/go/src/pkg/runtime/proc.c:932
#4 0x0000000000431b6d in findrunnable () at /home/zach/dev/go/src/pkg/runtime/proc.c:1237
#5 0x0000000000431e43 in schedule () at /home/zach/dev/go/src/pkg/runtime/proc.c:1320
#6 0x0000000000432048 in park0 (gp=void) at /home/zach/dev/go/src/pkg/runtime/proc.c:1361
#7 0x000000000043e5fb in runtime.mcall (fn=void) at /home/zach/dev/go/src/pkg/runtime/asm_amd64.s:178
#8 0x0000000000b99248 in runtime.g0 ()
#9 0x000000000043e50d in _rt0_go () at /home/zach/dev/go/src/pkg/runtime/asm_amd64.s:100
#10 0x0000000000000001 in ?? ()
#11 0x00007fffffffe1d8 in ?? ()
#12 0x0000000000000001 in ?? ()
#13 0x00007fffffffe1d8 in ?? ()
#14 0x0000000000000000 in ?? ()

Sorry, not too familiar with gdb :-P


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-30178337
.

Quinn Slack
Sourcegraph
https://sourcegraph.com
+1 847-347-8478

@zachlatta
Copy link
Contributor Author

(gdb) goroutine 0 bt
No such goroutine:  0
(gdb) goroutine 1 bt
#0  0x0000000000431f66 in runtime.park (unlockf=void, lock=void, reason=void)
    at /home/zach/dev/go/src/pkg/runtime/proc.c:1342
#1  0x000000000041f782 in runtime.chanrecv (c=void, ep=void, selected=void, received=void)
    at /home/zach/dev/go/src/pkg/runtime/chan.c:385
#2  0x000000000041fbc8 in runtime.chanrecv1 (t=void, c=void) at /home/zach/dev/go/src/pkg/runtime/chan.c:446
#3  0x0000000000453bc9 in github.com/sourcegraph/webloop.(*Context).NewView (c=0x7ffff7fcbeb8, ~anon0=0xc2100001e0)
    at /home/zach/go/src/github.com/sourcegraph/webloop/webloop.go:47
#4  0x000000000041b8c7 in main.main () at /tmp/file.go:11
(gdb) goroutine 2 bt
#0  runtime.notetsleepg (n=void, ns=void) at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:190
#1  0x000000000042c6c3 in runtime.MHeap_Scavenger () at /home/zach/dev/go/src/pkg/runtime/mheap.c:463
#2  0x0000000000432130 in ?? () at /home/zach/dev/go/src/pkg/runtime/proc.c:1385
#3  0x0000000000000000 in ?? ()
(gdb) goroutine 3 bt
#0  runtime.goexit () at /home/zach/dev/go/src/pkg/runtime/proc.c:1394
#1  0x0000000000000000 in ?? ()
(gdb) goroutine 4 bt
No such goroutine:  4

@sqs
Copy link
Member

sqs commented Dec 9, 2013

Hmm, that's really strange. It's not doing anything. It's as though GTK
just discarded that IdleAdd callback. I don't have any more ideas. If I
have time in the next few days, I'll try to boot up an Arch Linux 64 VM and
give it a spin. Let me know if you uncover anything in the next few days!

On Mon, Dec 9, 2013 at 2:23 PM, Zach Latta [email protected] wrote:

(gdb) goroutine 0 bt
No such goroutine: 0
(gdb) goroutine 1 bt
#0 0x0000000000431f66 in runtime.park (unlockf=void, lock=void, reason=void)
at /home/zach/dev/go/src/pkg/runtime/proc.c:1342
#1 0x000000000041f782 in runtime.chanrecv (c=void, ep=void, selected=void, received=void)
at /home/zach/dev/go/src/pkg/runtime/chan.c:385
#2 0x000000000041fbc8 in runtime.chanrecv1 (t=void, c=void) at /home/zach/dev/go/src/pkg/runtime/chan.c:446
#3 0x0000000000453bc9 in github.com/sourcegraph/webloop.(*Context).NewView (c=0x7ffff7fcbeb8, ~anon0=0xc2100001e0)
at /home/zach/go/src/github.com/sourcegraph/webloop/webloop.go:47
#4 http://github.com/sourcegraph/webloop/webloop.go:47#4 0x000000000041b8c7 in main.main () at /tmp/file.go:11
(gdb) goroutine 2 bt
#0 runtime.notetsleepg (n=void, ns=void) at /home/zach/dev/go/src/pkg/runtime/lock_futex.c:190
#1 0x000000000042c6c3 in runtime.MHeap_Scavenger () at /home/zach/dev/go/src/pkg/runtime/mheap.c:463
#2 0x0000000000432130 in ?? () at /home/zach/dev/go/src/pkg/runtime/proc.c:1385
#3 0x0000000000000000 in ?? ()
(gdb) goroutine 3 bt
#0 runtime.goexit () at /home/zach/dev/go/src/pkg/runtime/proc.c:1394
#1 0x0000000000000000 in ?? ()


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-30180177
.

Quinn Slack
Sourcegraph
https://sourcegraph.com
+1 847-347-8478

@zachlatta
Copy link
Contributor Author

Alright, thanks! I'll definitely let you know if I find out any more info.

@boutros
Copy link

boutros commented Jan 27, 2014

I experience the same behaviour on Ubuntu 13.10 saucy, trying to run the headless example.

The program silently fails, or rather it looks like line 11 blocks: view := ctx.NewView()

@pakohan
Copy link

pakohan commented Nov 12, 2014

I fixed the example code:

package main

import (
    "fmt"
    "os"
    "runtime"

    "github.com/conformal/gotk3/gtk"
    "github.com/sourcegraph/webloop"
)

func main() {
    gtk.Init(nil)
    go func() {
        runtime.LockOSThread()
        gtk.Main()
    }()

    ctx := webloop.New()
    view := ctx.NewView()
    defer view.Close()
    view.Open("http://google.com")
    err := view.Wait()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Failed to load URL: %s", err)
        os.Exit(1)
    }
    res, err := view.EvaluateJavaScript("document.title")
    if err != nil {
        fmt.Fprintf(os.Stderr, "Failed to run JavaScript: %s", err)
        os.Exit(1)
    }
    fmt.Printf("JavaScript returned: %q\n", res)
}

@pakohan
Copy link

pakohan commented Nov 12, 2014

@boutros :
the problem is the blocking channel in NewView() :
the func added via IdleAdd was never called.

@rverton
Copy link

rverton commented Dec 7, 2014

I can confirm this hang on Ubuntu 14.04. The improved example from @pakohan fixed it. I suggest updating the example in the README.

sqs added a commit that referenced this issue Dec 7, 2014
@sqs
Copy link
Member

sqs commented Dec 7, 2014

Thanks! I updated it in example_test.go and in the readme in d990ee2. I actually haven't tried it myself (I'm on a plane right now on a Mac), but 2 people saying it works is good enough for me to update it for now.

@sqs sqs closed this as completed Dec 7, 2014
@rverton
Copy link

rverton commented Dec 7, 2014

I'm also on a mac and did not get it running here. I set up a docker image for this if you are interested: https://registry.hub.docker.com/u/rverton/golang-webkit/

@Somesh-zz
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants