In function pyxStartElement, qsort is used to sort the attributes argument in place.
Since libxml2 keeps track of which attributes have been allocated and which not, this may lead to a program crash when pyxStartElement reorders the elements of the attributes array.
Patch attached.
Thanks, I applied your patch as commit 9a3a1862b3f315f8bd4cec1b9347cdd9180b4e71.
Fixed in 1.4.2