-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
FATAL ERROR: v8::ArrayBuffer::Neuter Only externalized ArrayBuffers can be neutered #3619
Comments
+1, i have tried npm i -g tns-ios to reinstall things but it still fails. xcode version 7.1 (7B91b) |
@samb90 @charismsft What version of Node? |
I'm able to reproduce this error with node 5.0.0 but reverting to node 4.2.1 fixes it.
|
I'm on Node 5.0.0. I'll try an older version of node and report back |
how do i revert back to 4.2.1? |
We're having this error when compiling node-ffi on 5.0.0. Haven't found anything about this in the changelog. Is it an issue of node side, or should we (native module developers) change something in our codebase to work around this? |
@charismsft That depends on how you installed it in the first place. I would recommend opening an issue in https://github.com/nodejs/help/issues explaining what OS you are running and how you installed it. |
@bnoordhuis patched 4.x version (with 931118c) works fine, however 5.x is broken. The question is does everyone experiencing the problem here installed node from the website? If so - may I ask you to try building it from source and testing again? |
@Trott is there an easy way to reproduce it? |
I was doing something like this from the topmost dir in the repo clone:
Running |
Thanks. |
I had to skip one commit because it did not build cleanly, but it's either d8011d1 or 7fb128d.
I guess it's not surprising that it would be triggered by a v8 upgrade. |
Looking... I think I'm close to it. |
Gosh:
|
Fix: diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index 7d428b2..f987c04 100644
--- a/src/node_buffer.cc
+++ b/src/node_buffer.cc
@@ -187,6 +187,8 @@ char* Data(Local<Value> val) {
char* Data(Local<Object> obj) {
CHECK(obj->IsUint8Array());
Local<Uint8Array> ui = obj.As<Uint8Array>();
+ if (!ui->HasBuffer())
+ return nullptr;
ArrayBuffer::Contents ab_c = ui->Buffer()->GetContents();
return static_cast<char*>(ab_c.Data()) + ui->ByteOffset();
} @Trott mind giving it a try? |
Will continue looking into it once I'll return back to computer. |
Actually, I think this fix is correct. I'll write a test for it, should be easy thing. |
@indutny That change fixes it for me. |
Neuter external `nullptr` buffers, otherwise their contents will be materialized on access, and the buffer instance will be internalized. This leads to a crash like this: v8::ArrayBuffer::Neuter Only externalized ArrayBuffers can be neutered Fix: nodejs#3619
Neuter external `nullptr` buffers, otherwise their contents will be materialized on access, and the buffer instance will be internalized. This leads to a crash like this: v8::ArrayBuffer::Neuter Only externalized ArrayBuffers can be neutered Fix: #3619 PR-URL: #3624 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Hello all, I am experiencing this issue as well. Why was this issue closed? |
It's closed because it has been fixed on the master branch. However it has not been part of a release yet. Look for it in version 5.1.0 which seems likely to come out this week. |
I keep getting this error "FATAL ERROR: v8::ArrayBuffer::Neuter Only externalized ArrayBuffers can be neutered" when I run "tns platform add ios" or "tns platform add android"
The text was updated successfully, but these errors were encountered: