Issue tracker: Issues
https://tracker.crystax.net/
https://tracker.crystax.net/favicon.ico?1535920027
2016-05-21T16:23:42Z
Issue tracker
Redmine
CrystaX NDK - Bug #1399 (Closed): gmtime() return NULL pointer in field tm_zone
https://tracker.crystax.net/issues/1399
2016-05-21T16:23:42Z
Vitaly M.
vitaly.murashev@gmail.com
<p>test program:</p>
<pre><code class="c syntaxhl" data-language="c"><span class="cp">#include</span> <span class="cpf"><errno.h></span><span class="cp">
#include</span> <span class="cpf"><time.h></span><span class="cp">
#include</span> <span class="cpf"><stdio.h></span><span class="cp">
</span>
<span class="k">static</span> <span class="k">const</span> <span class="kt">char</span> <span class="n">NULL_PTR_VALUE</span><span class="p">[]</span> <span class="o">=</span> <span class="s">"<NULL>"</span><span class="p">;</span>
<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span><span class="o">*</span> <span class="n">argv</span><span class="p">[])</span>
<span class="p">{</span>
<span class="kt">time_t</span> <span class="n">when</span><span class="p">;</span>
<span class="k">struct</span> <span class="n">tm</span> <span class="o">*</span><span class="n">local</span><span class="p">;</span>
<span class="n">when</span> <span class="o">=</span> <span class="n">time</span><span class="p">(</span><span class="nb">NULL</span><span class="p">);</span>
<span class="n">local</span> <span class="o">=</span> <span class="n">gmtime</span><span class="p">(</span><span class="o">&</span><span class="n">when</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">local</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">printf</span><span class="p">(</span><span class="s">"gmtime() failed, errno=%d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">errno</span><span class="p">);</span>
<span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">tm_zone</span> <span class="o">=</span> <span class="n">local</span><span class="o">-></span><span class="n">tm_zone</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="n">tm_zone</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
<span class="n">tm_zone</span> <span class="o">=</span> <span class="n">NULL_PTR_VALUE</span><span class="p">;</span>
<span class="n">printf</span><span class="p">(</span><span class="s">"date: %d.%d.%d, time: %d:%d:%d, zone: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span>
<span class="n">local</span><span class="o">-></span><span class="n">tm_year</span> <span class="o">+</span> <span class="mi">1900</span><span class="p">,</span> <span class="n">local</span><span class="o">-></span><span class="n">tm_mon</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">local</span><span class="o">-></span><span class="n">tm_mday</span><span class="p">,</span>
<span class="n">local</span><span class="o">-></span><span class="n">tm_hour</span><span class="p">,</span> <span class="n">local</span><span class="o">-></span><span class="n">tm_min</span><span class="p">,</span> <span class="n">local</span><span class="o">-></span><span class="n">tm_sec</span><span class="p">,</span>
<span class="n">tm_zone</span><span class="p">);</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
</code></pre>
<p>output:</p>
<pre><code>[build 824]
shell@remix_x86_64:/data/local/tmp $ ./test_gmtime_old
date: 2016.5.21, time: 16:9:36, zone: GMT
[build 853]
shell@remix_x86_64:/data/local/tmp $ ./test_gmtime
date: 2016.5.21, time: 16:9:55, zone: <NULL>
</code></pre>
<p>impact - we have crash in python interpreter:</p>
<pre><code>shell@remix_x86_64:/data/local/tmp $ ./bin/python
Python 3.5.1 (default, May 21 2016, 15:14:20)
[GCC 5.3 20151204] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.gmtime()
Segmentation fault
Program received signal SIGSEGV, Segmentation fault.
strlen (str=str@entry=0x0)
at /home/cislave/workspace/ndk-build-all/HOST/linux/LABEL/ndk-build/platform/ndk/sources/crystax/gen/freebsd/lib/libc/string/mangled-strlen.c:100
100 in /home/cislave/workspace/ndk-build-all/HOST/linux/LABEL/ndk-build/platform/ndk/sources/crystax/gen/freebsd/lib/libc/string/mangled-strlen.c
(gdb) bt
#0 strlen (str=str@entry=0x0)
at /home/cislave/workspace/ndk-build-all/HOST/linux/LABEL/ndk-build/platform/ndk/sources/crystax/gen/freebsd/lib/libc/string/mangled-strlen.c:100
#1 0x00005555556adbe2 in PyUnicode_DecodeLocale (str=0x0, errors=0x555555a3423d "surrogateescape")
at /home/vet/me/android/0/externals/python35/Objects/unicodeobject.c:3573
#2 0x0000555555797e3b in tmtotuple (p=p@entry=0x7fffffffe230) at /home/vet/me/android/0/externals/python35/Modules/timemodule.c:296
#3 0x0000555555798d25 in time_gmtime (self=<optimized out>, args=<optimized out>) at /home/vet/me/android/0/externals/python35/Modules/timemodule.c:351
#4 0x0000555555666a09 in PyCFunction_Call (func=func@entry=0x7ffff7d18828, args=args@entry=0x7ffff7df4048, kwds=kwds@entry=0x0)
at /home/vet/me/android/0/externals/python35/Objects/methodobject.c:109
#5 0x00005555556d9e08 in call_function (oparg=<optimized out>, pp_stack=0x7fffffffe3b0) at /home/vet/me/android/0/externals/python35/Python/ceval.c:4655
#6 PyEval_EvalFrameEx (f=f@entry=0x7ffff7df3868, throwflag=throwflag@entry=0) at /home/vet/me/android/0/externals/python35/Python/ceval.c:3185
#7 0x00005555556dbd19 in _PyEval_EvalCodeWithName (_co=_co@entry=0x7ffff7d4d420, globals=globals@entry=0x7ffff7d9f5c8,
locals=locals@entry=0x7ffff7d9f5c8, args=args@entry=0x0, argcount=argcount@entry=0, kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0,
defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, name=name@entry=0x0, qualname=qualname@entry=0x0)
at /home/vet/me/android/0/externals/python35/Python/ceval.c:3966
#8 0x00005555556dbe19 in PyEval_EvalCodeEx (_co=_co@entry=0x7ffff7d4d420, globals=globals@entry=0x7ffff7d9f5c8, locals=locals@entry=0x7ffff7d9f5c8,
args=args@entry=0x0, argcount=argcount@entry=0, kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0,
kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0) at /home/vet/me/android/0/externals/python35/Python/ceval.c:3987
#9 0x00005555556dbe5c in PyEval_EvalCode (co=co@entry=0x7ffff7d4d420, globals=globals@entry=0x7ffff7d9f5c8, locals=locals@entry=0x7ffff7d9f5c8)
at /home/vet/me/android/0/externals/python35/Python/ceval.c:777
#10 0x00005555556140a5 in run_mod (mod=mod@entry=0x7ffff6d870e0, filename=filename@entry=0x7ffff7d4c928, globals=0x7ffff7d9f5c8, locals=0x7ffff7d9f5c8,
flags=flags@entry=0x7fffffffe6d0, arena=arena@entry=0x7ffff6c17160) at /home/vet/me/android/0/externals/python35/Python/pythonrun.c:970
#11 0x0000555555615fe7 in PyRun_InteractiveOneObject (fp=fp@entry=0x555556361980 <__sF>, filename=filename@entry=0x7ffff7d4c928,
flags=flags@entry=0x7fffffffe6d0) at /home/vet/me/android/0/externals/python35/Python/pythonrun.c:233
#12 0x00005555556162ce in PyRun_InteractiveLoopFlags (fp=fp@entry=0x555556361980 <__sF>, filename_str=filename_str@entry=0x555555a3426f "<stdin>",
flags=flags@entry=0x7fffffffe6d0) at /home/vet/me/android/0/externals/python35/Python/pythonrun.c:112
#13 0x00005555556169ff in PyRun_AnyFileExFlags (fp=fp@entry=0x555556361980 <__sF>, filename=0x555555a3426f "<stdin>", closeit=0,
flags=flags@entry=0x7fffffffe6d0) at /home/vet/me/android/0/externals/python35/Python/pythonrun.c:74
#14 0x00005555556c0eaa in run_file (p_cf=0x7fffffffe6d0, filename=0x0, fp=0x555556361980 <__sF>)
at /home/vet/me/android/0/externals/python35/Modules/main.c:318
#15 Py_Main (argc=<optimized out>, argv=<optimized out>) at /home/vet/me/android/0/externals/python35/Modules/main.c:768
#16 0x00005555555fea3f in main (argc=1, argv=<optimized out>) at jni/interpreter.c:55
</code></pre>
CrystaX NDK - Task #1354 (Closed): Integrate stock python2.7 and python3.5 in host prebuilts
https://tracker.crystax.net/issues/1354
2016-04-02T10:22:53Z
Vitaly M.
vitaly.murashev@gmail.com
<p>We need to integrate build script ${NDK}/build/tools/build-vendor-host-python.sh into full build process<br>
in order to have stock python2.7 and python3.5 in host prebuilts as</p>
<ul>
<li>${NDK}/prebult/${host}/opt/python2.7/*</li>
<li>${NDK}/prebult/${host}/opt/python3.5/*</li>
</ul>
CrystaX NDK - Bug #1004 (Closed): [termios.h] undefined reference to 'tcdrain'
https://tracker.crystax.net/issues/1004
2015-07-12T11:03:20Z
Vitaly M.
vitaly.murashev@gmail.com
<p>What should be done to link with symbols from termios.h ?</p>
CrystaX NDK - Bug #1003 (Closed): [pwd.h] [struct passwd] member field pw_gecos is missed
https://tracker.crystax.net/issues/1003
2015-07-12T10:56:58Z
Vitaly M.
vitaly.murashev@gmail.com
<p>passwd struct inside crystax-ndk looks like:<br>
struct passwd<br>
{<br>
char* pw_name;<br>
char* pw_passwd;<br>
uid_t pw_uid;<br>
gid_t pw_gid;<br>
char* pw_dir;<br>
char* pw_shell;<br>
};</p>
<p>At the same time for desktop platforms this struct usually looks like the following:<br>
struct passwd<br>
{<br>
char* pw_name;<br>
char* pw_passwd;<br>
__uid_t pw_uid;<br>
__gid_t pw_gid;<br>
char* pw_gecos;<br>
char* pw_dir;<br>
char* pw_shell;<br>
};</p>
<p>So 'pw_gecos' field is missing,<br>
as result it gives some obstacles to port python3 for Android</p>