I can reproduce using the script on GNOME 3.26.1. This happens through normal desktop usage also. Crashes and kills entire desktop on both Xorg and wayland, so it's really annoying and will cause lost work. Should we file an upstream bug?
Oct 26 08:18:55 ossy gnome-shell[18937]: ../../../../glib/gmem.c:130: failed to allocate 18446744072 098939136 bytes Oct 26 08:18:55 ossy kernel: traps: gnome-shell[18937] trap int3 ip:7f12d8bb0961 sp:7ffcd8da7050 err or:0 Oct 26 08:18:55 ossy gnome-session[5573]: gnome-session-binary[5573]: WARNING: Application 'org.gnom e.Shell.desktop' killed by signal 5

