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 #27

Closed
jobinthompu opened this issue May 13, 2022 · 2 comments · Fixed by GoogleCloudPlatform/alloydb-go-connector#33 or #38
Closed

panic: unaligned 64-bit atomic operation #27

jobinthompu opened this issue May 13, 2022 · 2 comments · Fixed by GoogleCloudPlatform/alloydb-go-connector#33 or #38
Assignees
Labels
priority: p0 Highest priority. Critical issue. P0 implies highest priority. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@jobinthompu
Copy link

Bug Description

While using linux 386 version of Auth Proxy I got below error and auth proxy got terminated unexpectedly.

Example code (or command)

// example

Stacktrace

[jobigeor@confluent ~]$ psql -h 127.0.0.1 -U ccloud -W -d alloy -p 6000
Password: 
[projects/xxx/locations/us-central1/clusters/confluent-alloy/instances/confluent-alloy-instance] accepted connection from 127.0.0.1:41526
panic: unaligned 64-bit atomic operation

goroutine 43 [running]:
runtime/internal/atomic.panicUnaligned()
        /usr/local/go/src/runtime/internal/atomic/unaligned.go:8 +0x2d
runtime/internal/atomic.Xadd64(0x906413c, 0x1)
        /usr/local/go/src/runtime/internal/atomic/atomic_386.s:125 +0x11
cloud.google.com/go/alloydbconn.(*Dialer).Dial.func3()
        /workspace/vendor/cloud.google.com/go/alloydbconn/dialer.go:206 +0x6e
created by cloud.google.com/go/alloydbconn.(*Dialer).Dial
        /workspace/vendor/cloud.google.com/go/alloydbconn/dialer.go:205 +0xc83
psql: error: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
[1]+  Exit 2                  sudo ./alloydb-auth-proxy projects/xxx/locations/us-central1/clusters/confluent-alloy/instances/confluent-alloy-instance --port 6000
[jobigeor@confluent ~]$ 

How to reproduce

  1. wget https://storage.googleapis.com/alloydb-auth-proxy/v0.1.0/alloydb-auth-proxy.linux.386 -O alloydb-auth-proxy
  2. follow rest of the steps in documentation

Environment

  1. OS type and version: Linux 3.10.0-1160.62.1.el7.x86_64 chore: import Cloud SQL Auth Proxy #1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  2. Proxy version: alloydb-auth-proxy version 0.1.0+linux.386
@jobinthompu jobinthompu added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label May 13, 2022
@kurtisvg kurtisvg self-assigned this May 13, 2022
@kurtisvg kurtisvg changed the title psql: error: server closed the connection unexpectedly while using Linux 386 panic: unaligned 64-bit atomic operation May 13, 2022
@kurtisvg
Copy link
Contributor

I think this is the classic gotcha of the atomic sync package.

So we need to:

  1. Update the struct to be 64-bit aligned (or stop using atomic.sync)
  2. Add tests to use 386 compilations to prevent regressions

@kurtisvg kurtisvg added the priority: p0 Highest priority. Critical issue. P0 implies highest priority. label May 13, 2022
@VexpoCity
Copy link

Hello @jobinthompu

I was having the same problem, I succeeded to connect. That auth-proxy should be installed on linux vm at google compute cloud. Choose default VPC while installing. To iinstall proxy on VM, follow instructions at documentation. Choose linux amd64 for linux version of client (as most linuxes are amd64 nowadays). Connect with access-token. If you have troubles, reach me at gdarcan@gmail.com

wget https://storage.googleapis.com/alloydb-auth-proxy/v0.1.0/alloydb-auth-proxy.linux.amd64 -O alloydb-auth-proxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p0 Highest priority. Critical issue. P0 implies highest priority. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
3 participants