Skip to content

Revert to () return from ctor functions to fix miri UB#343

Merged
mmastrac merged 5 commits intomasterfrom
miri_test
Aug 10, 2025
Merged

Revert to () return from ctor functions to fix miri UB#343
mmastrac merged 5 commits intomasterfrom
miri_test

Conversation

@mmastrac
Copy link
Owner

@mmastrac mmastrac commented Aug 10, 2025

Issue #341 points out UB reported by miri.

We don't need a zero return from ctor functions on platforms other than Windows.

@mmastrac mmastrac changed the title Miri test Revert to () return from ctor functions to fix miri UB Aug 10, 2025
@mmastrac mmastrac merged commit e9b0339 into master Aug 10, 2025
4 checks passed
github-merge-queue bot pushed a commit to stellar/rs-soroban-sdk that referenced this pull request Oct 7, 2025
### What
Update `ctor` dependency from `0.2.9` to `0.5.0`.

  ### Why
It was reported in #1582 that undefined behaviour was detected by Miri.
The undefined behaviour was in the `ctor` crate, but was fixed in
mmastrac/rust-ctor#343 which was released in
`ctor` `0.5.0`.

### Note

I tried adding miri to CI, but it takes too long, more than an hour.
I've left the makefile target for running miri for future convenience.

Fix #1582
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.

[BUG] Undefined Behavior: calling a function with return type usize passing return place of type ()

1 participant

Comments