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

Segmentation fault on node.js 0.10.30 #30

Open
juhovh opened this issue Aug 5, 2016 · 3 comments
Open

Segmentation fault on node.js 0.10.30 #30

juhovh opened this issue Aug 5, 2016 · 3 comments

Comments

@juhovh
Copy link

juhovh commented Aug 5, 2016

I'm getting the following:

$ node
> var charsetDetector = require("node-icu-charset-detector");
undefined
> var charset = charsetDetector.detectCharset(new Buffer('6d79f668e4', 'hex'));
Segmentation fault (core dumped)
@juhovh
Copy link
Author

juhovh commented Aug 5, 2016

node-icu-charset-detector version is 0.2.0 and system is Ubuntu.

@sffc
Copy link

sffc commented Feb 28, 2019

Still happens on Node.js 6

Another test case:

charsetDetector.detectCharset(Buffer.from("ceb6de4f330820d3ffb18f704b8a42783eb6aa82", "hex"));

Valgrind stack trace:

==20478== Process terminating with default action of signal 11 (SIGSEGV)
==20478==  Access not within mapped region at address 0x10
==20478==    at 0x9BA7290: icu_50::CharsetMatch::getName() const (in /usr/lib64/libicui18n.so.50.1.2)
==20478==    by 0x9848252: CharsetMatch::GetName(Nan::FunctionCallbackInfo<v8::Value> const&) (in /path/to/node_modules/node-icu-charset-detector/build/Release/node-icu-charset-detector.node)
==20478==    by 0x98478B5: Nan::imp::FunctionCallbackWrapper(v8::FunctionCallbackInfo<v8::Value> const&) (in /path/to/node_modules/node-icu-charset-detector/build/Release/node-icu-charset-detector.node)
==20478==    by 0x8A40E1: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) (in /usr/bin/node)
==20478==    by 0x90310D: v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate*, v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)3>) (in /usr/bin/node)
==20478==    by 0x9039AD: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) (in /usr/bin/node)

@sffc
Copy link

sffc commented Feb 28, 2019

After some experimentation, I found that this appears to be a bug in ICU4C, not a bug in this wrapper module. The segfault appears to have been fixed in ICU 53. Upgrading your ICU4C installation to ICU 53 or later should fix the issue.

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