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

Segmentation fault on Alpine Linux (Musl) #14

Closed
Bacto opened this issue Dec 13, 2018 · 7 comments
Closed

Segmentation fault on Alpine Linux (Musl) #14

Bacto opened this issue Dec 13, 2018 · 7 comments

Comments

@Bacto
Copy link

Bacto commented Dec 13, 2018

Hi,

Unfortunately the plugin doesn't work on Alpine Linux: Mosquitto crashes because of a segfault.
From GDB, I've got this trace: #0 0x00007f3a34102660 in runtime.sysargs () from /usr/local/lib/go-auth.so

It seems that there is a bug with GO c-shared builds and Musl.

More informations can be found on this issue:
golang/go#13492

Unfortunately, I have no idea if the problem can be solved directly on mosquitto-go-auth code or if GO has to be patched.

@iegomez
Copy link
Owner

iegomez commented Dec 13, 2018

Hi, that's really unfortunate. Sadly, I don't run Alpine Linux nor musl as libc. I could test this in some kind of sandbox (so I don't mess up my work machine) when I get the time, but it'd probably be better and faster if you could test it with newest Go version instead of the 1.10.3 mentioned in the readme to see if it works.

If it doesn't, then I'm sorry, there's probably nothing I can do from the plugin's side as it depends on cgo and Go would need to have this fixed in a future release.

@Bacto
Copy link
Author

Bacto commented Dec 13, 2018

I've tried with Go version 1.11.2 and unfortunately it doesn't work neither, so we are in a dead way for now, waiting for Go to resolve this issue :-/

@iegomez
Copy link
Owner

iegomez commented Dec 13, 2018

Sorry to hear that. If you could get meaningful traces with gdb and delve, it could help to reply to that issue to see if it gets some traction. For what is worth, 1.11.13 is getting released tomorrow. I don't think there'll be any change regarding this issue, but it can't hurt to try it.

All I can recommend for now is to go with https://github.com/jpmens/mosquitto-auth-plug instead, or if you wanna have some fun maybe fork this and replace the cgo efi with some communication layer (I always wanted to see how fast gRPC could work for this, but of course any rpc, pub/sub, socket, etc. may work).

Good luck!

@Bacto
Copy link
Author

Bacto commented Dec 13, 2018

I don't develop in Go so I can't start a such big project ;)
I finished by compiling mosquitto-go-auth with libc.

@Bacto Bacto closed this as completed Dec 13, 2018
@iegomez
Copy link
Owner

iegomez commented Dec 13, 2018

Was that enough to make it work?

@iegomez iegomez reopened this Dec 13, 2018
@Bacto
Copy link
Author

Bacto commented Dec 14, 2018

Yes but not on Alpine Linux as we have to use Musl on it.
I've finished by using an Ubuntu (with libc)

@iegomez
Copy link
Owner

iegomez commented Dec 14, 2018

I've never used Alpine Linux so I didn't know if you could swap for another libc.
Thanks for the report and your help testing things.

I'll close it now.

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