Boot a working instance, mount the broken file system, and repair. Such as booting rescue mode on reboot, or from install media. Or, move the disk to some other working instance, if a VM or otherwise shared storage.
Usually repair of system software could mean apt reinstall
a package from the repo you were using. However a quick search of https://packages.ubuntu.com finds basically nothing about libdthread.so.1 in recent releases. Where did this come from, and how did ls get linked to it?
Or, if you have backups of the operating system, restore those.
Yes, reinstall the system is an option that always can get you to a sane system. While you have the disks mounted, back up data somewhere else. Then should a clean install be necessary, nothing will be lost.
Making sense of a program crash usually involves getting human readable symbols for the exact version of the libraries in use.
Program core dump logging and analysis programs vary between Linux distros, unfortunately. An Ubuntu wiki page give examples of installing debug symbols and a pointer to apport-retrace
. Recent Ubuntu releases have debuginfod indexes, so a gdb session can download symbols from a remote service as needed.
Of course, if that code did not come from Ubuntu, you will need to source builds unstriped of symbols somewhere else.