Hello Johan Mollevik, I am maintaining neither python, gdal or matplotlib, was just trying to reproduce the memory error.
Unfortunately it worked in my minimal test VMs without crash or fault. Comparing the versions of my tests led me to the question if the system, where you experience this fault, is a Stretch or a Buster installation? Because the report states "stable" and the kernel is a backport. But python2, gdal and matplotlib seem to be versions from buster. Unfortunately I guess this could qualify for a system described in this link: https://wiki.debian.org/DontBreakDebian#Don.27t_make_a_FrankenDebian Could you reproduced this fault on either, a complete Stretch or complete Buster? Kind regards, Bernhard