-
Notifications
You must be signed in to change notification settings - Fork 7.3k
v0.12.0 segmentation fault in new Buffer(string, encoding) #9227
Comments
I have tried this on Ubuntu 12.04 and I don't get a segmentation fault, but I do get a lot more output and a I am using node v0.12.0, downloaded through nvm as well. What I get is:
...and then the process just exists. Note that I get the exact same thing with v0.10.36. |
Yes, FAIL is normal as this is not the full test, and since it is supposed to SEGV the actual result of the script is not important. Incidentally I tried running this with iojs, and it didn't fail. Then I re-installed node 0.12.0 , and it is not failing again. So I am thinking is it possible that somehow nvm installed me an broken node the first time ... |
@zaro Thanks for reporting. Please ping back if you manage to reproduce the issue again. |
ok, I tried reproducing it on OS X, Fedora 20, and Fedora 21 VM and I couldn't. And given the fact that it occurs with 50% chance on my laptop, makes me think there is something wrong with my laptop. |
Zaro, I can actually very reliably get this segfault to happen when using your htmlstrip-native module. In my case it happens if I rapidly attempt to strip the string "uyjkosyhdzsthopmg\n" alone or concatenated multiple times, though I am sure the exact content isn't relevant. My stack trace is roughly the same: PID 24136 received SIGSEGV for address: 0x0 This is Node 0.12.0 on x86_64 Kubuntu 14.10, if that's relevant. |
@carlin-psvl can you provide somehow a file with a test. I will try to reproduce it again. |
I have a simple C++ extension that worked fine on 0.10.X, and with the release of 0.12 I ported it to the new C++ addon interface. It works but it would quite often SEGV with the following stacktrace:
Initially I though I am messing up some memory in the C++ code, but after quite a lot of fiddling I managed to reproduce it with plain JS, and the problem seems to appear when Buffer is created from string with 'utf16-le' encoding( may occur with other encodings also, I used only this one).
Here are the two relevant files : https://gist.github.com/zaro/788a8fee8244d4ffc6f9 , also as zip here : https://foggly.net/public.php?service=files&t=79384320ca5afe8808f4d23163d565d3 .
Steps to reproduce:
1.unzip
2.
My node is installed trough nvm on Fedora 21.
I couldn't manage to reproduce the bug on a node with debug symbols, also by just adding comments or console.log() statements in both index.js and test_strip.js the bug disappears most of the time. For example if I comment everything below line 25 in index.js ( as it is irrelevant ) it is not triggered anymore.
The text was updated successfully, but these errors were encountered: