The hardest tarball

43 points by stabbles 8 hours ago on lobsters | 2 comments

andyc | 4 hours ago

an archive that can be constructed using a single GNU tar invocation, that is extracted in 8 distinct ways depending on what tool you use

Hm interesting, I like these examples. I might call this a "maximum parser differential". Or I also called it a Yahtzee because you're "rolling the dice", and ideally you want the results to be the same, but they are different.

This came up here: comment on A Design Space Exploration of Async/Await

e.g. a (pseudo-code) async-await program that has 4 different behaviors in 4 languages, starting with

async fn write_to_log():
  ...

async fn fire_and_forget():
  ...

And then my own example of a POSIX shell script that has 4 behaviors in 4 shells:

command -v echo ZZZ for
echo status=$?

https://github.com/bashix-spec/bashix/blob/main/yahtzee/4-command.sh


OK and now I see you have tested this recent parser from Astral:

A fast and secure tar parser for the Rust ecosystem

The goal is reducing uv's exposure to parser differentials and other security risks


Any other "Yahtzee" examples? In any language or data format

[OP] stabbles | an hour ago

I have this one:

IFS=' :'; a='x '; b=':'; printf '<%s>' $a$b $(echo 'x ')$(echo ':y')

which gives

bash  <x><x><y>
dash  <x><><x><><y>
mksh  <x><><x><y>
zsh   <x :><x><><y>