{"action":"created","issue":{"url":"https://api.github.com/repos/rustsim/nalgebra/issues/396","repository_url":"https://api.github.com/repos/rustsim/nalgebra","labels_url":"https://api.github.com/repos/rustsim/nalgebra/issues/396/labels{/name}","comments_url":"https://api.github.com/repos/rustsim/nalgebra/issues/396/comments","events_url":"https://api.github.com/repos/rustsim/nalgebra/issues/396/events","html_url":"https://github.com/rustsim/nalgebra/issues/396","id":362545686,"node_id":"MDU6SXNzdWUzNjI1NDU2ODY=","number":396,"title":"Chasing an UB-smelling bug related to swap_rows","user":{"login":"HadrienG2","id":1305080,"node_id":"MDQ6VXNlcjEzMDUwODA=","avatar_url":"https://avatars1.githubusercontent.com/u/1305080?v=4","gravatar_id":"","url":"https://api.github.com/users/HadrienG2","html_url":"https://github.com/HadrienG2","followers_url":"https://api.github.com/users/HadrienG2/followers","following_url":"https://api.github.com/users/HadrienG2/following{/other_user}","gists_url":"https://api.github.com/users/HadrienG2/gists{/gist_id}","starred_url":"https://api.github.com/users/HadrienG2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HadrienG2/subscriptions","organizations_url":"https://api.github.com/users/HadrienG2/orgs","repos_url":"https://api.github.com/users/HadrienG2/repos","events_url":"https://api.github.com/users/HadrienG2/events{/privacy}","received_events_url":"https://api.github.com/users/HadrienG2/received_events","type":"User","site_admin":false},"labels":[{"id":1044819526,"node_id":"MDU6TGFiZWwxMDQ0ODE5NTI2","url":"https://api.github.com/repos/rustsim/nalgebra/labels/P-high","name":"P-high","color":"eda8ab","default":false},{"id":39675108,"node_id":"MDU6TGFiZWwzOTY3NTEwOA==","url":"https://api.github.com/repos/rustsim/nalgebra/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-09-21T10:08:32Z","updated_at":"2018-10-10T20:42:33Z","closed_at":null,"author_association":"NONE","body":"To the best of my knowledge, the following two code snippets (where `mat` is an owned mutable nalgebra Matrix) should produce the same final result:\r\n\r\n```\r\n// Clean version\r\nmat.swap_rows(r1, r2);\r\n\r\n// Ugly version\r\nlet row1 = mat.fixed_rows::<U1>(r1).into_owned();\r\nlet row2 = mat.fixed_rows::<U1>(r2).into_owned();\r\nmat.fixed_rows_mut::<U1>(r1).copy_from(&row2);\r\nmat.fixed_rows_mut::<U1>(r2).copy_from(&row1);\r\n```\r\n\r\nUnfortunately, I have a program where the former produces different (and wrong) results, with suspiciously UB-ish symptoms: if I add a print statement near the code that does the swap_rows, the results become correct.\r\n\r\nI do not use unsafe myself, so I can only assume that the issue is in nalgebra. But looking at the source code of swap_rows did not reveal anything suspicious, and I was not successful in producing a simpler reproducer that I can share with you so far.\r\n\r\nIf you have more experience in debugging this kind of issues than I do, any tips on how to narrow down the problem further would be much appreciated."},"comment":{"url":"https://api.github.com/repos/rustsim/nalgebra/issues/comments/428724195","html_url":"https://github.com/rustsim/nalgebra/issues/396#issuecomment-428724195","issue_url":"https://api.github.com/repos/rustsim/nalgebra/issues/396","id":428724195,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODcyNDE5NQ==","user":{"login":"pietroalbini","id":2299951,"node_id":"MDQ6VXNlcjIyOTk5NTE=","avatar_url":"https://avatars3.githubusercontent.com/u/2299951?v=4","gravatar_id":"","url":"https://api.github.com/users/pietroalbini","html_url":"https://github.com/pietroalbini","followers_url":"https://api.github.com/users/pietroalbini/followers","following_url":"https://api.github.com/users/pietroalbini/following{/other_user}","gists_url":"https://api.github.com/users/pietroalbini/gists{/gist_id}","starred_url":"https://api.github.com/users/pietroalbini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pietroalbini/subscriptions","organizations_url":"https://api.github.com/users/pietroalbini/orgs","repos_url":"https://api.github.com/users/pietroalbini/repos","events_url":"https://api.github.com/users/pietroalbini/events{/privacy}","received_events_url":"https://api.github.com/users/pietroalbini/received_events","type":"User","site_admin":false},"created_at":"2018-10-10T20:42:33Z","updated_at":"2018-10-10T20:42:33Z","author_association":"NONE","body":"This will also be fixed in Rust 1.29.2, which should be released tomorrow."}}
{"actor":{"display_login":"pietroalbini"}}