You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build logs are in the following file. p4a_errors.txt
Initally I thought that this was a buildozer issue, as I attempted it that way first. So, I opened an issue on their github page and multiple users pointed out that they too were experiencing this issue. I've tried with both python3 and python2, the out come is the same. There is absolutely no unicode in any of my source files, I've also attempted the build with pygame instead of sdl2 (for python 2). There are also multiple simillar SO threads open about this.
Does anyone have any sugesstions or ideas as to why this is happening and how to go about fixing it?
It's also worth noting that if I use the kivy buildozer vm, I can use buildozer to carry out a successful build. Just not on any other machine using either buildozer or p4a, using the same source and build commands.
It's a bit annoying because it's a segfault 😞
Can you edit your issue and link to the buildozer ticket you created?
I don't have the solution, but I can suggest few things to take a look at.
Try p4a master branch p4a.branch = master in your buildozer.spec
Also I think it could be great to give a try in an isolated Docker environment. Rather it crashes or not would give some hint. You need to clone the p4a repository build the Docker image and play with it.
You can take a look at .travis.yml to see how we play with it.
So I think Docker could help, because it may not crash on that image. but then you can try to modify it a bit and makes it look like your own setup, e.g. Arch Linux... But also maybe it already crashes straight away with the Dockerfile provided. All of that could help to "corner" where the issue comes from and eventually fix it.
do you have a core.dump file? if so, you can open it with gdb, maybe it would provide some hinsight about what was happening while it crashed, though, without debug symbols, it's a bit like hitting in the dark.
@AndreMiras I'll absolutely give that a try ( Not at home at the moment)! @tshirtman I've looked for a dump file but haven't been able to locate one, when I get home I'll re-run and search more as I cleared everything out.
Well, someone fixed it by using:
BASECFLAGS=-m32 LDFLAGS=-m32 CFLAGS=-m32 ./configure --prefix=/opt/python32
Don't know how to test this with buildozer though.
The build cpython with BASECFLAGS=-m32 LDFLAGS=-m32 CFLAGS=-m32 ./configure --prefix=/opt/python32 is not a fix.
I have just used alot of time building python2 / python3 and no luck same error. (make: *** [Makefile:426: sharedmods] Error 139)
Hostpython build is straightforward, and a simple ./configure && make should works. It appears no:
On my system, no ccache, PATH reduced to /usr/local/sbin:/usr/bin:/usr/lib/jvm/default/bin:
$ wget https://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
$ tar xf Python-2.7.2.tar.bz2
$ cd Python-2.7.2
$ ./configure
$ make
=> ends up with a segfault:
/home/tito/code/connectage/app/.buildozer/android/platform/build/build/other_builds/p/Python-2.7.2/./Modules/posixmodule.c:7317: warning: the use of `tempnam' is dangerous, better use `mkstemp'
/bin/sh: line 1: 18943 Segmentation fault (core dumped) CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py build
So it's system wide, not related to cross compilation (as we are not yet there), and the env (as far as i understand.)
Long story short, issue was a longstanding in Python < 2.7.15, and recently triggered with recent compiler. They fixed it in 3.x, and backported into 2.7.15. So instead of just gathering the patch back, maybe it's best to update our 2.x version to 2.7.15 with the cross compilation patches. I'm a little bit afraid of the implication (ssl certificates issues on 2.7.x at some point).
Reacted by Andre Miras, Akshay Arora, Oscar van Leusen and Jorilx
Thanks for the research @tito I like the idea of upgrading. But I also like the idea of not investing too much time of it. I think we should drop Python 2 support soon anyway and focus more on Python 3. https://pythonclock.org
The problem is currently I think we have better support for Python 2 than for Python 3. That leads people to use that implementation by default rather than contributing on the Python 3 ecosystem.
I'll fix it anyway, last time i checked python 3, i wasn't able to have sqlite3 + ssl working. And i have few customer old app that i need to maintain, and no budget to switch to Python 3 yet.
So drop it is not a complete solution for now.
I understand, and in my point of view, Crystax SDK is not maintained, our best shot is native compilation of Python 3 same as what we do in Python 2. I already spent time without tangible success yet. And now i need to deliver, no free time to dig and continue for now :/
Activity
AndreMiras commentedon Jun 11, 2018
It's a bit annoying because it's a segfault 😞
Can you edit your issue and link to the buildozer ticket you created?
I don't have the solution, but I can suggest few things to take a look at.
p4a.branch = masterin yourbuildozer.specYou can take a look at .travis.yml to see how we play with it.
So I think Docker could help, because it may not crash on that image. but then you can try to modify it a bit and makes it look like your own setup, e.g. Arch Linux... But also maybe it already crashes straight away with the Dockerfile provided. All of that could help to "corner" where the issue comes from and eventually fix it.
Good luck 🤞
tshirtman commentedon Jun 11, 2018
do you have a
core.dumpfile? if so, you can open it with gdb, maybe it would provide some hinsight about what was happening while it crashed, though, without debug symbols, it's a bit like hitting in the dark.inclement commentedon Jun 11, 2018
I have the same issue, on Arch, but haven't had time to really look at it yet.
suroh commentedon Jun 11, 2018
@AndreMiras I'll absolutely give that a try ( Not at home at the moment)! @tshirtman I've looked for a dump file but haven't been able to locate one, when I get home I'll re-run and search more as I cleared everything out.
AndreMiras commentedon Jun 12, 2018
Good point for the core dump. On Gentoo it's disable by default, but running
ulimit -c unlimitedenables it.Huyston commentedon Jul 24, 2018
I have the same issue. I'm also on Arch. Maybe it has to do with some 32bit libs.
Huyston commentedon Jul 24, 2018
Well, someone fixed it by using:
BASECFLAGS=-m32 LDFLAGS=-m32 CFLAGS=-m32 ./configure --prefix=/opt/python32
Don't know how to test this with buildozer though.
HeliosDK commentedon Jul 25, 2018
The build cpython with BASECFLAGS=-m32 LDFLAGS=-m32 CFLAGS=-m32 ./configure --prefix=/opt/python32 is not a fix.
I have just used alot of time building python2 / python3 and no luck same error. (make: *** [Makefile:426: sharedmods] Error 139)
/bin/sh: linje 1: 9857 Segmentfejl (smed kerne) CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build
This was with python-for-android and buildozer build from master.
jwbowen commentedon Aug 13, 2018
I'm also running into the issue on Fedora 28, even with -m32 in CFLAGS.
tito commentedon Sep 4, 2018
Got it too :[
Hostpython build is straightforward, and a simple ./configure && make should works. It appears no:
On my system, no ccache, PATH reduced to
/usr/local/sbin:/usr/bin:/usr/lib/jvm/default/bin:=> ends up with a segfault:
So it's system wide, not related to cross compilation (as we are not yet there), and the env (as far as i understand.)
tito commentedon Sep 4, 2018
Works with Python 2.7.15.
Related issues:
Long story short, issue was a longstanding in Python < 2.7.15, and recently triggered with recent compiler. They fixed it in 3.x, and backported into 2.7.15. So instead of just gathering the patch back, maybe it's best to update our 2.x version to 2.7.15 with the cross compilation patches. I'm a little bit afraid of the implication (ssl certificates issues on 2.7.x at some point).
AndreMiras commentedon Sep 4, 2018
Thanks for the research @tito I like the idea of upgrading. But I also like the idea of not investing too much time of it. I think we should drop Python 2 support soon anyway and focus more on Python 3.
https://pythonclock.org
The problem is currently I think we have better support for Python 2 than for Python 3. That leads people to use that implementation by default rather than contributing on the Python 3 ecosystem.
tito commentedon Sep 4, 2018
I'll fix it anyway, last time i checked python 3, i wasn't able to have sqlite3 + ssl working. And i have few customer old app that i need to maintain, and no budget to switch to Python 3 yet.
So drop it is not a complete solution for now.
tito commentedon Sep 4, 2018
I understand, and in my point of view, Crystax SDK is not maintained, our best shot is native compilation of Python 3 same as what we do in Python 2. I already spent time without tangible success yet. And now i need to deliver, no free time to dig and continue for now :/
fix segfault on hostpython when compiling for x86_64. CF python/cpython@
AndreMiras commentedon Sep 4, 2018
Guys #1351 was merged to master, please give it a try @jwbowen @Jonast @suroh
suroh commentedon Oct 2, 2018
Thanks all for the research and the help.
CyberDrudge commentedon Oct 29, 2018
I got the same error using python3. Any fixes?
F29 requires upgrade to 2.7.16, because 2.7.14 won't compile with rec…