This repository has been archived by the owner. It is now read-only.

new Float64Array(1024*1024*200) crashes #2280

Closed
kripken opened this Issue Dec 6, 2011 · 3 comments

Comments

Projects
None yet
3 participants
@kripken

kripken commented Dec 6, 2011

On node 0.6.5, doing

new Float64Array(1024*1024*200)

leads to a segmentation fault. This is on 32-bit Linux. The array should take 1.6GB, which this machine has (but even if not, an error would be better than a segmentation fault). Creating smaller arrays works fine.

@ghost ghost assigned bnoordhuis Dec 6, 2011

@bnoordhuis

This comment has been minimized.

Show comment Hide comment
@bnoordhuis

bnoordhuis Dec 6, 2011

Member

Confirmed.

Member

bnoordhuis commented Dec 6, 2011

Confirmed.

@migounette

This comment has been minimized.

Show comment Hide comment
@migounette

migounette Dec 7, 2011

This a V8 issue (v8_types_array.cc)

  length = args[0]->Uint32Value();
  // TODO(deanm): Handle integer overflow.
  v8::Handle<v8::Value> argv[1] = {
      v8::Integer::NewFromUnsigned(length * TBytes)};

  buffer = ArrayBuffer::GetTemplate()->
             GetFunction()->NewInstance(1, argv);

  void* buf = buffer->GetPointerFromInternalField(0); <== This is the exception because buffer._val == NULL

bnoordhuis can you help how I can submit a patch ? Do I need to submit a patch to v8 ?

This a V8 issue (v8_types_array.cc)

  length = args[0]->Uint32Value();
  // TODO(deanm): Handle integer overflow.
  v8::Handle<v8::Value> argv[1] = {
      v8::Integer::NewFromUnsigned(length * TBytes)};

  buffer = ArrayBuffer::GetTemplate()->
             GetFunction()->NewInstance(1, argv);

  void* buf = buffer->GetPointerFromInternalField(0); <== This is the exception because buffer._val == NULL

bnoordhuis can you help how I can submit a patch ? Do I need to submit a patch to v8 ?

@bnoordhuis bnoordhuis closed this in 8c02f9b Mar 9, 2012

@bnoordhuis

This comment has been minimized.

Show comment Hide comment
@bnoordhuis

bnoordhuis Mar 9, 2012

Member

Fixed in 8c02f9b. V8 limits external arrays to 1024^3 bytes, node now throws a RangeError if you try to create a buffer or typed array that's larger than that.

Member

bnoordhuis commented Mar 9, 2012

Fixed in 8c02f9b. V8 limits external arrays to 1024^3 bytes, node now throws a RangeError if you try to create a buffer or typed array that's larger than that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.