Skip to content
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

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

Open
howmp opened this issue May 13, 2024 · 0 comments
Open

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

howmp opened this issue May 13, 2024 · 0 comments

Comments

@howmp
Copy link

howmp commented May 13, 2024

"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/[email protected]/passthrough_pipe.go:81 +0x1db
github.com/ActiveState/termtest/xpty.(*Xpty).ReadRune(0x1c6d1e8)
        github.com/ActiveState/termtest/[email protected]/xpty.go:131 +0x26
github.com/ActiveState/termtest/expect.(*Console).Expect(0x1c00a80, {0x1c7bd10, 0x1, 0x1})
        github.com/ActiveState/termtest/[email protected]/expect.go:94 +0x59e
github.com/ActiveState/termtest.(*ConsoleProcess).Expect(0x1c211f0, {0x4af5f6, 0x15}, {0x0, 0x0, 0x0})
        github.com/ActiveState/[email protected]/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

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

1 participant