ActiveState/termtest

"panic: unaligned 64-bit atomic operation" in windows 32bit

Opened this issue · 0 comments

"panic: unaligned 64-bit atomic operation" in windows 32bit

Spawning 'C:\Windows\system32\cmd.exe' from C:\Users\admin\AppData\Local\Temp\2992344586
panic: unaligned 64-bit atomic operation

goroutine 1 [running]:
runtime/internal/atomic.panicUnaligned()
        runtime/internal/atomic/unaligned.go:8 +0x2b
runtime/internal/atomic.Store64(0x1c62864, 0x17cef992dab2f618)
        runtime/internal/atomic/atomic_386.s:237 +0x10
github.com/ActiveState/termtest/xpty.(*PassthroughPipe).ReadRune(0x1c62840)
        github.com/ActiveState/termtest/xpty@v0.6.0/passthrough_pipe.go:81 +0x1db
github.com/ActiveState/termtest/xpty.(*Xpty).ReadRune(0x1c6d1e8)
        github.com/ActiveState/termtest/xpty@v0.6.0/xpty.go:131 +0x26
github.com/ActiveState/termtest/expect.(*Console).Expect(0x1c00a80, {0x1c7bd10, 0x1, 0x1})
        github.com/ActiveState/termtest/expect@v0.7.0/expect.go:94 +0x59e
github.com/ActiveState/termtest.(*ConsoleProcess).Expect(0x1c211f0, {0x4af5f6, 0x15}, {0x0, 0x0, 0x0})
        github.com/ActiveState/termtest@v0.7.2/conproc.go:220 +0x198

The lastRead field must be aligned to an 8-byte boundary in a 32-bit environment, necessitating a modification to the PassthroughPipe structure as follows.

type PassthroughPipe struct {
	lastRead int64
	rdr      *bufio.Reader
	deadline time.Time
	ctx      context.Context
	cancel   context.CancelFunc
}

https://github.com/ActiveState/termtest/blob/master/xpty/passthrough_pipe.go#L27