Isolate->Dispose() causes crash only when Math.random() is used

61 views
Skip to first unread message

George Corney

unread,
Feb 1, 2016, 4:16:57 PM2/1/16
to v8-users
Hey,

I'm struggling to get to the bottom of this one

The crash occurs with a slightly modified version of the hello-world.cc sample, I've separated the initialization and execution into one function and the dispose calls into another. If the executed javascript contains Math.random(), the app crashes with 'Segmentation fault: 11' when isolate->Dispose() is called. If isolate->Dispose() is called from within the initialization function then there is no crash.


The crash log is in a comment below

I'm keen to know if i'm doing something wrong in how I'm separating the initialization and dispose calls or if this is a bug with Math.random()

I'm running OS X 10.11.3 and building with V8 with hash e709aa2

Jochen Eisinger

unread,
Feb 2, 2016, 3:48:56 AM2/2/16
to v8-users
you stack-allocate the ArrayBufferAllocator, so it'll get destructed at the end of the Initialize() method.

You should allocate it on the heap instead, so it outlives that method.

best
-jochen

--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

George Corney

unread,
Feb 2, 2016, 4:35:36 AM2/2/16
to v8-users
Yep, that was it! Thanks for your help Jochen!
Reply all
Reply to author
Forward
0 new messages