WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@themighty1
Copy link
Member

This PR patches a transitive dep sharded-slab in order to allow our wasm build to manually call destructors of objects in thread-local storage.
Fixes: #959

Depends on tlsnotary/tlsn-utils#73

Tested by running the wasm prover 100+ times (whereas before it would panic on the 8th run).

@themighty1
Copy link
Member Author

To follow up on the mattermost discussion. The actual patch is located here https://github.com/tlsnotary/sharded-slab/blob/5dd1d23d5b1f57e52b1858cb3c42ef4748062f3b/src/tid.rs#L18

What this patch does NOT do:

  • it does not free memory, so there is no concern about freed memory being referenced later.

What this patch DOES:

  • release the thread ID back into the pool, otherwise the pool will be starved and we will get a panic.

I additionally checked just in case that:

  • a thread never looks up another thread's ID. Only the actual thread itself looks up its own ID.
  • if the thread ID gets released and after that (highly unlikely) the thread looks up its ID, it will get a fresh ID.

@themighty1
Copy link
Member Author

@sinui0 , ready for review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants