cherry-pick fd invariant panic fix
Source for buildrump.sh git rev 443d737b176cc236a4d258cd924ea3fe4564d4d4