crashdump(3)

πŸ“¦
version 29.0.6 Β· 2 versions
, in ubuntu stonking

πŸ’– crashdump β€” a whole module, bestie πŸ’–

okay so before we even get into it: this is crashdump(3), from the Erlang tools application, version 4.2.2, lovingly brought to you by Ericsson AB. it's an Erlang module definition, and it's literally a tool for handling Erlang crash dumps. yes, THAT kind of crash dump. the dramatic kind. 🫢


✨ NAME ✨

crashdump β€” A Tool for Handling Erlang Crash Dumps πŸ‘‘


🌸 DESCRIPTION 🌸

so here's the vibe: this module is where you go when your Erlang crash dumps are all locked up and mysterious, and you need to get the goods out of them. πŸ”“

this module contains functions for decrypting encrypted Erlang crash dumps β€” and ngl, that encrypted-crash-dump life only exists if you built Erlang with the --enable-encrypted-crash-dumps build flag. no flag, no encrypted dumps, no decryption needed. iykyk. πŸ’…


πŸ¦‹ FUNCTIONS πŸ¦‹

decrypt(EncryptedFile, PrivateKey) -> {ok, erlang:iovec()} | {error, Reason}

decrypt(EncryptedFile, PrivateKey) ->
             {ok, erlang:iovec()} | {error, Reason}
             when
                 EncryptedFile :: file:name(),
                 PrivateKey :: public_key:private_key(),
                 Reason :: dynamic().

this one decrypts the Erlang crash dump at EncryptedFile using PrivateKey. that's it, that's the whole function. hand it the encrypted file, hand it the private key, get back either {ok, erlang:iovec()} or an {error, Reason}. simple. clean. iconic. ✨


decrypt(EncryptedFile, PrivateKey, DecryptedFile) -> ok | {error, Reason}

decrypt(EncryptedFile, PrivateKey, DecryptedFile) ->
             ok | {error, Reason}
             when
                 EncryptedFile :: file:name(),
                 PrivateKey :: public_key:private_key(),
                 DecryptedFile :: file:name(),
                 Reason :: dynamic().

same energy as before, but this time it decrypts the Erlang crash dump at EncryptedFile using PrivateKey and writes the result out to DecryptedFile so you have an actual file to look at instead of a big ol' blob in memory. returns ok, or {error, Reason} if life said no. πŸŽ€


pem_decrypt(EncryptedFile, KeyFile) -> {ok, erlang:iovec()} | {error, Reason}

pem_decrypt(EncryptedFile, KeyFile) ->
                            {ok, erlang:iovec()} | {error, Reason}
                            when
                                EncryptedFile :: file:name(),
                                KeyFile :: file:name(),
                                Reason :: dynamic().

bestie this is a convenience wrapper around crashdump:decrypt/2 β€” it does the whole "get the key out of this PEM file for you" thing so you don't have to. 🧚 you pass the encrypted file, you pass the KeyFile, and it handles key extraction from that given PEM file. returns {ok, erlang:iovec()} or {error, Reason}.


pem_decrypt(EncryptedFile, KeyFile, DecryptedFile) -> ok | {error, Reason}

pem_decrypt(EncryptedFile, KeyFile, DecryptedFile) ->
                            ok | {error, Reason}
                            when
                                EncryptedFile :: file:name(),
                                KeyFile :: file:name(),
                                DecryptedFile :: file:name(),
                                Reason :: dynamic().

and THIS one is a convenience wrapper around crashdump:decrypt/3 β€” again, it handles key extraction from the given PEM file, but it also writes the decrypted crash dump out to DecryptedFile for you. returns ok or {error, Reason}. the way that it just handles the PEM key extraction so you don't have to?? obsessed. πŸ˜­πŸ’–


🌈 quick recap so you don't get them mixed up: four functions, two families. decrypt/2 gives you the data back, decrypt/3 writes it to a file. pem_decrypt/2 gives you the data back but pulls the key out of a PEM file for you, pem_decrypt/3 writes it to a file and also pulls the key out of a PEM file for you. decrypt = you already have a public_key:private_key(). pem_decrypt = you have a PEM file and you'd like someone else to deal with it. periodt. πŸ’…

and that's the whole page, no cap. signing off with love from Ericsson AB, this is tools version 4.2.2, page crashdump(3). take care of your crash dumps bestie, they've been through a lot πŸ«ΆπŸ’œβœ¨

πŸ“¦ where this page comes from