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

Two dictionaries - Segmentation fault: 11 #18

Closed
kdzwinel opened this issue Feb 16, 2015 · 3 comments
Closed

Two dictionaries - Segmentation fault: 11 #18

kdzwinel opened this issue Feb 16, 2015 · 3 comments

Comments

@kdzwinel
Copy link

nodehun version - 1.0.2
node version - v0.10.36
OS X

var fs = require('fs');
var nodehun = require('nodehun');

var dict = new nodehun(fs.readFileSync('dictionaries/en_GB.aff'), fs.readFileSync('dictionaries/en_GB.dic'));
dict.addDictionary(fs.readFileSync('dictionaries/en_US.dic'));
@kdzwinel kdzwinel changed the title Two dictionaries - segmentation fault Two dictionaries - Segmentation fault: 11 Feb 16, 2015
@nathanjsweet
Copy link
Collaborator

I'm unable to reproduce this, but I would encourage you to productionalize your code to get it running. Try using readfile instead of readFileSynce and try running this on linux to see if it works. I've chased too many OSX segfaults to care about it (the OS) as anything more than a dev environment.

@kdzwinel
Copy link
Author

I've two minimal examples here: https://dl.dropboxusercontent.com/u/8989748/nodehun-segfault.zip . One uses readFile, the other one uses readFileSync.

And you are right, readFile does work. But why does it behave differently than readFileSync?

@nathanjsweet
Copy link
Collaborator

short answer: I don't really know

long answer: node.js, itself, has a few issues on OSX (as does Python, Ruby, PHP, etc), because OSX has weird configurations that violate what BSD and Linux normally do. This is usually a security thing (i.e. no process on OSX is allowed to have more than 2048 file descriptors at a time). Seg-faults are common.

On the whole OSX is a fine OS to do work on, but it isn't a perfect representation of *nix in production. Developers working on projects like Node.js, Python, etc are usually content to let more obscure bugs in OSX slide, because it is assumed you won't actually be running production code on OSX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants