Evidently, this typemap was causing the issue with gcc 4.x:
%typemap(freearg) double const [] {
free($1);
}
What made it hard to track down was that I could not reproduce it on gcc 3.4.6.
It was cargo-culted and unnecessary code. Have we learned our lesson?