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

Avoid random segfaults #10

Closed
yajo opened this issue Jan 30, 2017 · 17 comments
Closed

Avoid random segfaults #10

yajo opened this issue Jan 30, 2017 · 17 comments
Assignees

Comments

@yajo
Copy link
Contributor

yajo commented Jan 30, 2017

Seems like some of Odoo dependencies needs glibc, possibly Pillow: python-pillow/Pillow#1935.

To reproduce, just run the scaffolding for v10, install account_accountant addon, and go to Account menu. Odoo simply dies with exit code 139. No exceptions, no traceback, just dies.

According to above issue, it seems like possibly Pillow or some of its dependencies (or Odoo's) needs something that it only can get from glibc, and is thus incompatible with musl.

We could try to use a glibc-enabled Alpine, but that does not seem too much stable and secure for production. I think for this case we will sadly need to use another distro. Let's try with debian.

@yajo yajo self-assigned this Jan 30, 2017
@pedrobaeza
Copy link
Member

I understand the only drawback is the size of the image, isn't it?

@pedrobaeza
Copy link
Member

Isn't pillow recompilable from source against musl libc?

@yajo
Copy link
Contributor Author

yajo commented Jan 30, 2017

Indeed, image will grow by ~600MB.

Pillow is now installed by compiling against musl, and nothing seems to be wrong at compile time seems to be a heisenbug (I reproduce it unless I debug step by step 😆), thus hard to close upstream.

I still can try to change the LDFLAGS before completely dropping Alpine.

@pedrobaeza
Copy link
Member

OK, storage is cheaper than your time mostly, so let's try a bit more, and if not, we can switch.

yajo added a commit that referenced this issue Jan 30, 2017
See if #10 gets fixed.
@lasley
Copy link
Contributor

lasley commented Jan 30, 2017

Damn yeah this is confirmed on our image too, which we have yet to convert over to this one.

Curious, did you try the glibc version of Alpine just to see if this is in fact the issue? I know you asked in the other issue, but I figure I'd duplicate here just in case you got impatient 😉

@lasley
Copy link
Contributor

lasley commented Jan 30, 2017

My impatience got the best of me, this does work on the glibc Alpine. That sucks..

@pedrobaeza
Copy link
Member

But that base is not very stable as @yajo commented, isn't it? Our investigation line has been to get all correctly compiled against murl, but @yajo is only in the morning, so this goes slower.

@lasley
Copy link
Contributor

lasley commented Jan 30, 2017

Definitely not a good idea for production, but also cuts out a variable that existed otherwise. We now know that this is definitely an issue with compilation, as @yajo abstracted. Really this is more of a hypothesis confirmation than anything - At least we know we're barking up the wrong tree and all that.

@yajo
Copy link
Contributor Author

yajo commented Jan 31, 2017

Yeah, I'd love to get this alpine-based, but my compilations knowledge goes not too far from following the steps found in project's install instructions. I'm afraid I'm not capable right now to fix that in Pillow, and using this derivated version with mixed glibc & musl feels a little bit unstable for production.

It's absurd that you can have linux kernel, postgres, haproxy, and almost all Odoo working fine with musl, and this Pillow library not. But that's the case and after all, the purpose here is "follow readme, turn on, all works". If Alpine right now does not allow that, then the fastest solution on our side is to switch to Debian. I'm going to tag the last Alpine commit in history, so that if you get to fix it in Pillow, we can go back to that point.

At least I'm going to use the debian:8 image instead of the python:2 one. The python one is too full of build garbage that we don't need. My hope is that this will get only ~100 extra MB.

@yajo
Copy link
Contributor Author

yajo commented Jan 31, 2017

It's alive! 🎉

Finally fixed in 1b4fe55, now we have it working under Debian, and just with ~70 extra MB.

@yajo yajo closed this as completed Jan 31, 2017
@yajo
Copy link
Contributor Author

yajo commented Jan 31, 2017

BTW, there's the alpine tag as a record to roll back to it if @lasley makes Pillow work in musl 😊

@lasley
Copy link
Contributor

lasley commented Jan 31, 2017

I'm pretty determined to get it working, so I think we'll crack this nut eventually. My random compile option dartboard experiment yesterday obviously failed, so now I'm working on generating an isolated test case that doesn't need Odoo. It's definitely in side time though, so progress might be slow.

@yajo
Copy link
Contributor Author

yajo commented Feb 2, 2017

Great news 😊

The cool thing is that the only "breaking" part by moving from Alpine to Debian was to change #!/bin/sh for #!/bin/bash in subimage scripts, if any. So when you fix and we go back to Alpine, we will just have to change that back again and all should work.

@lasley
Copy link
Contributor

lasley commented Feb 2, 2017

Hooray!

Curious - why did Debian not work when using sh? This is my go-to shell when building scripts because I was under the impression it was the one I could guarantee would be in all things *Nix 😖

@yajo
Copy link
Contributor Author

yajo commented Feb 3, 2017

Not sure, seems like it was raising syntax errors with [ in ifs.

BTW, after python-pillow/Pillow#1935 (comment), do you have any clues of the real problem? Did you open anything against lxml?

@lasley
Copy link
Contributor

lasley commented Feb 3, 2017

Still working on that. I don't want to open the issue without a test case for fear of bugging someone so l33t again. My debugging skills just had circles run around them, I don't want that to happen twice - particularly in the wrong repo again!

@wiredfool
Copy link

Looks like it might just be a stack size issue: python-pillow/Pillow#1935 (comment)

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

4 participants