How can I fix this problem of gimp crashing?
This is a known bug in Ubuntu's GIMP package, and there does not appear to be an easy way to solve it until the bug has been fixed. They've confirmed the bug and given it High importance, so there's hope!
The cause appears to be:
...Debian and/or Ubuntu decided to make their GIMP 2.8 packages depend on gegl-0.3 instead of gegl-0.2 came as a surprise to some of the GIMP developers.
The bug is confirmed for the latest stable release of GIMP 2.8.20 on Ubuntu 16.04.2 LTS (as of this post)
If you can figure out how to apply them, there is a patch available in the bug report linked to above.
Not a solution for your problem but that tool works ok if you use the "snapped" gimp in https://snapcraft.io/gimp
Snap is a packaging tool that allows apps to be self-contained, this leverages any dependencies and apps behave something like the MacOs apps.
To install snap
sudo apt install snapd
To install snapped gimp
sudo snap install gimp
To use snapped gimp
snap run gimp