Thanks for the quick responses, but I think it is a system configuration problem. I cloned geany and the geany-plugins, and executed the usual sudo make install. Geanygendoc was not included because the version of ctpl in Ubuntu 24.04 was not new enough. I cloned and installed the latest ctpl. The crash still occurs.
However if I run ./src/geany from the cloned geany directory geanygendoc works correctly.
I am not sure how to resolve this (although I have found a roundabout way of getting it to run).
Maybe this issue should be closed, as it is probably not a geany problem.