sharp: Sharp crashes a lot in production during resize operation inside libvips (Access violation)

Crash inside libvips (Access violation) during sharp resize operation

Is this a possible bug in a feature of sharp, unrelated to installation?

  • Running npm install sharp completes without error.
  • Running node -e "require('sharp')" completes without error.

Are you using the latest version of sharp?

  • I am using the latest version of sharp as reported by npm view sharp dist-tags.latest.

What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?

This is Irrelevant, as I cannot run this comand on PC of users of my app. On my dev PC the output is following (however it does not crash on my PC):

npx: installed 1 in 3.85s

  System:
    OS: Windows 10 10.0.19045
    CPU: (20) x64 Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz
    Memory: 54.41 GB / 63.71 GB
  Binaries:
    Node: 14.21.3 - C:\Program Files\nodejs\node.EXE      
    npm: 6.14.18 - C:\Program Files\nodejs\npm.CMD        
  npmPackages:
    sharp: ^0.32.1 => 0.32.1 

What are the steps to reproduce?

Unfortunately, there is no information about steps to reproduce. I have sharp build into my electron application for managing personal photo archive. Thousands of users download it each month and error happens at user side, I only get crash dumps. However, I get crash reports with this particular one several times EVERY DAY. I would say it accounts to roughly 20% of all crashes of my application, while all sharp related crashes together more than 90% of all native crashes.

As far as I can see from stack trace (unfortunately I do not have libvips PDB’s), this particular crash happens during resize operation.

image

I will be more than happy to provide bunch of dump files with this error.

What is the expected behaviour?

Do not crash my app 😃

Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem

I don’t think this is possible, as I don’t know steps to reproduce.

Please provide sample image(s) that help explain this problem

I’m afraid, this is impossible.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 19 (6 by maintainers)

Most upvoted comments

Yes, sharp.simd(false) does the same thing.

@lovell I’d love to, but unfortunately I can’t since I was not able to reproduce the issue myself. I was chasing it using crash reports from end users only. I can only confirm (as I did already) that workaround helped and I don’t get those report anymore.