If you are the type of person who is easily distracted by nifty technology you might be thinking that playing with Node.js might be fun. It is. That is all you really need to know, regardless of whether it is a good idea, efficient, innovative, or whatever … it is fun.
As you might be able to tell, I have hit a difficult part of my PhD and began looking for something to distract myself. Unfortunately, the Node.js fun I was having was not enough. I needed more. I needed to compile Node.js from source (in debug mode) and put in breakpoints and look at things. This is the kind of fun that must be searched out when really big problems arise.
Unfortunately, when I compiled and ran my version of Node.js I ended up with an error that suggested that I had a segmentation fault.
Segmentation fault: 11
Other people had found this as well and the typical response was the “doctor, doctor, it hurts when I do this” response of “well then, don’t do that.” Then they reinstalled Node.js from a package installer or the aforementioned installer download.
Not for me; this promised to be the distraction I had dreamed about. It was back to the Internet to see if anybody else had tackled the problem. And the problem had been reported and fixed and closed and re-opend and fixed and closed and so on. To make a long story short-flavoured, my old Intel-based Macintosh has a hard time with 64-bit compilation and certain structures may need to be defined explicitly to be 64 bits long. The documentation from Apple is minimal, but there is some inline comments in their open source cdefs.h file:
/* * _DARWIN_FEATURE_64_BIT_INODE indicates that the ino_t type is 64-bit, and * structures modified for 64-bit inodes (like struct stat) will be used. */ #if __DARWIN_64_BIT_INO_T #define _DARWIN_FEATURE_64_BIT_INODE 1 #endif
The short fix (a lazy variant of the fix from here) required me to update the Node.js build configuration file, wscript, to add in the line
and with the new compile everything works as I expected it should, at least so far.
I really hope the PhD problem gets worked out soon.