Skip to content

SIGABRT CRASH on HeartbeatTimer: malloc: Heap corruption detected, free list is damaged #17

@MilesV64

Description

@MilesV64

Bug report

Describe the bug

While leaving my app open on a screen that has a channel subscription, after around 20 minutes without touching the app it crashed, saying "malloc: Heap corruption detected, free list is damaged". This has happened several times, on different devices.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Make a channel subscription:
let client = self.supabaseClient.realtime
client.connect()
        
let allChanges = client.channel(.column("id", value: id, table: "table-name", schema: "schema-name"))
        
client.onOpen { [weak self] in
   print("Realtime client opened")
}
        
allChanges.on(.update) { [weak self] _ in
    print("Realtime update")
}

allChanges.subscribe()
        
self.realtimeChannel = allChanges
  1. Wait with the app open for a while, while triggering lots of updates to the database on another device/directly to the db
  2. At a seemingly random time, the app will crash with a signal SIGABRT.

Expected behavior

The client should be able to stay open indefinitely with no crashes.

Screenshots

Image of where the crash occurred in the library
Image of the thread stack trace

System information

  • OS: [iOS 16.4.1]
  • Version of supabase-realtime: [0.0.2]
  • Version of supabase-swift: [0.2.1]

Additional context

This is happening quite consistently, please advise how to fix the crash if it's a usage issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions