[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building for Android


Aris,

I found out that using the function channel->readNonBlocking() also
leads to a crash.
This strangely happens regardless of the presence of
ssh_set_log_callback(callback).
Please find a stacktrace attached.

As a workaround I disabled all logging functions in log.c and this seems
to work.
However, this is only a temporary solution.

Regards,
Matteo

On 11/21/2015 07:03 PM, Matteo wrote:
> More good news: it seems that, apart from the problem we are discussing,
> the rest of the library works correctly.
> At least according to the short test below, the results are as expected
> (both on device and emulator) and I get a list of files from the server.
>
> void callback(int priority, const char *function, const char *buffer,
> void *userdata)
> {
>     //this can be empty
> }
>
> void MainWindow::test()
> {
>     ssh::Session session;
>     session.setOption(SSH_OPTIONS_TIMEOUT, 20);
>     session.setOption(SSH_OPTIONS_HOST, "192.168.0.13");
>     session.setOption(SSH_OPTIONS_USER, "root");
>     session.setOption(SSH_OPTIONS_PORT, 2222);
>
>     session.setOption(SSH_OPTIONS_LOG_VERBOSITY, 2);
>     ssh_set_log_level(SSH_LOG_FUNCTIONS);
>     ssh_set_log_callback(callback);
>
>     if (session.connect() != SSH_OK) {
>         message("cannot connect");
>         return;
>     } else {
>         message("connected");
>     }
>
>     QString pass = "Secret123";
>     QByteArray passArray = pass.toUtf8();
>     if (session.userauthPassword(passArray.data()) != SSH_AUTH_SUCCESS) {
>         message("auth failed");
>         return;
>     } else {
>         message("auth succeeded");
>     }
>
>     ssh::Channel* channel = new ssh::Channel(session);
>     if (!channel) {
>         message("cannot obtain channel");
>         return;
>     } else {
>         message("channel obtained");
>     }
>
>     if (channel->openSession() != SSH_OK)
>         message("cannot open channel session");
>     else
>         message("channel opened.");
>
>     QByteArray commandArray = QString("ls").toUtf8();
>     if (channel->requestExec(commandArray.data()) != SSH_OK) {
>         message("command failed");
>     } else {
>         message("command succeeded");
>     }
>
>     message("Reading stdout");
>     QByteArray result;
>     char buffer[256];
>     int nbytes = channel->read(buffer, sizeof(buffer), false, -1);
>     message("read " + QString::number(nbytes) + " bytes");
>     while (nbytes > 0)
>     {
>       result.append(buffer);
>       nbytes = channel->read(buffer, sizeof(buffer), false, -1);
>       message("read " + QString::number(nbytes) + " bytes");
>     }
>     message("Command output (" + QString::number(result.length()) + "):");
>     message(result);
>
>     message("Reading stderr");
>     QByteArray err;
>     nbytes = channel->read(buffer, sizeof(buffer), true, -1);
>     message("read " + QString::number(nbytes) + " bytes");
>     while (nbytes > 0)
>     {
>         err.append(buffer);
>         nbytes = channel->read(buffer, sizeof(buffer), true, -1);
>         message("read " + QString::number(nbytes) + " bytes");
>     }
>     message("Stderr (" + QString::number(err.length()) + "):");
>     message(err);
>
>     channel->close();
>     delete channel;
>     session.disconnect();
> }
>
>
>
> On 11/21/2015 02:32 PM, Matteo wrote:
>> Hi Aris,
>>
>> Yes, I get the very same behavior in the Android emulator (ARMv7, didn't
>> try x86 yet).
>>
>> App crashes if ssh_set_log_callback() is commented out, but works otherwise.
>> This does not change if verbosity is set to -1 (or to 0).
>>
>> Please find the apk under the link below, let me know if you want the
>> source code, too.
>> https://app.box.com/s/q9aivh4etopcbhjbabqs6d53t2qyazwm
>> Matteo
>>
>>
>> On 11/21/2015 10:24 AM, Aris Adamantiadis wrote:
>>> Hi Matteo,
>>>
>>> This is really strange. All _ssh_log is doing is preparing a buffer,
>>> it's not even the function that's writing on stderr. Does it still
>>> happen if you set the verbosity to -1 (absolutely silent) ?
>>>
>>> Can you reproduce the issue in the android emulator? if so, could you
>>> share the APK ?
>>>
>>> Thanks,
>>>
>>> Aris
>>>
>>> On 21/11/15 03:24, Matteo wrote:
>>>> Hi Aris,
>>>>
>>>> Thank you for your interest, and for a great library.
>>>>
>>>> I have good news: it seems to work now.
>>>> And the funny thing is, it seems to have something to do with logging.
>>>>
>>>> Quick recap here, but feel free to ask for more informations:
>>>> The problem is that, unfortunately, my device is not rooted, and thus
>>>> access to logs and stacktraces is limited.
>>>> So, while trying to find an efficient way to log library events, I
>>>> stumbled upon the ssh_set_log_callback() function.
>>>> That seemed perfect in this case, as I can redirect the log messages to
>>>> screen and to a "private" log file that the app has access to.
>>>>
>>>> So I quickly implemented it into the tester program and... to my
>>>> surprise, no crash anymore!
>>>> I could successfully establish a connection, as confirmed also by the
>>>> server logs.
>>>>
>>>> Here the working code:
>>>> void callback(int priority, const char *function, const char *buffer,
>>>> void *userdata)
>>>> {
>>>>     //this function can be empty, does not make any difference
>>>> }
>>>>
>>>> void MainWindow::test()
>>>> {
>>>>     ssh::Session session;
>>>>     session.setOption(SSH_OPTIONS_TIMEOUT, 20);
>>>>     session.setOption(SSH_OPTIONS_HOST, "192.168.0.13");
>>>>     session.setOption(SSH_OPTIONS_USER, "root");
>>>>     session.setOption(SSH_OPTIONS_PORT, 2222);
>>>>
>>>>     //added these lines for logging
>>>>     session.setOption(SSH_OPTIONS_LOG_VERBOSITY, 2);
>>>>     ssh_set_log_level(SSH_LOG_FUNCTIONS);
>>>>     ssh_set_log_callback(callback); //commenting out this line causes
>>>> the crash
>>>>
>>>>     session.connect();
>>>> }
>>>>
>>>> My guess is that libSSH is logging to some facility that, on Android,
>>>> the app does not have access to.
>>>> Please find attached an excerpt from the Android logcat with a stacktrace.
>>>> The log starts with a "touch event" corresponding to pushing the button
>>>> connected to MainWindow::test(), and ends with the app crashing.
>>>> From the stacktrace, one can see that the last called function seems to
>>>> be _ssh_log().
>>>>
>>>> Tomorrow I will try to slowly expand the test to a more complete use case.
>>>>
>>>> Regards
>>>> Matteo
>>>>
>>>> On 11/20/2015 07:34 PM, Aris Adamantiadis wrote:
>>>>> Hi Matteo,
>>>>>
>>>>> You did a great work compiling libssh for android. I have no idea what's
>>>>> causing the crash, it would greatly help if you could provide us with a
>>>>> stacktrace. Running libssh in verbose mode and capturing the output
>>>>> would also help figuring out what works .
>>>>>
>>>>> Aris
>>>>>
>>>>> On 20/11/15 18:46, Matteo wrote:
>>>>>> After several attempts, I could get a successful build.
>>>>>> However, when I test it, it segfaults.
>>>>>>
>>>>>> In the following, I will try to explain what I did.
>>>>>> I will try to be brief but, if there is any interest, I can provide
>>>>>> more detailed instructions (or even a script that automates the whole
>>>>>> process).
>>>>>>
>>>>>> 0) The build environment is as follows:
>>>>>> - Ubuntu 15.04 64 bit with 3.19.0-33 kernel
>>>>>> - cmake 3.0.2 and gcc 4.9.2 (both from repos)
>>>>>> - Android NDK r9d
>>>>>> - OpenSSL 1.0.2d
>>>>>> - libSSH 0.7.2
>>>>>> - Qt 5.4 and QtCreator 3.3.0
>>>>>> - Target platform arm-linux-androideabi-4.8 API 19
>>>>>> - Target device Samsung Galaxy S5 klte
>>>>>>
>>>>>> 1) First, we need to build the dependencies.
>>>>>> zlib is already part of the NDK, so we only need to cross-compile OpenSSL.
>>>>>> This is easily accomplished by following the instructions found here:
>>>>>> https://wiki.openssl.org/index.php/Android
>>>>>> After installation I symlinked libcrypto.so, libssl.so and the include
>>>>>> files inside the NDK "usr" folder (so that they can easily be linked
>>>>>> against).
>>>>>>
>>>>>> 2) Following Daniel Kroker's advice, I added the taka-no-me toolchain
>>>>>> into the libSSH folder.
>>>>>> Before I could complete the build, however, I had to solve following
>>>>>> problems.
>>>>>>
>>>>>> 3) My version of cmake has a bug that was fixed in 3.1 an later versions.
>>>>>> This prevents it to correctly detect OpenSSL 1.0.2 (it is reported to
>>>>>> work with earlier versions, though).
>>>>>> To fix it, I manually applied this patch:
>>>>>> https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c5d9a8283cfac15b4a5a07f18d5eb10c1f388505
>>>>>>
>>>>>> 4) The cmake configuration of libSSH contains a TRY_RUN() step.
>>>>>> As far as I could understand, this is supposed to run a dummy test to
>>>>>> check if a certain feature works correctly.
>>>>>> This is obviously not possible in cross-compilation mode: fortunately,
>>>>>> the error issued by cmake contains an explanation on how to fix it.
>>>>>> In the libSSH folder one needs to create a file (named e.g.
>>>>>> "TryRunResults.cmake") with following content:
>>>>>>         set( THREADS_PTHREAD_ARG 0
>>>>>>              CACHE STRING "Result from TRY_RUN" FORCE)
>>>>>>
>>>>>> 5) The build still fails with error "implicit declaration of function
>>>>>> 'getpwuid_r'"
>>>>>> This function is supposed to return informations about the current
>>>>>> user, like username and home directory.
>>>>>> This has no equivalent on android, so I needed to change these two
>>>>>> functions in the file "misc.c":
>>>>>>    char *ssh_get_user_home_dir(void)
>>>>>>    char *ssh_get_local_username(void)
>>>>>> For my tests, I resigned to return hard-coded values, but more work is
>>>>>> required for a general solution.
>>>>>>
>>>>>> 6) Now the build completes successfully. These are the command issued:
>>>>>> cd /path/to/downloaded/libSSH/
>>>>>> mkdir build
>>>>>> cd build
>>>>>>         cmake \
>>>>>>             -C ../TryRunResults.cmake \
>>>>>>             -DCMAKE_INSTALL_PREFIX=/opt/libssh-android \
>>>>>>             -DWITH_INTERNAL_DOC=OFF \
>>>>>>             -DWITH_STATIC_LIB=ON \
>>>>>>             -DWITH_TESTING=OFF \
>>>>>>             -DWITH_SERVER=OFF \
>>>>>>             -DWITH_EXAMPLES=OFF \
>>>>>>             -DCMAKE_BUILD_TYPE=Release \
>>>>>>             -DCMAKE_TOOLCHAIN_FILE=../android.toolchain.cmake \
>>>>>>             -DANDROID_NDK="$ANDROID_NDK_ROOT" \
>>>>>>             -DANDROID_NATIVE_API_LEVEL=android-19 \
>>>>>>             -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.8 \
>>>>>>             -DANDROID_ABI="armeabi-v7a with NEON" \
>>>>>>         ..
>>>>>>         cmake --build .
>>>>>>
>>>>>> 7) Before deployment, there are two more obstacles.
>>>>>> First, the Android NDK doesnt provide OpenSSL, but the library is
>>>>>> installed in Android and loaded by default (taking precedence over
>>>>>> libraries packaged in the APK).
>>>>>> This means that we have to rename the libcrypto.so and libssl.so to
>>>>>> something else, and repeat the linking step. However, see below.
>>>>>> (this problem is documented here:
>>>>>> https://mta.openssl.org/pipermail/openssl-users/2015-April/001183.html)
>>>>>> Second, Android does not support loading of versioned libraries
>>>>>> (meaning that e.g. libssh.so is a symlink to libssh.so.4.4.0).
>>>>>> This means that we have to configure OpenSSL and libSSH to produce
>>>>>> non-versioned files, and relink. However, see below.
>>>>>> (this problem is documented here:
>>>>>> https://bugreports.qt.io/browse/QTCREATORBUG-11062)
>>>>>> The link above also provided a solution (hack?) for both problems,
>>>>>> which I implemented with following BASH code:
>>>>>>     local subs=()
>>>>>>     subs+=(-e
>>>>>> 's/libcrypto.so.1.0.0/libcryptm.so\x00\x00\x00\x00\x00\x00/g')
>>>>>>     subs+=(-e 's/libcrypto.so/libcryptm.so/g')
>>>>>>     subs+=(-e 's/libssl.so.1.0.0/libssm.so\x00\x00\x00\x00\x00\x00/g')
>>>>>>     subs+=(-e 's/libssl.so/libssm.so/g')
>>>>>>     subs+=(-e 's/libssh.so.4.4.0/libssh.so\x00\x00\x00\x00\x00\x00/g')
>>>>>>     subs+=(-e 's/libssh.so.4/libssh.so\x00\x00/g')
>>>>>>     sed "${subs[@]}" "/opt/openssl/android-19/lib/libcrypto.so" >
>>>>>> "/home/matteo/deploy/libcryptm.so"
>>>>>>     sed "${subs[@]}" "/opt/openssl/android-19/lib/libssl.so" >
>>>>>> "/home/matteo/deploy/libssm.so"
>>>>>>     sed "${subs[@]}" "/opt/libssh-android/lib/libssh.so" >
>>>>>> "/home/matteo/deploy/libssh.so"
>>>>>>     chmod a+x /home/matteo/deploy/*
>>>>>>
>>>>>> 8) I prepared a very simple test project in Qt.
>>>>>> Starting from the widget-based template for android, I added a
>>>>>> function that, when clicking on a QPushButton, attempts to connect to
>>>>>> a ssh server in my LAN.
>>>>>> void MainWindow::test()
>>>>>> {
>>>>>>     ssh::Session session;
>>>>>>     session.setOption(SSH_OPTIONS_TIMEOUT, 20);
>>>>>>     session.setOption(SSH_OPTIONS_HOST, "192.168.0.13");
>>>>>>     session.setOption(SSH_OPTIONS_USER, "root");
>>>>>>     session.setOption(SSH_OPTIONS_PORT, 2222);
>>>>>>
>>>>>>     session.connect();
>>>>>> }
>>>>>>
>>>>>> This works if "session.connect();" is commented out, but the program
>>>>>> crashes otherwise, with error:
>>>>>> F/libc    (22871): Fatal signal 11 (SIGSEGV), code 1, fault addr
>>>>>> 0x10100 in tid 23039 (QtThread)
>>>>>> Note that the very same code works in "desktop mode".
>>>>>>
>>>>>> Right now I am out of ideas on how to debug this, so if someone can
>>>>>> give an hint, I would much appreciate it.
>>>>>> As I said above, I can provide more details and code upon request.
>>>>>>
>>>>>> Thanks in advance
>>>>>> Matteo
>>>>>>
>>>>>> On 11/19/2015 09:28 AM, Daniel Kroker wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> its not so easy to build libssh for android. you need the android
>>>>>>> toolchain look at
>>>>>>> https://github.com/taka-no-me/android-cmake/blob/master/android.toolchain.cmake
>>>>>>>
>>>>>>> Am 19.11.2015 um 02:35 schrieb Matteo:
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> My project depends on libssh and I am trying to port it to Android.
>>>>>>>>
>>>>>>>> After some research in the Internet, it appears that I have to
>>>>>>>> cross-compile libssh by using the Android NDK.
>>>>>>>> However, I could not find any good sources of information about the
>>>>>>>> topic.
>>>>>>>>
>>>>>>>> Could somebody please provide a starting point for me?
>>>>>>>>
>>>>>>>> Thank you in advance.
>>>>>>>> Mat
>>>>>>>>
>>>>>>>>
>

I/InputDispatcher(  784): Delivering touch to (29929): action: 0x1, toolType: 1
D/PanelView( 1175): There is/are notification(s) 
W/ContextImpl(  784): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1629 com.android.server.InputMethodManagerService$6.run:2728 java.lang.Thread.run:818 <bottom of call stack> <bottom of call stack> 
D/PanelView( 1175): There is/are notification(s) 
D/SamsungIME( 1881): onWindowHidden
W/ContextImpl( 1881): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1629 android.content.ContextWrapper.sendBroadcast:391 android.inputmethodservice.InputMethodService.sendInputViewShownState:417 android.inputmethodservice.InputMethodService.hideWindow:2093 android.inputmethodservice.InputMethodService.doHideWindow:2071 
D/SSRM:a  (  784): DeviceInfo:: 000000000000
D/SSRM:a  (  784): SettingsAirViewInfo:: 000000000
D/Qt      (29929): (null):0 ((null)): Found Metastream: KPX_CUSTOM_ICONS_4
D/Qt      (29929): (null):0 ((null)): Found Metastream: KPX_GROUP_TREE_STATE
W/Qt      (29929): (null):0 ((null)): QObject::connect: No such signal MainWindow::commandFinished(bool) in ../../gui/android.cpp:30
W/Qt      (29929): (null):0 ((null)): QObject::connect:  (receiver name: 'MainWindow')
D/StatusBar.NetworkController( 1175): refreshViews connected={ wifi } level=4 combinedSignalIconId=0x7f020492/com.android.systemui:drawable/stat_sys_wifi_signal_4 mobileLabel=Emergency calls only wifiLabel="UPC5613602"xxxxXXXXxxxxXXXX emergencyOnly=true combinedLabel="UPC5613602"xxxxXXXXxxxxXXXX mAirplaneMode=false mDataActivity=0 mPhoneSignalIconId=0x7f02042d/com.android.systemui:drawable/stat_sys_signal_4 mQSPhoneSignalIconId=0x7f020115/com.android.systemui:drawable/ic_qs_signal_4 mDataDirectionIconId=0x0/(null) mDataSignalIconId=0x7f02042d/com.android.systemui:drawable/stat_sys_signal_4 mDataTypeIconId=0x0/(null) mQSDataTypeIconId=0x0/(null) mNoSimIconId=0x0/(null) mWifiIconId=0x7f020492/com.android.systemui:drawable/stat_sys_wifi_signal_4 mQSWifiIconId=0x7f02012b/com.android.systemui:drawable/ic_qs_wifi_4 mWifiActivityIconId=0x7f020463/com.android.systemui:drawable/stat_sys_signal_inout mBluetoothTetherIconId=0x1080907/android:drawable/stat_sys_tether_bluetooth
D/StatusBar.NetworkController( 1175): refreshSignalCluster - setNWBoosterIndicators(false)
D/StatusBar.NetworkController( 1175): applyOpen
D/StatusBar.NetworkController( 1175): refreshSignalCluster - setNWBoosterIndicators(false)
D/StatusBar.NetworkController( 1175): applyOpen
D/StatusBar.NetworkController( 1175): refreshSignalCluster - setNWBoosterIndicators(false)
D/StatusBar.NetworkController( 1175): applyOpen
D/StatusBar.NetworkController( 1175): refreshSignalCluster - setNWBoosterIndicators(false)
D/StatusBar.NetworkController( 1175): applyOpen
I/SSHDroid(15505): [30937] Nov 23 13:54:10 Child connection from ::ffff:192.168.0.13:37761
F/libc    (29929): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x10100 in tid 30942 (RemoteReader)
I/SurfaceFlinger(  256): id=319 Removed InputMethod (5/9)
I/SurfaceFlinger(  256): id=319 Removed InputMethod (-2/9)
I/DEBUG   (  279): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  279): Build fingerprint: 'samsung/kltedx/klte:5.0/LRX21T/G900FDXU1BOJ1:user/release-keys'
I/DEBUG   (  279): Revision: '14'
I/DEBUG   (  279): ABI: 'arm'
I/DEBUG   (  279): pid: 29929, tid: 30942, name: RemoteReader  >>> org.qtproject.example.AutoinstallGui <<<
I/DEBUG   (  279): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10100
I/DEBUG   (  279):     r0 00000003  r1 b3967838  r2 9acfe694  r3 00000000
I/DEBUG   (  279):     r4 b6f70e04  r5 00000003  r6 b3967838  r7 00010101
I/DEBUG   (  279):     r8 9acfe694  r9 b3967838  sl 00000015  fp 00000015
I/DEBUG   (  279):     ip b3985cf8  sp 9acfe288  lr b3948413  pc 00010100  cpsr 40070030
I/DEBUG   (  279): 
I/DEBUG   (  279): backtrace:
I/DEBUG   (  279):     #00 pc 00010100  <unknown>
I/DEBUG   (  279):     #01 pc 00014411  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (_ssh_log+132)
I/DEBUG   (  279):     #02 pc 00017e1b  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_packet_socket_callback+802)
I/DEBUG   (  279):     #03 pc 0001de3f  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_socket_pollcallback+582)
I/DEBUG   (  279):     #04 pc 0001b667  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_poll_ctx_dopoll+150)
I/DEBUG   (  279):     #05 pc 0001c333  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_handle_packets+62)
I/DEBUG   (  279):     #06 pc 0000dedf  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_channel_poll+58)
I/DEBUG   (  279):     #07 pc 0000e02b  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_channel_read_nonblocking+22)
I/DEBUG   (  279):     #08 pc 0001dd5c  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libAutoinstallGui.so (ssh::Channel::readNonblocking(void*, unsigned int, bool)+72)
I/DEBUG   (  279):     #09 pc 0001f280  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libAutoinstallGui.so (RemoteProcess::readChannel(bool)+216)
I/DEBUG   (  279):     #10 pc 0001fd94  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libAutoinstallGui.so (RemoteReader::run()+40)
I/DEBUG   (  279):     #11 pc 00077621  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libQt5Core.so
I/DEBUG   (  279):     #12 pc 000137bb  /system/lib/libc.so (__pthread_start(void*)+30)
I/DEBUG   (  279):     #13 pc 0001189b  /system/lib/libc.so (__start_thread+6)
I/DEBUG   (  279): 
I/DEBUG   (  279): Tombstone written to: /data/tombstones/tombstone_02
E/        (  279): ro.product_ship = true
E/        (  279): ro.debug_level = 0x4f4c
E/audit   ( 2171): type=1701 msg=audit(1448283251.012:4319): auid=4294967295 uid=10075 gid=10075 ses=4294967295 subj=u:r:untrusted_app:s0 pid=30942 comm="RemoteReader" reason="memory violation" sig=11
W/ActivityManager(  784):   Force finishing activity org.qtproject.example.AutoinstallGui/org.qtproject.qt5.android.bindings.QtActivity
I/BootReceiver(  784): Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)
E/android.os.Debug(  784): ro.product_ship = true
E/android.os.Debug(  784): ro.debug_level = 0x4f4c
W/InputDispatcher(  784): channel ~ Consumer closed input channel or an error occurred.  events=0x9
E/InputDispatcher(  784): channel ~ Channel is unrecoverably broken and will be disposed!
W/InputDispatcher(  784): Attempted to unregister already unregistered input channel
I/WindowState(  784): WIN DEATH: Window{9fc62fa u0 org.qtproject.example.AutoinstallGui/org.qtproject.qt5.android.bindings.QtActivity}
I/Zygote  (  314): Process 29929 exited due to signal (11)
I/WindowState(  784): WIN DEATH: Window{6fcd072 u0 SurfaceView}
D/StatusBarManagerService(  784): manageDisableList userId=0 what=0x0 pkg=WindowManager.LayoutParams
I/ActivityManager(  784): Process org.qtproject.example.AutoinstallGui (pid 29929)(adj 0) has died(80,348)
I/SurfaceFlinger(  256): id=320 createSurf (49x49),1 flag=4, Application Error: org.qtproject.example.AutoinstallGui
I/OpenGLRenderer(  784): Initialized EGL, version 1.4
I/OpenGLRenderer(  784): HWUI protection enabled for context ,  &this =0x9cc0afb0 ,&mEglDisplay = 1 , &mEglConfig = 8 
D/CustomFrequencyManagerService(  784): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT  frequency : 1958400  uid : 1000  pid : 784  pkgName : ACTIVITY_RESUME_BOOSTER@6
W/ActivityManager(  784): mDVFSHelper.acquire()
V/SamsungIME( 1881): onTrimMeomory Level = 20
W/ContextImpl(25757): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1994 android.content.ContextWrapper.startService:533 android.content.ContextWrapper.startService:533 com.samsung.android.sm.common.SmartManagerReceiver.b:199 com.samsung.android.sm.common.SmartManagerReceiver.onReceive:93 
D/ActivityManager(  784): startService callerProcessName:com.samsung.android.sm, calleePkgName: com.samsung.android.sm
D/CrashAnrDetector(  784): Build: samsung/kltedx/klte:5.0/LRX21T/G900FDXU1BOJ1:user/release-keys
D/CrashAnrDetector(  784): Hardware: MSM8974
D/CrashAnrDetector(  784): Revision: 14
D/CrashAnrDetector(  784): Bootloader: G900FDXU1BOJ1
D/CrashAnrDetector(  784): Radio: unknown
D/CrashAnrDetector(  784): Kernel: Linux version 3.4.0-5983040 (dpi@SWDD6822) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Fri Oct 9 15:28:43 KST 2015
D/CrashAnrDetector(  784): 
D/CrashAnrDetector(  784): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
D/CrashAnrDetector(  784): Build fingerprint: 'samsung/kltedx/klte:5.0/LRX21T/G900FDXU1BOJ1:user/release-keys'
D/CrashAnrDetector(  784): Revision: '14'
D/CrashAnrDetector(  784): ABI: 'arm'
D/CrashAnrDetector(  784): pid: 29929, tid: 30942, name: RemoteReader  >>> org.qtproject.example.AutoinstallGui <<<
D/CrashAnrDetector(  784): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10100
D/CrashAnrDetector(  784):     r0 00000003  r1 b3967838  r2 9acfe694  r3 00000000
D/CrashAnrDetector(  784):     r4 b6f70e04  r5 00000003  r6 b3967838  r7 00010101
D/CrashAnrDetector(  784):     r8 9acfe694  r9 b3967838  sl 00000015  fp 00000015
D/CrashAnrDetector(  784):     ip b3985cf8  sp 9acfe288  lr b3948413  pc 00010100  cpsr 40070030
D/CrashAnrDetector(  784):     d0  203a74656b636170  d1  7079742064616572
D/CrashAnrDetector(  784):     d2  656c5b2034392065  d3  6461702c38323d6e
D/CrashAnrDetector(  784):     d4  0000000000000000  d5  0000000000000000
D/CrashAnrDetector(  784):     d6  0000000000000000  d7  000002a000000000
D/CrashAnrDetector(  784):     d8  3fe0000000000000  d9  409b6df0f0800000
D/CrashAnrDetector(  784):     d10 405e4f0f0c000000  d11 404783c3e0000000
D/CrashAnrDetector(  784):     d12 403b8787a0000000  d13 0000000000000000
D/CrashAnrDetector(  784):     d14 0000000000000000  d15 3ff0000000000000
D/CrashAnrDetector(  784):     d16 632c363d676e6964  d17 702c31323d706d6f
D/CrashAnrDetector(  784):     d18 da827999e2bb167c  d19 5a8279995a827999
D/CrashAnrDetector(  784):     d20 5a8279995a827999  d21 5a8279995a827999
D/CrashAnrDetector(  784):     d22 cdc782e07168e1e9  d23 8045b382a4fccec9
D/CrashAnrDetector(  784):     d24 3bec909456f775af  d25 cf710f3e39d0444d
D/CrashAnrDetector(  784):     d26 ba15042626409893  d27 0826fed1b1a3d30a
D/CrashAnrDetector(  784):     d28 5a8279995a827999  d29 5a8279995a827999
D/CrashAnrDetector(  784):     d30 0000000000000000  d31 0000000000000000
D/CrashAnrDetector(  784):     scr 20000011
D/CrashAnrDetector(  784): 
D/CrashAnrDetector(  784): backtrace:
D/CrashAnrDetector(  784):     #00 pc 00010100  <unknown>
D/CrashAnrDetector(  784):     #01 pc 00014411  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (_ssh_log+132)
D/CrashAnrDetector(  784):     #02 pc 00017e1b  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_packet_socket_callback+802)
D/CrashAnrDetector(  784):     #03 pc 0001de3f  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_socket_pollcallback+582)
D/CrashAnrDetector(  784):     #04 pc 0001b667  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_poll_ctx_dopoll+150)
D/CrashAnrDetector(  784):     #05 pc 0001c333  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_handle_packets+62)
D/CrashAnrDetector(  784):     #06 pc 0000dedf  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_channel_poll+58)
D/CrashAnrDetector(  784):     #07 pc 0000e02b  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_channel_read_nonblocking+22)
D/CrashAnrDetector(  784):     #08 pc 0001dd5c  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libAutoinstallGui.so (ssh::Channel::readNonblocking(void*, unsigned int, bool)+72)
D/CrashAnrDetector(  784):     #09 pc 0001f280  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libAutoinstallGui.so (RemoteProcess::readChannel(bool)+216)
D/CrashAnrDetector(  784):     #10 pc 0001fd94  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libAutoinstallGui.so (RemoteReader::run()+40)
D/CrashAnrDetector(  784):     #11 pc 00077621  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libQt5Core.so
D/CrashAnrDetector(  784):     #12 pc 000137bb  /system/lib/libc.so (__pthread_start(void*)+30)
D/CrashAnrDetector(  784):     #13 pc 0001189b  /system/lib/libc.so (__start_thread+6)
D/CrashAnrDetector(  784): 
D/CrashAnrDetector(  784): stack:
D/CrashAnrDetector(  784):          9acfe248  00000015  
D/CrashAnrDetector(  784):          9acfe24c  b6f16a61  /system/lib/libc.so (malloc+12)
D/CrashAnrDetector(  784):          9acfe250  9aa0606c  
D/CrashAnrDetector(  784):          9acfe254  b393b8c3  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (emutls_alloc+66)
D/CrashAnrDetector(  784):          9acfe258  9aa2e028  
D/CrashAnrDetector(  784):          9acfe25c  00000002  
D/CrashAnrDetector(  784):          9acfe260  b39863a8  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so
D/CrashAnrDetector(  784):          9acfe264  b395fe9f  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (__emutls_get_address+196)
D/CrashAnrDetector(  784):          9acfe268  b6f70e04  
D/CrashAnrDetector(  784):          9acfe26c  00000003  
D/CrashAnrDetector(  784):          9acfe270  b3967838  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so
D/CrashAnrDetector(  784):          9acfe274  00010101  
D/CrashAnrDetector(  784):          9acfe278  9acfe694  [stack:30942]
D/CrashAnrDetector(  784):          9acfe27c  b3948263  /data/app/org.qtproject.example.AutoinstallGui-2/lib/arm/libssh.so (ssh_get_log_userdata+10)
D/CrashAnrDetector(  784):          9acfe280  b6f70e04  
D/CrashAnrDetector(  784):          9acfe284  b3948409  /data/app/org.qtproject.example.AutoinstallGui-
D/CrashAnrDetector(  784): processName:org.qtproject.example.AutoinstallGui
D/CrashAnrDetector(  784): broadcastEvent : org.qtproject.example.AutoinstallGui SYSTEM_TOMBSTONE
E/audit   ( 2171): type=1400 msg=audit(1448283251.242:4320): avc:  denied  { read } for  pid=30971 comm="qrngd" name="hw_random" dev="tmpfs" ino=10362 scontext=u:r:qrngd:s0 tcontext=u:object_r:hw_random_device:s0 tclass=chr_file
D/SecurityLogAgent:SEDenialService(  784): Got Modify Event and sending Denial Intent foraudit.log
E/audit   ( 2171):  SEPF_SM-G900F_5.0-1_0039
E/audit   ( 2171): 
E/audit   ( 2171): type=1300 msg=audit(1448283251.242:4320): arch=40000028 syscall=322 per=800000 success=no exit=-13 a0=ffffff9c a1=beefa6a0 a2=20000 a3=0 items=1 ppid=1 pid=30971 auid=4294967295 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=4294967295 comm="qrngd" exe="/system/bin/qrngd" subj=u:r:qrngd:s0 key=(null)
E/audit   ( 2171): type=1307 msg=audit(1448283251.242:4320):  cwd="/"
E/audit   ( 2171): type=1302 msg=audit(1448283251.242:4320): item=0 name="/dev/hw_random" inode=10362 dev=00:0b mode=020640 ouid=0 ogid=1000 rdev=0a:b7 obj=u:object_r:hw_random_device:s0
E/audit   ( 2171): type=1320 msg=audit(1448283251.242:4320): 
E/auditd  ( 2171): In denial and Property audit_ondenial is set to 1 
W/ContextImpl(  784): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1629 com.android.server.SEDenialService$AuditFileObserver.onEvent:76 android.os.FileObserver$ObserverThread.onEvent:122 android.os.FileObserver$ObserverThread.observe:-2 android.os.FileObserver$ObserverThread.run:85 
D/SecurityLogAgent:SEDenialService(  784): audit.ondenial set to 0 after sending samsung.intent.action.knox.DENIAL_NOTIFICATION intent
W/ContextImpl(  784): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1643 com.android.server.analytics.data.collection.application.CrashAnrDetector.broadcastEvent:296 com.android.server.analytics.data.collection.application.CrashAnrDetector.processDropBoxEntry:254 com.android.server.analytics.data.collection.application.CrashAnrDetector.access$100:60 com.android.server.analytics.data.collection.application.CrashAnrDetector$1.onReceive:102 
D/ConnectivityService(  784): returning getNetworkInfo(networkType - 1) :[type: WIFI[] - WIFI, state: CONNECTED/CONNECTED, reason: (unspecified), extra: "UPC5613602", roaming: false, failover: false, isAvailable: true, isConnectedToProvisioningNetwork: false]
D/SensorManager( 2775): registerListener :: 0, MPU6500 Acceleration Sensor, 200000, 0,  
I/libVoipEngineNative/EARLY( 2775): (3016/bc8) [virtual EStatus AndroidControllerDelegate::GetPersistentValue(const PooledString&, PooledString&):3700] JNI::<GetPersistentValue> 
D/SecurityLogAgent(30607):  SeDenialReceiver : Intent Received : samsung.intent.action.knox.DENIAL_NOTIFICATION
D/SecurityLogAgent(30607):  SeDenialReceiver : File path = null
D/ActivityManager(  784): post active user change for 0
D/KnoxTimeoutHandler(  784): postActiveUserChange for user 0
D/KnoxTimeoutHandler(  784): handleActiveUserChange for user 0


References:
Building for AndroidMatteo <matpen@xxxxxxx>
Re: Building for AndroidDaniel Kroker <dk@xxxxxxxxx>
Re: Building for AndroidMatteo <matpen@xxxxxxx>
Re: Building for AndroidAris Adamantiadis <aris@xxxxxxxxxxxx>
Re: Building for AndroidMatteo <matpen@xxxxxxx>
Re: Building for AndroidAris Adamantiadis <aris@xxxxxxxxxxxx>
Re: Building for AndroidMatteo <matpen@xxxxxxx>
Re: Building for AndroidMatteo <matpen@xxxxxxx>
Archive administrator: postmaster@lists.cynapses.org