Thanks for the reports. I'm pretty sure the OP was reporting a different problem. These seem entirely unrelated.
I cannot reproduce the OP's crash with the provided script. I'm using libxml2 2.9.4, Python 3.6.6 and the latest lxml, and I get an error message that looks correct, but no crash.
Regarding the second problem, I also cannot reproduce this, but I tried using latest master, latest Cython and gcc-7.3. Don't have gcc-8 at hand currently.
Thanks for the reports. I'm pretty sure the OP was reporting a different problem. These seem entirely unrelated.
I cannot reproduce the OP's crash with the provided script. I'm using libxml2 2.9.4, Python 3.6.6 and the latest lxml, and I get an error message that looks correct, but no crash.
Regarding the second problem, I also cannot reproduce this, but I tried using latest master, latest Cython and gcc-7.3. Don't have gcc-8 at hand currently.