3 ms·
I imagine it would also be an interesting way to recover/continue on from a panic/segfault
by autoexecbat 3y ago
I imagine it would also be an interesting way to recover/continue on from a panic/segfault
- dmitrygr 3y agoSure..assuming the cause of your segfault was not somewhere in that data...as it surely was
- not2b 3y agoYes, you'd need a "safe mode" restart to avoid repeatedly failing and restarting in a tight loop.
- dmitrygr 3y agoSo sort of like…copying a good safe state of .data from an ELF file to RAM, clearing .bss in RAM, and jumping to a good safe instruction address, like the entry point as specified by the ELF file? </sarc>
- dathinab 3y agoThe problem is that this can "carry over" structures which are in a unsound state. Especially if abort was done due to runtime sanity/soundness checks failing. Or a segfault due to unsound structures etc. As far as I can tell you should only use it for "splatted" data, maybe allowing gaps. E.g. using it to not needing to load again some kind of multiple 1GiB bit mask which are just a 1GiB blob of bits each would probably work grate. Using it on structs which do not contain any pointer (i.e. no Strings, no Vecs, no &str etc.) would work okay. But the moment any pointers are stored in data carried over that way things become a huge mess and are basically fundamentally unsafe as they can easily become unsound.