How to fix hang in gdb in ld-linux.so.2 when running a 32-bit executable on a 64-bit Ubuntu (18.04) system?

UPDATE: This problem has been fixed for Ubuntu in the gdb package version 8.1-0ubuntu3.2, so just upgrading your packages (sudo apt update && sudo apt upgrade) should help currently.


ORIGINAL ANSWER:

@EmployedRussian suggested in his edit to the question:

By downgrading from gdb=8.1-0ubuntu3.1 to gdb=8.1-0ubuntu3 the debugger started working again for me.

This also worked for me on Ubuntu 18.04.3. You should issue these commands:

sudo apt install gdb=8.1-0ubuntu3  # downgrade GDB to the working version
sudo apt-mark hold gdb  # prevent upgrading (until the repository version is fixed)

I created a bug report for Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1848200
You can click Does this bug affect you? if you have an Ubuntu account to get it fixed sooner.


Probably this gdb bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23210

Try upgrading to the current GDB version (8.3.1). If Ubuntu doesn't offer a package for that, you can try compiling it yourself.


This is now fixed in 8.1-0ubuntu3.2 in bionic-updates: https://launchpad.net/ubuntu/+source/gdb/8.1-0ubuntu3.2