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

Library does not work on ARM6 #10

Open
breiting opened this issue Jan 24, 2019 · 4 comments
Open

Library does not work on ARM6 #10

breiting opened this issue Jan 24, 2019 · 4 comments

Comments

@breiting
Copy link

breiting commented Jan 24, 2019

I just tested the library on a Raspberry Pi (ARM6), however, it crashes with the following message:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x120b8]

goroutine 6 [running]:
runtime/internal/atomic.goXadd64(0x1462b4c, 0x1, 0x0, 0x1414300, 0xdd3e8)
	/opt/go/src/runtime/internal/atomic/atomic_arm.go:96 +0x1c
github.com/sacOO7/socketcluster-client-go/scclient/utils.(*AtomicCounter).IncrementAndGet(0x1462b4c, 0x6b980, 0x1464120)
	/home/pi/go/pkg/mod/github.com/sac!o!o7/[email protected]/scclient/utils/counter.go:12 +0x30
github.com/sacOO7/socketcluster-client-go/scclient.(*Client).sendHandshake(0x1462b40)
	/home/pi/go/pkg/mod/github.com/sac!o!o7/[email protected]/scclient/client.go:116 +0x24
github.com/sacOO7/socketcluster-client-go/scclient.(*Client).registerCallbacks.func1(0x14dc000, 0x1448340, 0x14180c0, 0x25, 0x100, 0x0, 0x0, 0x0, 0x0, 0x1446b60, ...)
	/home/pi/go/pkg/mod/github.com/sac!o!o7/[email protected]/scclient/client.go:44 +0x24
github.com/sacOO7/gowebsocket.(*Socket).Connect(0x1462b54)
	/home/pi/go/pkg/mod/github.com/sac!o!o7/[email protected]/gowebsocket.go:96 +0x390
github.com/sacOO7/socketcluster-client-go/scclient.(*Client).Connect(0x1462b40)
	/home/pi/go/pkg/mod/github.com/sac!o!o7/[email protected]/scclient/client.go:112 +0xcc

After digging in, I found a reasonable explanation for that problem, memory alignment.

I patched the code, which now works on ARM6, see my PR:

#11

Would be great to get that fix in, and v1.0.1 is released.

@breiting
Copy link
Author

Any comments on my fix @sacOO7 ?

@G2G2G2G
Copy link

G2G2G2G commented Sep 8, 2020

Did you compile it for ARM6? Because raspberry pi is ARM7
I guess they're supposed to all be backwards compatible though so it might not matter

@breiting
Copy link
Author

breiting commented Sep 8, 2020

I think this was a pretty old Pi, which is/was ARM6.

@G2G2G2G
Copy link

G2G2G2G commented Sep 8, 2020

Only the original Pi is ARM6 (single core cpu) (just fyi) idk how much difference it makes, I see floating points are quite a bit different on them but entire OSes from ARMv6 seem to run on even armv8 cpus. So the backwards compatibility is good.
But just so you know..
and the new raspberry pi 2,3,4 are Armv8, I was wrong, they aren't even armv7
but the OSes are all arm7 currently.

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

2 participants