XFIG crashes with a "double free" error when including PDFs

Since the latest stable update (13/6/22), even after rebuilding & reinstalling, xfig crashes when I try to include a PDF file as an image. (The same thing happened a couple of updates ago, but on that occasion a rebuild & reinstall fixed the problem.)

To trigger:

  • enter xfig.
  • Select “Picture”
  • Mark the area of the picture.
  • Select a PDF file to include.
  • xfig crashes with the error:
free(): double free detected in tcache 2
Aborted (core dumped)

The problem does not occur with encapsulated postscript or PNG files.

Extra comment: xfig-git does appear to work correctly (sometimes).

Cross checking cases, it looks as if the problem is triggered only when the PDF is the first picture object included in the figure. It is even possible to:

  • Include PNG or EPS
  • Include PDF
  • Remove PNG or EPS.