You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0'
Cargo.toml:
[dependencies]
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
All you need is to "wrap" IpcSender<T> in your own type and derive Serialize/Deserialize. The error happens during deserialization.
From the backtrace. The error is happening here:
fndeserialize_os_ipc_sender<'de,D>(deserializer:D)
-> Result<OsIpcSender,D::Error>whereD:Deserializer<'de>{let index:usize = Deserialize::deserialize(deserializer)?;OS_IPC_CHANNELS_FOR_DESERIALIZATION.with(|os_ipc_channels_for_deserialization| {// FIXME(pcwalton): This could panic if the data was corrupt and the index was out of// bounds. We should return an `Err` result instead.Ok(os_ipc_channels_for_deserialization.borrow_mut()[index].to_sender())})}
I'm not sure why though.
The text was updated successfully, but these errors were encountered:
I see the problem. The ipc channels expect that they will only be serialized as part of being sent over an IPC channel, so the code that prepares os_ipc_channels_for_deserialization to contain the expected values is never called because the deserialization does not occur as part of receiving on an IPC channel.
@asajeffrey
With the latest ipc-channel commit, the following code panics when ran:
Error:
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0'
Cargo.toml
:All you need is to "wrap"
IpcSender<T>
in your own type and derive Serialize/Deserialize. The error happens during deserialization.From the backtrace. The error is happening here:
I'm not sure why though.
The text was updated successfully, but these errors were encountered: