Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharp crashes silently #1828

Closed
bjg2 opened this issue Aug 7, 2019 · 9 comments
Closed

Sharp crashes silently #1828

bjg2 opened this issue Aug 7, 2019 · 9 comments
Labels

Comments

@bjg2
Copy link

bjg2 commented Aug 7, 2019

What is the output of running npx envinfo --binaries --languages --system --utilities?

  System:
    OS: Windows 7
    CPU: (8) x64 AMD FX(tm)-8320 Eight-Core Processor
    Memory: 6.66 GB / 11.97 GB
  Binaries:
    Node: 8.9.1 - C:\Program Files\nodejs\node.EXE
    npm: 5.5.1 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 2.7.15 - C:\Users\Halil\.windows-build-tools\python27\python.EXE

What are the steps to reproduce?
sharp version: 0.23.0
Run simple code with any PNG, like the one below (getting the metadata).

What is the expected behaviour?
BEFORE + AFTER, but only BEFORE happens (example below).

Are you able to provide a standalone code sample, without other dependencies, that demonstrates this problem?

const sharp = require("sharp");

console.log("BEFORE");
sharp("intros.png").metadata()
    .then(() => {
        console.log("AFTER");
    });

Are you able to provide a sample image that helps explain the problem?
intros


A bit longer explanation:

I do the devops in my company. I use sharp in the last pre-release step, to optimize the images on the site. It works on all linux machines (2), all mac machines (1), and 3 windows machines out of 6 (it works on 3 win10 machines, doesn't work on 2 win10 and 1 win8). It just crashes, breaking the program without any output... Can you figure out why it is happening and how to mitigate the issue for these machines?

PS. The issue happens with 0.23.0 version. With 0.22.1 everything works, so we have reverted to that one for now (so we're not blocked by the issue).

@bjg2 bjg2 added the triage label Aug 7, 2019
@lovell
Copy link
Owner

lovell commented Aug 12, 2019

Hi, are you able to use WinDbg or similar to get a backtrace of the crash?

@bjg2
Copy link
Author

bjg2 commented Aug 13, 2019

I am able, but you have to guide me through the steps. I tried installing windbg and setting it as postmortem debugger as described here, but windbg does not get auto-started after the crash and I don't know how to get the crash report....

I also tried to attach to the node process from the windbg, but it says:
image

Please provide me with the steps and I will give you results...

@lovell
Copy link
Owner

lovell commented Aug 13, 2019

#1708 (comment) provides an example of using procdump that should help.

@bjg2
Copy link
Author

bjg2 commented Aug 21, 2019

Ok, sorry for the wait, so I started the code above with sharp 0.23.0 and procdump:

Output:

BEFORE
[13:26:22] Exception: C06D007F
[13:26:22] Unhandled: C06D007F
[13:26:22] Dump 1 initiated: c:/repro\node.exe_190821_132622.dmp
[13:26:23] Dump 1 complete: 4 MB written in 0.5 seconds
Exception code=0xc0000005 flags=0x0 at 0x0000000000000000. Access violation - attempting to execute data at address 0x0000000000000000
[13:26:23] Dump count reached.

Dump attached.

node.exe_190821_132622.zip

Hope this helps!

@lovell
Copy link
Owner

lovell commented Aug 22, 2019

Thanks, I'll try to find a Windows machine to inspect this file on. Does this problem occur only with PNG input images?

@bjg2
Copy link
Author

bjg2 commented Aug 22, 2019

It does happen on jpg as well.

Note that it does not happen on all windows machines but only on some (as I mentioned above, 3 out of 6 in my organization).

@lovell
Copy link
Owner

lovell commented Sep 22, 2019

I tried analysing the dump file using WinDbg and, with a bit of web searching, my best guess would be that this exception relates to delayed loading of DLLs . A good next step might be to try running http://www.dependencywalker.com/ on the sharp.node file on one of the machines that fails and comparing the result of running it on a machine that works.

Perhaps overzealous anti-virus software on the failing machines is somehow intercepting/breaking DLL calls?

@lovell
Copy link
Owner

lovell commented Oct 25, 2019

@bjg2 Were you able to make any progress with this?

@lovell
Copy link
Owner

lovell commented Nov 13, 2019

Closing due to inactivity but please feel free to reopen with more details if further help is required.

@lovell lovell closed this as completed Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants