segmentation fault on android device, cmake, hello_world example

70 views
Skip to first unread message

Александр Терешин

unread,
Sep 13, 2016, 4:26:17 AM9/13/16
to crystax-ndk
Good day! 

Sorry for disturbing. I am trying to build a simple hello_world example for android with cmake toolchain you porvided 
(this example: https://github.com/crystax/android-samples-cmake) and when I copy everything on my phone Sony Xperia Z3 and run on it with the help of the script, I got segmentation fault. I use the latest build of your ndk (from 1 september). 
It will be great if you help to solve the problem.

Sincerely,
Tereshin Alexander

text of the bash script:

export ANDROID_NDK=/home/anima/Documents/crystax-ndk-10.3.2/
 
cmake -DCMAKE_TOOLCHAIN_FILE=/home/anima/Documents/crystax-ndk-10.3.2/cmake/ toolchain.cmake\
      -DCMAKE_BUILD_TYPE=Release \
      -DANDROID_TOOLCHAIN_VERSION=gcc-6 \
      -DANDROID_ABI="armeabi-v7a with NEON" \
      -DANDROID_NATIVE_API_LEVEL=android-23 \
      -DANDROID_STL=gnustl_shared

make
make run

cd /home/anima/Documents/test_sample
sudo adb push hello-world libcrystax.so libgnustl_shared.so /data/local/tmp
sudo adb shell 'cd /data/local/tmp && LD_LIBRARY_PATH=/data/local/tmp ./hello-world'

Dmitry Moskalchuk

unread,
Sep 13, 2016, 5:34:11 AM9/13/16
to cryst...@googlegroups.com
Hello Alexander,

Yes, I confirm there is bug in latest builds. This is caused by calling `getauxval()` from libcrystax before libcrystax is getting initialized. This is definitely bug, but its root cause is not yet clear. I've filed ticket: https://tracker.crystax.net/issues/1505. Will try to fix it ASAP. In the meantime, please use older builds - as far as I see, this bug was introduced about one month ago.

-- 
Dmitry Moskalchuk
--
You received this message because you are subscribed to the Google Groups "crystax-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crystax-ndk...@googlegroups.com.
To post to this group, send email to cryst...@googlegroups.com.
Visit this group at https://groups.google.com/group/crystax-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/crystax-ndk/cb2f3e79-89de-4907-88a7-7d9a84327588%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Александр Терешин

unread,
Sep 14, 2016, 3:52:28 AM9/14/16
to crystax-ndk
Hello, Dmitry!
Than you for your reply! I hope it will help and I`ll try older builds of the ndk. You help me to save a lot of time :-) 

Alexander Tereshin
Reply all
Reply to author
Forward
0 new messages