On Sat, May 15, 2021 at 4:49 AM Robert O'Callahan <
rocal...@gmail.com> wrote:
>
> For some years now we have maintained backward compatibility: new rr versions can replay recordings made by any version of rr since 5.0. This has worked well.
>
> We haven't promised forward compatibility, and once in a while we make changes that break forward compatibility. For example I just landed
https://github.com/rr-debugger/rr/commit/5c6e992b2ad174e980dd3b08987218ceaf5a5db1 to handle mmaps of large sparse files. This requires adding some metadata to MemWrites in the trace, indicating where "holes" occur in the written data (regions of all-zeroes). Some recordings made by rr after that commit will not replay correctly in rr built before that commit. I think changes of this kind are inevitable, though relatively rare in practice.
>
> However, it's unfortunate that if you try to replay a new recording in an old rr, you'll just get a mysterious crash at some point during the replay. Ideally rr would immediately exit cleanly with an error indicating what the problem is. So I propose that we bake a "forward compatibility version number" into rr, set it to 1, and add it to the header with old traces defaulting to 0. Every time we break forward compatibility in the future (i.e, whenever we make rr changes so that it may produce traces that don't replay in older rr) we will increment that version number. rr replay will check that version number and if it's higher than the version number that rr build knows about, rr will abort the replay with a suitable message.
>
> Obviously this wouldn't help with existing rr builds but it might ease pain in the future.
>
> Any thoughts?