Skip to content

Crash with bus error on calling vips_rank #3832

@akash-akya

Description

@akash-akya

Program cashes when vips_rank called successively on same image.

Program exit with error:

[2]    60540 bus error  ./a.out

To Reproduce

Sample image: https://raw.githubusercontent.com/elixir-image/image/main/test/support/images/tulips.png

#include <vips/vips.h>

int
main (int argc, char **argv)
{
  if (VIPS_INIT (argv[0]))
    return (-1);

  VipsImage *img;
  size_t size;

  img = vips_image_new_from_file ("tulips.png", NULL);

  for (uint i = 0; i < 500; i++) {
    if (vips_rank (img, &img, 3, 3, 7, NULL) != 0) {
      vips_error_exit (NULL);
    }
  }

  (void)vips_image_write_to_memory (img, &size);

  return (0);
}
  • gcc -g -Wall seg_fault.c `pkg-config vips --cflags --libs`
  • run ./a.out

Unfortunately, I couldn't manage to get core-dump as I updated my machine recently, and I have to configure it to produce one.

Environment
* OS: MacOS 14.2.1
* Vips: vips-8.15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions