Hello,

I am working on a Node.js module that creates a CodeEventHandler 
(https://v8docs.nodesource.com/node-14.15/d2/d08/classv8_1_1_code_event_handler.html).
  
I've seen that it's Handle method can be called from outside the main 
isolate thread, i.e. for parallel garbage collection:

#3  0x00007f393a5fb0f3 in 
codeevents::FnInspectCodeEventHandler::Handle(v8::CodeEvent*) () from 
/home/ec2-user/module.node
#4  0x0000000000e43705 in 
v8::internal::ExternalCodeEventListener::CodeMoveEvent(v8::internal::AbstractCode,
 
v8::internal::AbstractCode) ()
#5  0x0000000000d5707a in 
v8::internal::ProfilingMigrationObserver::Move(v8::internal::AllocationSpace, 
v8::internal::HeapObject, v8::internal::HeapObject, int) ()
#6  0x0000000000d6d41b in void 
v8::internal::EvacuateVisitorBase::RawMigrateObject<(v8::internal::EvacuateVisitorBase::MigrationMode)1>(v8::internal::EvacuateVisitorBase*,
 
v8::internal::HeapObject, v8::internal::HeapObject, int, 
v8::internal::AllocationSpace) ()
#7  0x0000000000d706df in 
v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, 
long*) ()
#8  0x0000000000d5d17f in 
v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) ()
#9  0x0000000000d5d67f in 
v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner)
 
()
#10 0x0000000000d4f8c5 in 
v8::internal::ItemParallelJob::Task::RunInternal() ()
#11 0x0000000000c6c9eb in non-virtual thunk to 
v8::internal::CancelableTask::Run() ()
#12 0x0000000000a71405 in node::(anonymous 
namespace)::PlatformWorkerThread(void*) ()
#13 0x00007f3bd38d440b in start_thread () from /lib64/libpthread.so.0
#14 0x00007f3bd360ef9f in clone () from /lib64/libc.so.6

Is it safe to access the String values returned by GetFunctionName and 
GetScriptName in this context (i.e. using String.Write)?  Any method to 
access the underlying characters requires passing the isolate as a 
parameter, and all of the docs I can find say it's not safe to use the 
isolate without entering it via Locker.  However that isn't viable in this 
case as the Node.js main thread locks the isolate on startup, so trying to 
get a lock on the isolate simply deadlocks the thread.

thanks
pat 

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/fce27dad-1589-45ba-9c19-89d4a3bc8457n%40googlegroups.com.

Reply via email to