Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Android Room: App crashes out of nowhere (Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0)

Ask Question

My problem is, that my app crashes out of nowhere and I have no Idea why. This happens irregular, but I think it has something to do with my room database. I try to provide as many infos as I can:

Database

@Database(entities = [ProductCacheEntity::class], version = 1)
@TypeConverters(Converters::class)
abstract class ShoppingCartDatabase : RoomDatabase() {
    abstract fun shopDao(): ShoppingCartDao
    companion object {
        const val DATABASE_NAME = "shop_db"
interface ShoppingCartDao {
    @Insert(onConflict = OnConflictStrategy.IGNORE)
    suspend fun insert(productCacheEntity: ProductCacheEntity): Long
    @Transaction
    suspend fun upsert(productCacheEntity: ProductCacheEntity) {
        val id = insert(productCacheEntity)
        if (productExists(id)) increaseQuantityById(productCacheEntity.id)
    @Query("UPDATE products SET quantity = quantity + 1 WHERE ID = :id")
    suspend fun increaseQuantityById(id: Int)
    @Query("UPDATE products SET quantity = quantity - 1 WHERE ID = :id")
    suspend fun decreaseQuantityById(id: Int)
    @Query("DELETE FROM products WHERE id = :id")
    suspend fun deleteProductById(id: Int)
    @Query("SELECT * FROM products")
    fun getAllProducts(): LiveData<List<ProductCacheEntity>>
    @Query("SELECT SUM(price * quantity) FROM products")
    fun getSummedPrice(): LiveData<Float>
    private fun productExists(id: Long): Boolean = id == -1L

Fragment

@AndroidEntryPoint
class ShoppingCartFragment(
    private val shoppingCartAdapter: ShoppingCartListAdapter,
    private val cacheMapper: ShopCacheMapper
) : Fragment(R.layout.fragment_shopping_cart), ShoppingCartListAdapter.OnItemClickListener {
    private val shoppingCartViewModel: ShoppingCartViewModel by viewModels()
    private val shoppingCartBinding: FragmentShoppingCartBinding by viewBinding()
   // private val shoppingCartAdapter = ShoppingCartListAdapter()
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        shoppingCartAdapter.clickHandler(this)
        bindObjects()
        observeList()
    private fun observeList() {
        shoppingCartViewModel.productList.observe(viewLifecycleOwner, shoppingCartAdapter::submitList)
    private fun bindObjects() = with(shoppingCartBinding) {
        adapter = shoppingCartAdapter
        viewModel = shoppingCartViewModel
        lifecycleOwner = viewLifecycleOwner
    override fun forwardCardClick(productCacheEntity: ProductCacheEntity) {
        val product = cacheMapper.mapFromEntity(productCacheEntity)
        val action = ShoppingCartFragmentDirections.actionShoppingCartFragmentToShopItemFragment(product)
        findNavController().navigate(action)
    override fun fordwardBtnIncreaseClick(id: Int) {
        shoppingCartViewModel.increaseProductQuantityById(id)
    override fun fordwardBtnDecreaseClick(id: Int) {
        shoppingCartViewModel.decreaseProductQuantityById(id)
    override fun forwardBtnDeleteClick(id: Int) {
        shoppingCartViewModel.deleteProductById(id)
    override fun onDestroyView() {
        requireView().findViewById<RecyclerView>(R.id.rv_shopping_cart).adapter = null
        super.onDestroyView()

ListAdapter

class ShoppingCartListAdapter @Inject constructor() : ListAdapter<ProductCacheEntity, ShoppingCartListAdapter.ProductViewHolder>(Companion) {
    private lateinit var clickListener: OnItemClickListener
    companion object: DiffUtil.ItemCallback<ProductCacheEntity>() {
        override fun areItemsTheSame(oldItem: ProductCacheEntity, newItem: ProductCacheEntity): Boolean = oldItem.id == newItem.id
        override fun areContentsTheSame(oldItem: ProductCacheEntity, newItem: ProductCacheEntity): Boolean = oldItem == newItem
    inner class ProductViewHolder(val binding: ShoppingCartListItemBinding): RecyclerView.ViewHolder(binding.root)
    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ProductViewHolder {
        val layoutInflater = LayoutInflater.from(parent.context)
        val binding = ShoppingCartListItemBinding.inflate(layoutInflater, parent, false)
        return ProductViewHolder(binding).also {
            with(binding) {
                ivProduct.setOnClickListener { clickListener.forwardCardClick(binding.product!!) }
                tvTitle.setOnClickListener { clickListener.forwardCardClick(binding.product!!) }
                btnIncrease.setOnClickListener { clickListener.fordwardBtnIncreaseClick(binding.product!!.id) }
                btnDecrease.setOnClickListener { clickListener.fordwardBtnDecreaseClick(binding.product!!.id) }
                btnDelete.setOnClickListener { clickListener.forwardBtnDeleteClick(binding.product!!.id) }
    override fun onBindViewHolder(holder: ProductViewHolder, position: Int) {
        val currentProduct = getItem(position) ?: return
        holder.binding.product = currentProduct
        holder.binding.btnDecrease.isEnabled = currentProduct.quantity > 1
        holder.binding.executePendingBindings()
    interface OnItemClickListener {
        fun forwardCardClick(productCacheEntity: ProductCacheEntity)
        fun fordwardBtnIncreaseClick(id: Int)
        fun fordwardBtnDecreaseClick(id: Int)
        fun forwardBtnDeleteClick(id: Int)
    fun clickHandler(clickEventHandler: OnItemClickListener) {
        clickListener = clickEventHandler

ViewModel (adding products here from another fragment)

class ShopItemViewModel @ViewModelInject constructor(
    private val shopCacheMapper: ShopCacheMapper,
    private val shoppingCartDB: ShoppingCartDao
) : ViewModel() {
    fun insertOrUpdateProduct(product: Product) = viewModelScope.launch {
        val cacheEntity = shopCacheMapper.mapToEntity(product)
        shoppingCartDB.upsert(cacheEntity)

ViewModel 2 (for shoppingcartfragment)

class ShoppingCartViewModel @ViewModelInject constructor(
    private val shopDB: ShoppingCartDao
): ViewModel() {
    val productList: LiveData<List<ProductCacheEntity>> = shopDB.getAllProducts()
    val summedPrice: LiveData<Float> = shopDB.getSummedPrice()
    fun increaseProductQuantityById(id: Int) = viewModelScope.launch {
        shopDB.increaseQuantityById(id)
    fun decreaseProductQuantityById(id: Int) = viewModelScope.launch {
        shopDB.decreaseQuantityById(id)
    fun deleteProductById(id: Int) = viewModelScope.launch {
        shopDB.deleteProductById(id)

Stacktrace one

--------- beginning of crash
2020-10-16 13:09:08.638 11560-11669/com.example.app A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x40 in tid 11669 (Thread-5), pid 11560 (com.example.app)
2020-10-16 13:09:08.678 11707-11707/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-10-16 13:09:08.678 11707-11707/? A/DEBUG: Build fingerprint: 'google/sdk_gphone_x86/generic_x86:10/QSR1.200715.002/6695061:userdebug/dev-keys'
2020-10-16 13:09:08.678 11707-11707/? A/DEBUG: Revision: '0'
2020-10-16 13:09:08.678 11707-11707/? A/DEBUG: ABI: 'x86'
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: Timestamp: 2020-10-16 11:09:08+0000
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: pid: 11560, tid: 11669, name: Thread-5  >>> com.example.app <<<
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: uid: 10133
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x40
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: Cause: null pointer dereference
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: Abort message: 'Check failed: throw_dex_pc < accessor.InsnsSizeInCodeUnits() (throw_dex_pc=21634, accessor.InsnsSizeInCodeUnits()=0) '
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG:     eax 00000000  ebx ecfeea74  ecx edfee140  edx f181b801
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG:     edi bfe10c88  esi d8b6a8a0
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG:     ebp bfe10a38  esp bfe109f0  eip ecf0ec29
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG: backtrace:
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG:     NOTE: Function names and BuildId information is missing for some frames due
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG:     NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG:     NOTE: found under the lib/ directory are readable.
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG:     NOTE: On this device, run setenforce 0 to make the libraries readable.
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG:       #00 pc 005c5c29  /apex/com.android.runtime/lib/libart.so (art::StackDumpVisitor::StartMethod(art::ArtMethod*, unsigned int)+41) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #01 pc 00491ec0  /apex/com.android.runtime/lib/libart.so (art::MonitorObjectsStackVisitor::VisitFrame()+80) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #02 pc 0058c8f8  /apex/com.android.runtime/lib/libart.so (_ZN3art12StackVisitor9WalkStackILNS0_16CountTransitionsE0EEEvb+2008) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #03 pc 005b6bfe  /apex/com.android.runtime/lib/libart.so (art::Thread::DumpJavaStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, bool) const+1022) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #04 pc 005b1fe9  /apex/com.android.runtime/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+1017) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #05 pc 005ace61  /apex/com.android.runtime/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+65) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #06 pc 005d2cd1  /apex/com.android.runtime/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+929) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #07 pc 005cb034  /apex/com.android.runtime/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+1556) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #08 pc 005c9be4  /apex/com.android.runtime/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool)+1620) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #09 pc 005796f0  /apex/com.android.runtime/lib/libart.so (art::AbortState::DumpAllThreads(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, art::Thread*) const+448) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #10 pc 00564d30  /apex/com.android.runtime/lib/libart.so (art::Runtime::Abort(char const*)+1536) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #11 pc 000249b3  /apex/com.android.runtime/lib/libartbase.so (_ZNSt3__110__function6__funcIPFvPKcENS_9allocatorIS5_EES4_EclEOS3_+35) (BuildId: b3a3a0a741f44556d02d009140734527)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #12 pc 0000bac7  /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+727) (BuildId: e6c80e0dfebf299cd41f1c732ad018a9)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #13 pc 001b85bc  /apex/com.android.runtime/lib/libart.so (art::ThrowNullPointerExceptionFromDexPC(bool, unsigned int)+499) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #14 pc 00331cf1  /apex/com.android.runtime/lib/libart.so (art::interpreter::ThrowNullPointerExceptionFromInterpreter()+33) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #15 pc 0034055a  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*)+31834) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #16 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #17 pc 0000170c  [anon:dalvik-/system/framework/framework.jar-transformed-transformed-transformed-transformed]
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #18 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #19 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #20 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #21 pc 0033edd3  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*)+25811) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #22 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #23 pc 0032f624  /system/framework/framework.jar (android.database.AbstractCursor.moveToPosition)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #24 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #25 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #26 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #27 pc 0033edd3  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*)+25811) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #28 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #29 pc 0032f600  /system/framework/framework.jar (android.database.AbstractCursor.moveToNext)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #30 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #31 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #32 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #33 pc 0033ee45  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*)+25925) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #34 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #35 pc 0002834c  [anon:dalvik-classes.dex extracted in memory from /data/local/tmp/perfd/sqlite-inspection.jar] (androidx.sqlite.inspection.SqliteInspector.querySchema)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #36 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #37 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #38 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #39 pc 0033b651  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*)+11601) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #40 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #41 pc 00028010  [anon:dalvik-classes.dex extracted in memory from /data/local/tmp/perfd/sqlite-inspection.jar] (androidx.sqlite.inspection.SqliteInspector.handleGetSchema)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #42 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #43 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #44 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #45 pc 0033b651  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*)+11601) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #46 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #47 pc 00028a0c  [anon:dalvik-classes.dex extracted in memory from /data/local/tmp/perfd/sqlite-inspection.jar] (androidx.sqlite.inspection.SqliteInspector.onReceiveCommand)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #48 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #49 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #50 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #51 pc 0033edd3  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false, false>(art::interpreter::SwitchImplContext*)+25811) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #52 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #53 pc 00008a8c  [anon:dalvik-classes.dex extracted in memory from /data/data/com.example.app/code_cache/perfa.jar] (com.android.tools.agent.app.inspection.AppInspectionService.sendCommand)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #54 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #55 pc 002ffcc5  /apex/com.android.runtime/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+181) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #56 pc 0066fc49  /apex/com.android.runtime/lib/libart.so (artQuickToInterpreterBridge+1209) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #57 pc 0014503d  /apex/com.android.runtime/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #58 pc 0013e7d2  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+338) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #59 pc 00149a69  /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+281) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #60 pc 0055a563  /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+99) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #61 pc 0055bcca  /apex/com.android.runtime/lib/libart.so (art::InvokeVirtualOrInterfaceWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, char*)+474) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #62 pc 0040962f  /apex/com.android.runtime/lib/libart.so (art::JNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, char*)+943) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #63 pc 003d8f44  /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, char*, art::Primitive::Type, art::InvokeType)+1700) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #64 pc 003c53f9  /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, char*)+73) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #65 pc 00034a4e  /data/data/com.example.app/code_cache/libjvmtiagent_x86.so
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #66 pc 000348de  /data/data/com.example.app/code_cache/libjvmtiagent_x86.so
2020-10-16 13:09:08.740 11707-11707/? A/DEBUG:       #67 pc 0008e55d  /data/data/com.example.app/code_cache/libjvmtiagent_x86.so
2020-10-16 13:09:08.740 11707-11707/? A/DEBUG:       #68 pc 0008ec20  /data/data/com.example.app/code_cache/libjvmtiagent_x86.so
2020-10-16 13:09:08.740 11707-11707/? A/DEBUG:       #69 pc 00312a0e  /data/data/com.example.app/code_cache/libjvmtiagent_x86.so
2020-10-16 13:09:08.740 11707-11707/? A/DEBUG:       #70 pc 0011a8e5  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+53) (BuildId: 471745f0fbbcedb3db1553d5bd6fcd8b)
2020-10-16 13:09:08.740 11707-11707/? A/DEBUG:       #71 pc 000af6a7  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+71) (BuildId: 471745f0fbbcedb3db1553d5bd6fcd8b)
2020-10-16 13:09:09.196 1852-1852/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_02
2020-10-16 13:09:09.307 2068-2176/system_process E/InputDispatcher: channel '3ea17ad com.example.app/com.example.app.framework.ui.view.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
                Did you find any solution to this? I'm seeing a very similar thing, and I notice you have AppInspectionService in the stacktrace. Were you also using Android Studio's database inspector?
– JatraTim
                Dec 16, 2020 at 14:39
                Yes I am, I have still many issues with my current database implementation. The app crashes out of nowhere with the above written weird error when I try to add something to my database very fast.. Do you think this has something to do with the inspector? Unfortunately, I have not found a solution to this..
– Andrew
                Dec 16, 2020 at 14:42
                Does this answer your question? Android Studio Preview 4.1 Database inspector crashes app
– Fabi755
                Jan 14, 2021 at 9:36
                you mean if i just don't use Database Inspector and keep going and code the rest of the app nothing happens and every thing will work fine?!
– Daniel Mohajer
                Mar 6, 2022 at 16:08
                This is a App Inspector issue not exclusive to DataBase code. try what is recommended here: developer.android.com/studio/known-issues
– Chepech
                Jul 11, 2022 at 18:04

To clarify, this is not related to Room code or Database code in general, it's a know issue related to the App Inspector. The solution that worked for me was to install the Google Play Intel x86 Atom_64 System Image (I'm on a 64 bit system , if you are not, use the Google Play Intel x86 Atom System Image).

This is installed depending on the API level your emulator is using, you need to have this for every version you are using.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.