To prevent the coredump, my work around is to put a wait on greeter-setup-script in lightdm.conf until hostnamectl --transient is valid.
How to set the hostname assigned by DHCP server? fallback-hostname breaks transient hostname - #6 by stargazer
The above solution has been improved and it solves 2 issues:
- gtk-greeter fails
- lightdm restarts even with the greeter-setup-script, but it prevented the segfault
The new solution is to create a systemd service that lightdm requires. The service will wait until the transient hostname is set by dhcp.