rjkroege/edwood

Crash when attempting to snarf text on Windows 10

atilde opened this issue · 4 comments

edwood is crashing when attempting to snarf text on Windows 10.

I just build the application from master today.

Here's the entire log, from startup to crash.

PS D:\Code\ahedgewitch\raylux-jvm> edwood
9P fileserver listening on address 127.0.0.1:63661
panic: syscall: string with NUL passed to StringToUTF16

goroutine 25 [running, locked to thread]:
syscall.StringToUTF16(...)
        D:/Applications/Go/src/syscall/syscall_windows.go:33
github.com/atotto/clipboard.writeAll({0xc0005dbb00, 0x806})
        C:/Users/ahw/go/pkg/mod/github.com/atotto/clipboard@v0.1.1/clipboard_windows.go:91 +0x519
github.com/atotto/clipboard.WriteAll(...)
        C:/Users/ahw/go/pkg/mod/github.com/atotto/clipboard@v0.1.1/clipboard.go:15
github.com/ktye/duitdraw.(*Display).writeSnarf(...)
        C:/Users/ahw/go/pkg/mod/github.com/ktye/duitdraw@v0.0.0-20190328070634-a54e9bd5a862/snarf.go:22
github.com/ktye/duitdraw.(*Display).WriteSnarf(0x0, {0xc0005db200, 0xc0005db200, 0x72f548})
        C:/Users/ahw/go/pkg/mod/github.com/ktye/duitdraw@v0.0.0-20190328070634-a54e9bd5a862/display.go:129 +0x2a
main.acmeputsnarf(...)
        D:/Code/Go/edwood/acme.go:585
main.cut(0xc000088010, 0xc0001d6d20, 0x485542, 0x1, 0x1, {0x0, 0x4f7da0})
        D:/Code/Go/edwood/exec.go:346 +0x503
main.(*Text).Select(0xc0001d6d20)
        D:/Code/Go/edwood/text.go:1177 +0x4d0
main.MovedMouse(0xc00007d180, {{0xc00049ff10, 0xc000088010}, 0x0, 0x0})
        D:/Code/Go/edwood/acme.go:351 +0x75a
main.mousethread(0xc00007d180, {0x57e4f8, 0xc000088010})
        D:/Code/Go/edwood/acme.go:230 +0x21d
created by main.main.func1
        D:/Code/Go/edwood/acme.go:138 +0x46f

I have changed the clipboard code lately. Does this replicate with the last released version?

The last release works as expected.

@ahedgewitch: as a consequence of fixing #331, I changed the snarfing code in pr #449. Does this still replicate as of c891388? If so, can you provide me with some more details on how to replicate?

I cloned the latest code (c891388) and it is no longer crashing when attempting to snarf or paste text on Windows 10.