I went into this problem after updated my late 2013 MacBook pro to macOS 10.15 Catalina. If you bumped into the same situation as me that you can’t enter any commands into the terminal and see the messages below, maybe you can follow my steps.
-bash(914,0x1065a8d40) malloc: can't allocate region
*** mach_vm_map(size=18446744071651549184) failed (error code=3)
-bash(914,0x1065a8d40) malloc: *** set a breakpoint in malloc_error_break to debug
-bash: xrealloc: cannot allocate 18446744071651546364 bytes
[Process completed]
- “Shift+cmd+G” go to “/Users/UserName/.bash_profile”
if you can’t find the file, just go to “/Users/UserName/“ first, then press ”shift+cmd+.” to show the hide files, delete the file - Download the “.dash profile” zip from the website https://github.com/marcomontalbano/bash_profile
- unpack the zip, copy “.bash_profile” from the folder ”bash_profile-master” to “/Users/UserName/“ , Done!