net-vips: Image.WriteToFile crashes with NetVips.Native 8.9.0-rc4

Image.WriteToFile method with NetVips.Native 8.9.0-rc4 sometimes crashes unpredictably. I have an application, that writes tiles by cropping GeoTIFF. I’ve run some tests on CI and local machine (Win10). Each test writes approximately 7000 tiles. I’ve got following results: 8 tests on linux (CI) - passes without errors 12 tests on windows (CI) - 1/12 crashed 20 tests on windows (local) - 5/12 crashed

At first I tried to downgrade to NetVips 1.1.0 instead of 1.2.0-rc2 but that didn’t solve the issue. Then I tried to downgrade to NetVips.Native 8.8.4 and run through unit tests again: 20 tests on windows (local) - all passes

I also looked into tiles, that was written wrong and their correct versions, they look like this:

Broken: 27304

Correct: 27304_2

The exact fragment of code, throwing the exception is following:

outputImage = NetVips.Image.Black(Enums.Image.Image.TileSize, Enums.Image.Image.TileSize).NewFromImage(0, 0, 0, 0);

// Insert tile into output image
outputImage = outputImage.Insert(tileImage, writePosX, writePosY);

//This string throws an exception sometimes
outputImage.WriteToFile(outputTileFileInfo.FullName);

Vips’s exception message:

unable to call VipsForeignSavePngFile
    TIFFFillTile: Seek error at row 3584, col 0, tile 194
    vips2png: unable to write to target

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Ah I see, Python does indeed have (pretty) good memory behavior. Let me know if I should open a separate issue on the ruby-vips repo (the reference count might increase if running that loop parallelized, but I didn’t test that).

@Gigas002 NetVips v1.2.0 and NetVips.Native v8.9.1 is now available. Thanks for reporting this!

That seems to fix it for me.

Thanks for reporting this @Gigas002 !