Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Ban multiple versions of parity-util-mem #922

Closed
ordian opened this issue Mar 21, 2020 · 6 comments · Fixed by paritytech/substrate#5347
Closed

Ban multiple versions of parity-util-mem #922

ordian opened this issue Mar 21, 2020 · 6 comments · Fixed by paritytech/substrate#5347
Assignees
Labels
I4-annoyance Code behaves within expectations, however this “expected behaviour” itself is at issue.

Comments

@ordian
Copy link
Member

ordian commented Mar 21, 2020

To avoid issues like #921, having multiple versions of parity-util-mem should be banned. This can be enforced in CI via https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html or simply by running this command

! grep -qE "parity-util-mem [0-9].+[0-9] \(registry" Cargo.lock

To see where multiple versions of parity-util-mem come from, run (install cargo-tree first)

cargo tree -i -p parity-util-mem:0.6.0

and

cargo tree -i -p parity-util-mem:0.5.2
@rphmeier rphmeier added the I4-annoyance Code behaves within expectations, however this “expected behaviour” itself is at issue. label Mar 22, 2020
@rphmeier
Copy link
Contributor

rphmeier commented Mar 22, 2020

@ordian Will you prepare a PR? I don't want this to sit in the issue tracker indefinitely with a * dependency merged in #921

@TriplEight TriplEight self-assigned this Mar 22, 2020
@burdges
Copy link
Contributor

burdges commented Mar 22, 2020

Rust should ban duplicate #[no_mangle] symbols, no? rust-lang/rust#28179 If so then adding one #[no_mangle] symbol should help detect this at compile time, although maybe this fails under some architectures, making the CI check good too.

@ordian
Copy link
Member Author

ordian commented Mar 22, 2020

@rphmeier I see @TriplEight self-assigned to this (probably for the CI check). Currently the problem is coming from substrate, memory-db needs to be bumped there in order to avoid multiple versions:
https://github.com/paritytech/substrate/blob/42ec6948af7ee2773d95e68bdf04d89abe2f716b/primitives/trie/Cargo.toml#L22

I know that ring uses thing workaround for detecting this at compile time:
https://github.com/briansmith/ring/blob/ddfa683266e8ce41c06feb9f46503dd4e1d47ab1/Cargo.toml#L15-L16

@bkchr
Copy link
Member

bkchr commented Mar 22, 2020

What is the problem of having this util mem multiple times in the depdendcy graph?

@ordian
Copy link
Member Author

ordian commented Mar 22, 2020

@bkchr the problem is that if if one version doesn't enable jemalloc-global feature and another does, then you'll get UB, see #921 (comment)

@ordian
Copy link
Member Author

ordian commented Mar 22, 2020

Here is an example which segfaults on cargo run: https://github.com/ordian/multiple-parity-util-mem-issue.

HCastano added a commit to HCastano/polkadot that referenced this issue Apr 22, 2021
025222498 Fix test
48b41d82b Add support for relaying headers between Rococo and Wococo
f16b6b411 Add CLI support for initializing the Wococo<>Rococo bridge
8c6e6443d Add more Wococo boilerplate code
28d3ed2fe Add Wococo primitives crate
d691c73e9 Fix issue with on-demand headers relay not starting (paritytech#921)
8ee55c1e1 Fix image publishing. (paritytech#922)
f51fb59d0 Prefix in relay loops logs (paritytech#920)

git-subtree-dir: bridges
git-subtree-split: 02522249876f1e2463143a532653764f82e33e07
HCastano added a commit to HCastano/polkadot that referenced this issue Apr 27, 2021
f95cc7a5 Merge branch 'master' into hc-add-wococo-support
a13ee0bc Bump Substrate (paritytech#939)
f8680cbf jsonrpsee alpha6 (paritytech#938)
6163bcbf reonnect to failed client in on-demand relay background task (paritytech#936)
14e82bea Do not spawn additional task for on-demand relays (paritytech#933)
b1557b88 Relay at least one header for every source chain session (paritytech#923)
9420649c Remove deprecated Runtime Header APIs (paritytech#932)
9627011e Update README.md (paritytech#931)
7b736b9c Truncate output in logs. (paritytech#930)
faad06e3 Make sure that relayers have dates in logs. (paritytech#927)
07734535 Update dump-logs script. (paritytech#928)
efe215e4 RustFmt
02522249 Fix test
48b41d82 Add support for relaying headers between Rococo and Wococo
f16b6b41 Add CLI support for initializing the Wococo<>Rococo bridge
8c6e6443 Add more Wococo boilerplate code
c2d56b2e Add pruning to bechmarks & update weights. (paritytech#918)
a30c51dc Add properties to Chain Spec (paritytech#917)
28d3ed2f Add Wococo primitives crate
d691c73e Fix issue with on-demand headers relay not starting (paritytech#921)
8ee55c1e Fix image publishing. (paritytech#922)
f51fb59d Prefix in relay loops logs (paritytech#920)

git-subtree-dir: bridges
git-subtree-split: f95cc7a57b48948f17d33f5be3ea01c752deba94
HCastano added a commit that referenced this issue Apr 29, 2021
801c99f3 Add Wococo<>Rococo Header Relayer (#925)
21f49051 Remove Westend<>Rococo header sync (#940)
06235f16 do not panic if pallet is not yet initialized (#937)
a13ee0bc Bump Substrate (#939)
f8680cbf jsonrpsee alpha6 (#938)
6163bcbf reonnect to failed client in on-demand relay background task (#936)
14e82bea Do not spawn additional task for on-demand relays (#933)
b1557b88 Relay at least one header for every source chain session (#923)
9420649c Remove deprecated Runtime Header APIs (#932)
9627011e Update README.md (#931)
7b736b9c Truncate output in logs. (#930)
faad06e3 Make sure that relayers have dates in logs. (#927)
07734535 Update dump-logs script. (#928)
c2d56b2e Add pruning to bechmarks & update weights. (#918)
a30c51dc Add properties to Chain Spec (#917)
d691c73e Fix issue with on-demand headers relay not starting (#921)
8ee55c1e Fix image publishing. (#922)
f51fb59d Prefix in relay loops logs (#920)

git-subtree-dir: bridges
git-subtree-split: 801c99f3de0fa4d0b61e4e065fa30817179368ea
tomusdrw added a commit that referenced this issue May 3, 2021
f43c92430 Fix account derivation in CLI (#952)
9ac07e733 Add backbone configuration of cargo-spellcheck (#924)
2761c3fef Message dispatch support multiple instances (#942)
801c99f3d Add Wococo<>Rococo Header Relayer (#925)
21f490514 Remove Westend<>Rococo header sync (#940)
06235f162 do not panic if pallet is not yet initialized (#937)
a13ee0bc3 Bump Substrate (#939)
f8680cbfc jsonrpsee alpha6 (#938)
6163bcbf4 reonnect to failed client in on-demand relay background task (#936)
14e82bea3 Do not spawn additional task for on-demand relays (#933)
b1557b882 Relay at least one header for every source chain session (#923)
9420649c1 Remove deprecated Runtime Header APIs (#932)
9627011e1 Update README.md (#931)
7b736b9cc Truncate output in logs. (#930)
faad06e39 Make sure that relayers have dates in logs. (#927)
077345351 Update dump-logs script. (#928)
c2d56b2e9 Add pruning to bechmarks & update weights. (#918)
a30c51dc9 Add properties to Chain Spec (#917)
d691c73e9 Fix issue with on-demand headers relay not starting (#921)
8ee55c1e1 Fix image publishing. (#922)
f51fb59d0 Prefix in relay loops logs (#920)

git-subtree-dir: bridges
git-subtree-split: f43c924301c227d29ec161f6815d9bac458a211d
HCastano added a commit that referenced this issue May 4, 2021
b2099c5c Bump Substrate to `b094edaf` (#958)
3f037094 Bump endowment amounts on Rialto and Millau (#957)
b21fd07c Bump Substrate WASM builder (#947)
30ccd07c Bump Substrate to `ec180313` (#955)
a7422ab1 Upgrade to GitHub-native Dependabot (#945)
ed20ef34 Move pallet-bridge-dispatch types to primitives (#948)
2070c4d6 Endow accounts and add `bridgeIds` to chainspec. (#951)
f43c9243 Fix account derivation in CLI (#952)
9ac07e73 Add backbone configuration of cargo-spellcheck (#924)
2761c3fe Message dispatch support multiple instances (#942)
801c99f3 Add Wococo<>Rococo Header Relayer (#925)
21f49051 Remove Westend<>Rococo header sync (#940)
06235f16 do not panic if pallet is not yet initialized (#937)
a13ee0bc Bump Substrate (#939)
f8680cbf jsonrpsee alpha6 (#938)
6163bcbf reonnect to failed client in on-demand relay background task (#936)
14e82bea Do not spawn additional task for on-demand relays (#933)
b1557b88 Relay at least one header for every source chain session (#923)
9420649c Remove deprecated Runtime Header APIs (#932)
9627011e Update README.md (#931)
7b736b9c Truncate output in logs. (#930)
faad06e3 Make sure that relayers have dates in logs. (#927)
07734535 Update dump-logs script. (#928)
c2d56b2e Add pruning to bechmarks & update weights. (#918)
a30c51dc Add properties to Chain Spec (#917)
d691c73e Fix issue with on-demand headers relay not starting (#921)
8ee55c1e Fix image publishing. (#922)
f51fb59d Prefix in relay loops logs (#920)

git-subtree-dir: bridges
git-subtree-split: b2099c5c0baf569e2ec7228507b6e4f3972143cc
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I4-annoyance Code behaves within expectations, however this “expected behaviour” itself is at issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants