Skip to content

[hotfix] catch `OutOfMemoryError`s in signald's `loadEnvelope`

context:

  • bug: experiencing bugs on startup that cause numbers to become completely unresponsive
  • likely cause:
    • on startup, signald calls Manager.loadEnvelope to try to resend failed messages that have been cached on the filesystem
    • Manager.loadEnvelope tries to allocate byteArray of contentLen to deserialize the cached messages, but contentLen is ridiculously large b/c file was garbage, causing in.readInt() to return nonsense value
    • :. when system tries to allocate byte array, it runs out of heap space
  • attempted fix:
    • catch the OOM and return null (which is handled gracefully by
    • caller in `Manager.retryFailedMessages``

changes:

Edited by aguestuser

Merge request reports