googleapis / google-cloud-node

Google Cloud Client Library for Node.js
https://cloud.google.com/nodejs
Apache License 2.0
2.9k stars 590 forks source link

require('gcloud') crashing on Mac #681

Closed javorosas closed 9 years ago

javorosas commented 9 years ago

My old computer and my server instance both run Ubuntu and I never had any problem at all. Recently I'm using a Mac to code and have not been able to make this module work.

How to reproduce

I started a new project to isolate the issue to a minimum. This is the content of my server.js:

var gcloud = require('gcloud');
console.log("I'm here!");

I'm using:

Reproducing:

  1. I run node server.js on the terminal
  2. App crashes with the following output:
[1]    3488 illegal hardware instruction  node server.js

What I suspect

When I'm installing the npm module:

npm install gcloud@0.15

I get the following output:

npm WARN package.json testgcloud@1.0.0 No description
npm WARN package.json testgcloud@1.0.0 No repository field.
npm WARN package.json testgcloud@1.0.0 No README data

> sse4_crc32@3.2.0 install /Users/jrosas/dev/testgcloud/node_modules/gcloud/node_modules/sse4_crc32
> node-gyp rebuild

2015-06-20 01:30:56.147 xcodebuild[4882:196113] [MT] PluginLoading: Required plug-in compatibility UUID E969541F-E6F9-4D25-8158-72DC3545A6C6 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/VVDocumenter-Xcode.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-06-20 01:30:56.184 xcodebuild[4882:196113] [MT] PluginLoading: Required plug-in compatibility UUID E969541F-E6F9-4D25-8158-72DC3545A6C6 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/KSImageNamed.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-06-20 01:30:56.206 xcodebuild[4882:196113] [MT] PluginLoading: Required plug-in compatibility UUID E969541F-E6F9-4D25-8158-72DC3545A6C6 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/BBUDebuggerTuckAway.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-06-20 01:30:56.254 xcodebuild[4882:196113] [MT] PluginLoading: Required plug-in compatibility UUID E969541F-E6F9-4D25-8158-72DC3545A6C6 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/AdjustFontSize.xcplugin' not present in DVTPlugInCompatibilityUUIDs
  CXX(target) Release/obj.target/sse4_crc32/src/sse4_crc32.o
  SOLINK_MODULE(target) Release/sse4_crc32.node
gcloud@0.15.0 node_modules/gcloud
├── buffer-equal@0.0.1
├── extend@2.0.1
├── node-uuid@1.4.3
├── async@0.9.2
├── once@1.3.2 (wrappy@1.0.1)
├── stream-events@1.0.1 (stubs@1.1.2)
├── mime-types@2.1.1 (mime-db@1.13.0)
├── through2@0.6.5 (xtend@4.0.0, readable-stream@1.0.33)
├── duplexify@3.4.2 (end-of-stream@1.0.0, readable-stream@2.0.0)
├── sse4_crc32@3.2.0 (bindings@1.2.1, nan@1.8.4)
├── request@2.58.0 (caseless@0.10.0, aws-sign2@0.5.0, forever-agent@0.6.1, stringstream@0.0.4, tunnel-agent@0.4.0, oauth-sign@0.8.0, isstream@0.1.2, json-stringify-safe@5.0.1, qs@3.1.0, combined-stream@1.0.5, mime-types@2.0.14, bl@0.9.4, http-signature@0.11.0, tough-cookie@2.0.0, form-data@1.0.0-rc1, hawk@2.3.1, har-validator@1.7.1)
├── google-auth-library@0.9.6 (lodash.noop@3.0.0, string-template@0.2.1, jws@3.0.0, request@2.51.0, gtoken@1.1.1)
├── configstore@0.3.2 (object-assign@2.1.1, xdg-basedir@1.0.1, user-home@1.1.1, graceful-fs@3.0.8, uuid@2.0.1, osenv@0.1.2, mkdirp@0.5.1, js-yaml@3.3.1)
└── protobufjs@3.8.2 (ascli@0.3.0, bytebuffer@3.5.4)

I've googled those xcode-related warnings but haven't found anything relevant. I don't know if it's related with the issue, though.

Any clues?

anandsuresh commented 9 years ago

@abelino I might consider adding #ifdef __SSE4_2__ all over the code to deal with platform specific compilation. The code was written for our own platform (all Intel processors) which never had any of these issues. The software fallback was added way down the line. :)

javorosas commented 9 years ago
$ uname -a
Darwin jrosas.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64

$ clang -v
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
anandsuresh commented 9 years ago

@javorosas I'm running clang 6.0 on kernel 13.4 and face no issues. Can you try this on a different OS platform, like a lower kernel version? I'm trying to get my hands on an updated kernel to test at my end as well.

javorosas commented 9 years ago

I'm not able to try it in a different kernel version, since it's the computer from my job. But I can keep executing tests if it helps.

abelino commented 9 years ago

@javorosas locally can you replace the type on line 97 from uint32_t i, j, crc; to uint64_t i, j, crc; and re-run the test with all the logs.

stephenplusplus commented 9 years ago

We have quite a few of these issues popping up here that are actually coming from https://github.com/Voxer/sse4_crc32. I think since it's been almost 2 months since a reply here, this has been resolved. If not, it will probably be easier to open this up over at their repo for better, quicker help: https://github.com/Voxer/sse4_crc32.