On Thu, Feb 2, 2023 at 10:14 PM h-k-81@hotmail.com wrote:
Hello everyone
While trying to fix the build of the `rust-fallible_collections` package I found out [1] that the crate does not work properly with 32 bit systems. I am not quite sure if my findings are 100% accurate but lets say they are. What would be the best option here? Adding "ExcludeArch" to the spec file?
Thank you for you answers in advance!
Hi!
I'm not familiar with this crate's code (it might be fine, for all I know), but the tests themselves look like they're just begging for UB and crashes :) I think Josh is more familiar with this kind of stuff, but I think it *should* be safe to just skip the test that crashes for Fedora builds of rust-fallible_collections.
Side note: You might not even really need this crate - many APIs for fallible allocations have recently been added to the Rust standard library. For example Vec::try_reserve has been stable since Rust 1.57: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.try_reserve
So depending on what the crate that depends on these APIs needs, you might be able to ditch the dependency on fallible_collections entirely.
Fabio
Well this is awkward, I unretired the `rust-fallible_collections` package because it is a dependency of a dependency but after checking again I don't really need the first dependency. It is only needed for benchmarks und I recently learned that I can just remove such dependencies. So yeah....
Should I just retire it again? I don't mind maintaining it, but if you say that it is no longer needed because the APIs are getting stabilized in the standard library then it wouldn't make sense to keep it.
Hussein
On 2/2/23 22:26, Fabio Valentini wrote:
On Thu, Feb 2, 2023 at 10:14 PM h-k-81@hotmail.com wrote:
Hello everyone
While trying to fix the build of the `rust-fallible_collections` package I found out [1] that the crate does not work properly with 32 bit systems. I am not quite sure if my findings are 100% accurate but lets say they are. What would be the best option here? Adding "ExcludeArch" to the spec file?
Thank you for you answers in advance!
Hi!
I'm not familiar with this crate's code (it might be fine, for all I know), but the tests themselves look like they're just begging for UB and crashes :) I think Josh is more familiar with this kind of stuff, but I think it *should* be safe to just skip the test that crashes for Fedora builds of rust-fallible_collections.
Side note: You might not even really need this crate - many APIs for fallible allocations have recently been added to the Rust standard library. For example Vec::try_reserve has been stable since Rust 1.57: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.try_reserve
So depending on what the crate that depends on these APIs needs, you might be able to ditch the dependency on fallible_collections entirely.
Fabio _______________________________________________ Rust mailing list -- rust@lists.fedoraproject.org To unsubscribe send an email to rust-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/rust@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
On 2/2/23 1:26 PM, Fabio Valentini wrote:
I'm not familiar with this crate's code (it might be fine, for all I know), but the tests themselves look like they're just begging for UB and crashes :) I think Josh is more familiar with this kind of stuff, but I think it *should* be safe to just skip the test that crashes for Fedora builds of rust-fallible_collections.
Yeah, it's a bogus test input: https://github.com/vcombey/fallible_collections/issues/35#issuecomment-14145...
Even on 64-bit, that would be UB to create the invalid Vec/slice, but it seems in practice that goes unnoticed and the impossible alloc fails as the test intends.
So what your saying is that because we create a memory layout for a single u8 value and then set it as the pointer for the Vec which we then trick into thinking that it has a lot of memory causes UB? This would mean that what I wrote into the issue is completely wrong? Is that correct?
Thanks Josh for clarifying!
Hussein
On 2/3/23 01:44, Josh Stone wrote:
On 2/2/23 1:26 PM, Fabio Valentini wrote:
I'm not familiar with this crate's code (it might be fine, for all I know), but the tests themselves look like they're just begging for UB and crashes :) I think Josh is more familiar with this kind of stuff, but I think it *should* be safe to just skip the test that crashes for Fedora builds of rust-fallible_collections.
Yeah, it's a bogus test input: https://github.com/vcombey/fallible_collections/issues/35#issuecomment-14145...
Even on 64-bit, that would be UB to create the invalid Vec/slice, but it seems in practice that goes unnoticed and the impossible alloc fails as the test intends. _______________________________________________ Rust mailing list -- rust@lists.fedoraproject.org To unsubscribe send an email to rust-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/rust@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue