payload: {"action":"created","issue":{"url":"https://api.github.com/repos/elast0ny/shared_memory-rs/issues/33","repository_url":"https://api.github.com/repos/elast0ny/shared_memory-rs","labels_url":"https://api.github.com/repos/elast0ny/shared_memory-rs/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/elast0ny/shared_memory-rs/issues/33/comments","events_url":"https://api.github.com/repos/elast0ny/shared_memory-rs/issues/33/events","html_url":"https://github.com/elast0ny/shared_memory-rs/issues/33","id":500265881,"node_id":"MDU6SXNzdWU1MDAyNjU4ODE=","number":33,"title":"Is it safe to implement SharedMemCast for bool?","user":{"login":"asajeffrey","id":403333,"node_id":"MDQ6VXNlcjQwMzMzMw==","avatar_url":"https://avatars1.githubusercontent.com/u/403333?v=4","gravatar_id":"","url":"https://api.github.com/users/asajeffrey","html_url":"https://github.com/asajeffrey","followers_url":"https://api.github.com/users/asajeffrey/followers","following_url":"https://api.github.com/users/asajeffrey/following{/other_user}","gists_url":"https://api.github.com/users/asajeffrey/gists{/gist_id}","starred_url":"https://api.github.com/users/asajeffrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asajeffrey/subscriptions","organizations_url":"https://api.github.com/users/asajeffrey/orgs","repos_url":"https://api.github.com/users/asajeffrey/repos","events_url":"https://api.github.com/users/asajeffrey/events{/privacy}","received_events_url":"https://api.github.com/users/asajeffrey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2019-09-30T13:08:07Z","updated_at":"2019-10-02T14:17:46Z","closed_at":null,"author_association":"NONE","body":"One of the requirements for bool is that it only has the values `0x00` and `0x01`, so there is a possible safety issue around having `bool` implement `SharedMemCast`."},"comment":{"url":"https://api.github.com/repos/elast0ny/shared_memory-rs/issues/comments/537513888","html_url":"https://github.com/elast0ny/shared_memory-rs/issues/33#issuecomment-537513888","issue_url":"https://api.github.com/repos/elast0ny/shared_memory-rs/issues/33","id":537513888,"node_id":"MDEyOklzc3VlQ29tbWVudDUzNzUxMzg4OA==","user":{"login":"elast0ny","id":19346608,"node_id":"MDQ6VXNlcjE5MzQ2NjA4","avatar_url":"https://avatars1.githubusercontent.com/u/19346608?v=4","gravatar_id":"","url":"https://api.github.com/users/elast0ny","html_url":"https://github.com/elast0ny","followers_url":"https://api.github.com/users/elast0ny/followers","following_url":"https://api.github.com/users/elast0ny/following{/other_user}","gists_url":"https://api.github.com/users/elast0ny/gists{/gist_id}","starred_url":"https://api.github.com/users/elast0ny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elast0ny/subscriptions","organizations_url":"https://api.github.com/users/elast0ny/orgs","repos_url":"https://api.github.com/users/elast0ny/repos","events_url":"https://api.github.com/users/elast0ny/events{/privacy}","received_events_url":"https://api.github.com/users/elast0ny/received_events","type":"User","site_admin":false},"created_at":"2019-10-02T14:17:46Z","updated_at":"2019-10-02T14:17:46Z","author_association":"OWNER","body":"I see what you're saying now. I will re-open the issue.\r\n\r\nIf I look at shared_memory's behavior with your point of view, then the whole crate is essentially unsafe. This is simply the inherent unsafety of sharing memory between two processes (regardless of languages)... Both processes have to agree exactly on what the memory represents or nothing will work, there is simply no way around this.\r\n\r\nThis can be clearly highlighted when using shared_memory in process1 in safe Rust and process2 in C. Process 2 can :\r\n- Mangle the metadata header values\r\n- Cast the shared memory to the wrong types\r\n- Ignore synchronization for data access\r\n- etc... \r\nAs highligted in this issue, some of these could even be done in the \"safe\" use of this crate.\r\n\r\nIm open to suggestions on how to fix this but unfortunately, i believe the only way to get the message across to the users of the crate is to mark essentially 90% of the API unsafe, eg : \r\n- Openning an existing mapping relies on the metadata being valid, this can crash a program if not\r\n- Any operations on locks/events are inherently unsafe as their state might be corrupted\r\n- Every read will be marked unsafe as the contents might be invalid for the chosen data type\r\n- Every write will be marked unsafe as there is no guarante another process isnt writing at the same place corrupting data\r\n\r\nThoughts ?"}}
other: {"actor":{"display_login":"elast0ny"}}