Crash on R2.2 libtensorflowlite_c.so

  I used android-ndk-r18b to build R2.2 libtensorflowlite_c.so.But the following six crash appear on the Android platform.!

  The corresponding locations located in the "tensorflow 2.2" source code are as follows:

1、/tensorflow/lite/experimental/ruy/kernel_arm32.cc:631
// r6 has flags, r4 has row
“add r5, r1, r4, lsl #2\n”
“tst r6, #” RUY_STR(RUY_ASM_FLAG_HAS_PERCHANNEL) “\n”
“it ne\n”
“movne r1, r5\n”
“vld1.32 {q10}, [r1]\n” // multiplier_fixedpoint

2、/tensorflow/lite/experimental/ruy/kernel_arm.h:100
if (dst->layout.cols == 1) {
Kernel8bitNeonOutOfOrder1Col(params);
return;
}
Kernel8bitNeonOutOfOrder(params);
}

3、/tensorflow/lite/experimental/ruy/kernel_common.h:69
#if RUY_OPT_ENABLED(RUY_OPT_FAT_KERNEL)
kernel.Run(lhs, rhs, spec, start_row, start_col, end_row, end_col, dst);
#else
for (int col = start_col; col < end_col; col += RhsLayout::kCols) {
int block_end_col = std::min(col + RhsLayout::kCols, end_col);
for (int row = start_row; row < end_row; row += LhsLayout::kCols) {
int block_end_row = std::min(row + LhsLayout::kCols, end_row);
kernel.Run(lhs, rhs, spec, row, col, block_end_row, block_end_col, dst);
}
}
4、/tensorflow/lite/experimental/ruy/trmul_params.h:39
void RunKernel(Tuning tuning, const SidePair& start,
const SidePair& end) {
run_kernel(tuning, packed, spec, start, end, &dst);
}

5、tensorflow/lite/experimental/ruy/thread_pool.cc:83
switch (new_state) {
case State::Ready:
if (task_) {
// Doing work is part of reverting to ‘ready’ state.
task_->Run();
task_ = nullptr;
}
break;
6、/androidndk/ndk/sources/cxx-stl/llvm-libc++/include/type_traits:4345
template <class _Fp, class …_Args>
inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _Args&& …__args)
_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)…))

so I would like to know what is causing the crash and how to fix it,thanks!

1 Like

Hi, @four_fan

I apologize for the delayed response, if possible could you please try with latest version of TFLite by following these official documentation Ref-1, Ref-2

  1. Install the latest version of the Bazel build system.
  2. The Android NDK is required to build the native (C/C++) LiteRT code. The current recommended version is 25b, which may be found here.
  3. The Android SDK and build tools may be obtained here, or alternatively as part of Android Studio. Build tools API >= 23 is the recommended version for building LiteRT.

If issue still persists after trying with latest version of TFLite please let us know with updated error log to investigate this issue further and May I know on which OS are you trying please ?

Thank you for your cooperation and patience.

1 Like