Menu

#573 Segmentation Fault when comparing images

v1.0_(example)
closed-fixed
None
5
2018-10-03
2018-10-01
Mark
No

Using gm 1.3.30 on macOS 10.14, I sometimes get a segmentation fault when comparing two png images, but only when one of them is the reference image and the other is the compare image. For example, given two pngs - one.png and two.png:

$ gm compare -metric mse one.png two.png
gm compare: abort due to signal 11 (SIGSEGV) "Segmentation Fault"...
Abort trap: 6

Whereas:

$ gm compare -metric mse two.png one.png
$ gm compare -metric mse one.png one.png
$ gm compare -metric mse two.png two.png

All work as expected without any error.

I've attached two images which demonstrate this.

If there's something fundamentally wrong with one of the images or the comparison, then ideally gm should output an error rather than failing like this.

1 Attachments

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2018-10-02
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2018-10-02

    I am able to reproduce this problem on a Ubuntu Linux system using the 1.3.30 release but the problem does not occur with the development version. While there have been some PNG fixes and (many other fixes), I am not quite sure which fix might have solved the issue. I am suspecting that the issue is due to a double-free of heap memory.

    Are you able to build with the development source code and see if the problem still occurs for you?

     
  • Mark

    Mark - 2018-10-03

    Thank you for getting back to me. I originally installed gm using homebrew, but I reinstalled 1.3.30 from source to confirm that gives the same result, and then installed 1.4 snapshot-20180930 and can confirm that I no longer see the issue.

    So from my perspective the changes in the development version do indeed fix things.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2018-10-03
    • status: open --> closed-fixed
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2018-10-03

    Problem seems to be fixed already and fix will be in next release.

     
  • Mark

    Mark - 2018-10-03

    Excellent - thank you so much.

     

Log in to post a comment.