<p dir="auto">In <code class="notranslate">Deno 1.10.1</code> using the Plugin Extension API, I get a sporadic <code class="notranslate">Access violation</code> resulting a silent crash.</p>
<p dir="auto">Attaching the Visual Studio debugger gets me this:</p>
<details>
<summary>Stack trace</summary>
<p dir="auto">
</p><div class="highlight highlight-source-gdb notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" 	plugin.dll!v8::internal::tracing::TraceEventHelper::GetTracingController() Line 20	C++
 	plugin.dll!v8::internal::Heap::DevToolsTraceEventScope::DevToolsTraceEventScope() Line 1526	C++
 	plugin.dll!v8::internal::Heap::CollectGarbage() Line 1558	C++
 	plugin.dll!v8::internal::Heap::AllocateRawWithLightRetrySlowPath() Line 5098	C++
 	plugin.dll!v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath() Line 5113	C++
 	plugin.dll!v8::internal::Factory::AllocateRaw() Line 258	C++
 	plugin.dll!v8::internal::FactoryBase&lt;v8::internal::Factory&gt;::NewRawOneByteString() Line 561	C++
 	plugin.dll!v8::internal::Factory::NewStringFromUtf8() Line 654	C++
 	plugin.dll!v8::String::NewFromUtf8() Line 6457	C++
 	plugin.dll!v8__String__NewFromUtf8() Line 843	C++
&gt;	plugin.dll!rusty_v8::string::{{impl}}::new_from_utf8::{{closure}}(rusty_v8::string::{{impl}}::new_from_utf8::closure-0 sd, rusty_v8::scope::data::ScopeData *) Line 104	Unknown
 	plugin.dll!rusty_v8::scope::HandleScope&lt;tuple&lt;&gt;&gt;::cast_local&lt;rusty_v8::data::String,closure-0&gt;(rusty_v8::string::{{impl}}::new_from_utf8::closure-0 self) Line 224	Unknown
 	plugin.dll!rusty_v8::data::String::new_from_utf8(slice&lt;u8&gt; scope, rusty_v8::string::NewStringType new_type) Line 103	Unknown
 	plugin.dll!rusty_v8::data::String::new(str scope) Line 173	Unknown
 	plugin.dll!serde_v8::ser::{{impl}}::serialize_str(serde_v8::ser::Serializer self, str) Line 413	Unknown
 	plugin.dll!serde::ser::impls::{{impl}}::serialize&lt;serde_v8::ser::Serializer&gt;(alloc::string::String * self, serde_v8::ser::Serializer serializer) Line 60	Unknown
 	plugin.dll!serde_v8::ser::{{impl}}::serialize_value&lt;alloc::string::String&gt;(serde_v8::ser::MapSerializer * self, alloc::string::String * value) Line 336	Unknown
 	plugin.dll!serde::ser::SerializeMap::serialize_entry&lt;serde_v8::ser::MapSerializer,str,alloc::string::String&gt;(serde_v8::ser::MapSerializer * self, str value, alloc::string::String *) Line 1823	Unknown
"><pre class="notranslate"> 	plugin.dll!v8::internal::tracing::TraceEventHelper::GetTracingController() Line <span class="pl-c1">20</span>	C++
 	plugin.dll!v8::internal::Heap::DevToolsTraceEventScope::DevToolsTraceEventScope() Line <span class="pl-c1">1526</span>	C++
 	plugin.dll!v8::internal::Heap::CollectGarbage() Line <span class="pl-c1">1558</span>	C++
 	plugin.dll!v8::internal::Heap::AllocateRawWithLightRetrySlowPath() Line <span class="pl-c1">5098</span>	C++
 	plugin.dll!v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath() Line <span class="pl-c1">5113</span>	C++
 	plugin.dll!v8::internal::Factory::AllocateRaw() Line <span class="pl-c1">258</span>	C++
 	plugin.dll!v8::internal::FactoryBase&lt;v8::internal::Factory&gt;::NewRawOneByteString() Line <span class="pl-c1">561</span>	C++
 	plugin.dll!v8::internal::Factory::NewStringFromUtf8() Line <span class="pl-c1">654</span>	C++
 	plugin.dll!v8::String::NewFromUtf8() Line <span class="pl-c1">6457</span>	C++
 	plugin.dll!v8__String__NewFromUtf8() Line <span class="pl-c1">843</span>	C++
&gt;	plugin.dll!rusty_v8::string::{{impl}}::new_from_utf8::{{closure}}(rusty_v8::string::{{impl}}::new_from_utf8::closure-<span class="pl-c1">0</span> sd, rusty_v8::<span class="pl-k">scope</span>::data::ScopeData *) Line <span class="pl-c1">104</span>	Unknown
 	plugin.dll!rusty_v8::<span class="pl-k">scope</span>::HandleScope&lt;tuple&lt;&gt;&gt;::cast_local&lt;rusty_v8::data::String,closure-<span class="pl-c1">0</span>&gt;(rusty_v8::string::{{impl}}::new_from_utf8::closure-<span class="pl-c1">0</span> self) Line <span class="pl-c1">224</span>	Unknown
 	plugin.dll!rusty_v8::data::String::new_from_utf8(slice&lt;u8&gt; <span class="pl-k">scope</span>, rusty_v8::string::NewStringType new_type) Line <span class="pl-c1">103</span>	Unknown
 	plugin.dll!rusty_v8::data::String::new(str <span class="pl-k">scope</span>) Line <span class="pl-c1">173</span>	Unknown
 	plugin.dll!serde_v8::ser::{{impl}}::serialize_str(serde_v8::ser::Serializer self, str) Line <span class="pl-c1">413</span>	Unknown
 	plugin.dll!serde::ser::impls::{{impl}}::serialize&lt;serde_v8::ser::Serializer&gt;(alloc::string::String * self, serde_v8::ser::Serializer serializer) Line <span class="pl-c1">60</span>	Unknown
 	plugin.dll!serde_v8::ser::{{impl}}::serialize_value&lt;alloc::string::String&gt;(serde_v8::ser::MapSerializer * self, alloc::string::String * value) Line <span class="pl-c1">336</span>	Unknown
 	plugin.dll!serde::ser::SerializeMap::serialize_entry&lt;serde_v8::ser::MapSerializer,str,alloc::string::String&gt;(serde_v8::ser::MapSerializer * self, str value, alloc::string::String *) Line <span class="pl-c1">1823</span>	Unknown
</pre></div>
<p dir="auto"></p>
</details>
<p dir="auto">The observation here is that the String in Rust is correct, meaning the data that is converted to the V8 equivalent is not corrupted.</p>
<p dir="auto">As discussed with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/AaronO/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/AaronO">@AaronO</a>, passing a <code class="notranslate">serde_json::Value</code> to an op in some situations (eg. in plugin api) seems to crash the program.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="➜ ../target/debug/deno --version
deno 1.9.2 (debug, x86_64-apple-darwin)
v8 9.1.269.5
typescript 4.2.2"><pre class="notranslate"><code class="notranslate">➜ ../target/debug/deno --version
deno 1.9.2 (debug, x86_64-apple-darwin)
v8 9.1.269.5
typescript 4.2.2
</code></pre></div>
<p dir="auto">steps to reproduce are here <a href="https://github.com/denoland/deno/pull/10536/files">https://github.com/denoland/deno/pull/10536/files</a>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="➜ cd test_plugin
➜ cargo build &amp;&amp; ../target/debug/deno run --allow-plugin --unstable tests/test.js debug
    Finished dev [unoptimized + debuginfo] target(s) in 0.32s
Plugin rid: 3
[1]    4574 segmentation fault  ../target/debug/deno run --allow-plugin --unstable tests/test.js debug"><pre class="notranslate"><code class="notranslate">➜ cd test_plugin
➜ cargo build &amp;&amp; ../target/debug/deno run --allow-plugin --unstable tests/test.js debug
    Finished dev [unoptimized + debuginfo] target(s) in 0.32s
Plugin rid: 3
[1]    4574 segmentation fault  ../target/debug/deno run --allow-plugin --unstable tests/test.js debug
</code></pre></div>