[Python-Dev] Newly Built Python3 Binary Throws Segfault

Cyd Haselton chaselton at gmail.com
Wed Jan 28 23:42:33 CET 2015


That is interesting.../dev/__properties__ is in memory...not the
filesystem, apparently proccesses read global properties from it. It's
read-only...not sure why the build or the python binary would access
it...or if that's the cause of the segfault.

I have root access on the tablet so I was able to check for the
traces.txt file. There are a number of them, but none contain
information about the segfault.

On Wed, Jan 28, 2015 at 11:23 AM, Ryan Gonzalez <rymg19 at gmail.com> wrote:
> On Wed, Jan 28, 2015 at 10:43 AM, Guido van Rossum <guido at python.org> wrote:
>>
>> What I see in the strace:
>>
>> ... load libpython3.4m.so.1.0
>> ... load libm
>> ... open /dev/__properties__ and do something to it (what?)
>> ... get current time
>> ... allocate memory
>> ... getuid
>> ... segfault
>>
>> That's not a lot to go on, but it doesn't look as if it has started to
>> load modules yet.
>>
>> Does /dev/__properties__ ring a bell? Not to me.
>>
>
> https://android.googlesource.com/platform/system/core/+/tools_r22/init/property_service.c
> is the code that works with that file.
>
> This explains it a bit (slides 24-29). Looks like something to do with
> interprocess communication. Likely has nothing to do with Python itself.
>
> Maybe this would be useful?
>
>>
>> That stack trace would be really helpful.
>>
>> On Wed, Jan 28, 2015 at 8:34 AM, Cyd Haselton <chaselton at gmail.com> wrote:
>>>
>>> Apologies...I'm not sure what a stack track is, but I do have the
>>> strace.  Nearest I can tell, it happens due to an open call, though I
>>> am probably wrong.
>>> Attaching the strace output to this email.  I'm going to head back to
>>> the documentation and to back out of some Android-related changes in
>>> _localemodule.c
>>>
>>> On Wed, Jan 28, 2015 at 9:43 AM, Guido van Rossum <guido at python.org>
>>> wrote:
>>> > There could be a million differences relevant (unicode, ints, ...).
>>> > Perhaps
>>> > the importlib bootstrap is failing. Perhaps the dynamic loading code
>>> > changed. Did you get a stack track? (IIRC strace shows a syscall trace
>>> > --
>>> > also useful, but doesn't tell you precisely how it segfaulted.)
>>> >
>>> > On Wed, Jan 28, 2015 at 6:43 AM, Cyd Haselton <chaselton at gmail.com>
>>> > wrote:
>>> >>
>>> >> All,
>>> >> I recently ditched my attempts to port Python 2.7.8 to Android in
>>> >> favor of Python 3.4.2.  Unfortunately, after using the same configure
>>> >> options in the same environment, and modifying the setup.py as needed,
>>> >> the newly built binary throws a segfault when the generate-posix-vars
>>> >> portion of the build is reached...and when it is run as well (i.e.
>>> >> ./python --help, ./python -E -S -m sysconfig, or similar)
>>> >>
>>> >> I took a strace of ./python, however I'm a bit lost when reviewing it.
>>> >> Any ideas as to what may be going on...i.e. why Python 2.7 works but
>>> >> 3.x throws a segfault?
>>> >>
>>> >> Thanks in advance,
>>> >> Cyd
>>> >> _______________________________________________
>>> >> Python-Dev mailing list
>>> >> Python-Dev at python.org
>>> >> https://mail.python.org/mailman/listinfo/python-dev
>>> >> Unsubscribe:
>>> >> https://mail.python.org/mailman/options/python-dev/guido%40python.org
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > --Guido van Rossum (python.org/~guido)
>>
>>
>>
>>
>> --
>> --Guido van Rossum (python.org/~guido)
>>
>> _______________________________________________
>> Python-Dev mailing list
>> Python-Dev at python.org
>> https://mail.python.org/mailman/listinfo/python-dev
>> Unsubscribe:
>> https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com
>>
>
>
>
> --
> Ryan
> If anybody ever asks me why I prefer C++ to C, my answer will be simple:
> "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was
> nul-terminated."
> Personal reality distortion fields are immune to contradictory evidence. -
> srean
> Check out my website: http://kirbyfan64.github.io/


More information about the Python-Dev mailing list